What is the best/recommended way to gather user input selections in MVC app design?Any patterns for modelling board games?What is the recommended approach to providing user notifications / confirmations in MVC?ASP.NET MVC Model Patterns: What works best?Model-View-Presenter in WinFormsHow does an MVC system work?Nested MVC communication patternsCorrectly handling multiple views in a MVC javascript gameSpritekit Swift game menu zooms in the screenIOS - How to hide a view by touching anywhere outside of itHow add users input into TableViewController. Also please explain me, how MVC will work in this case
Under what charges was this character executed in Game of Thrones, The Bells?
Acronyms in HDD specification
Can you pick an advanced rogue talent with the extra rogue talent feat?
How can we allow remote players to effectively interact with a physical tabletop battle-map?
Should I communicate in my applications that I'm unemployed out of choice rather than because nobody will have me?
Why does SSL Labs now consider CBC suites weak?
Is it wrong to omit object pronouns in these sentences?
A case where Bishop for knight isn't a good trade
Re-testing of regression test bug fixes or re-run regression tests?
Is there any good reason to write "it is easy to see"?
Segmentation fault when popping x86 stack
Biology of a Firestarter
How was this character able to keep fighting effectively in S8E5 of Game of Thrones?
"Every hiker climbed a hill", is there one or multiple hills?
What is this old US Air Force plane?
Is SSH secure against MiTM if server fingerprint is not checked, public key authentication is used and confidentiality is not needed for that service?
Do Life Drain attacks from wights stack?
Extract the characters before last colon
Smooth function that vanishes only on unit cube
Why was my Canon Speedlite 600EX triggering other flashes?
Is Valonqar prophecy unfulfilled?
Why didn't the Avengers use this object earlier?
Will the volt, ampere, ohm or other electrical units change on May 20th, 2019?
Find the unknown area, x
What is the best/recommended way to gather user input selections in MVC app design?
Any patterns for modelling board games?What is the recommended approach to providing user notifications / confirmations in MVC?ASP.NET MVC Model Patterns: What works best?Model-View-Presenter in WinFormsHow does an MVC system work?Nested MVC communication patternsCorrectly handling multiple views in a MVC javascript gameSpritekit Swift game menu zooms in the screenIOS - How to hide a view by touching anywhere outside of itHow add users input into TableViewController. Also please explain me, how MVC will work in this case
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm creating an app that requires users to setup the game with certain preferences/parameters to the game (number of points to play to, number of players, etc.) and am wondering what is a generally recommended way to gather these inputs. The things I'm struggling with is that I'm trying to adhere to MVC design to separate my View (buttons) from my Model (variable values), but that means that whenever the user touches a button to change one preference, I need to update 2 things: both the View and the Model. Seems kind of inefficient. In my case, would it be better to reload the display and re-save the relevant variable for that preference every time the button is clicked, or would it be better to do nothing with my model when each button is clicked until the user finally clicks to "create the game", in which I scan through all the buttons and gather what their current states are?
swift design-patterns
add a comment |
I'm creating an app that requires users to setup the game with certain preferences/parameters to the game (number of points to play to, number of players, etc.) and am wondering what is a generally recommended way to gather these inputs. The things I'm struggling with is that I'm trying to adhere to MVC design to separate my View (buttons) from my Model (variable values), but that means that whenever the user touches a button to change one preference, I need to update 2 things: both the View and the Model. Seems kind of inefficient. In my case, would it be better to reload the display and re-save the relevant variable for that preference every time the button is clicked, or would it be better to do nothing with my model when each button is clicked until the user finally clicks to "create the game", in which I scan through all the buttons and gather what their current states are?
swift design-patterns
It seems more efficient to just collect all preferences when the game is created instead of each time a button is clicked, then updating the variables.
– Kayan
Mar 23 at 15:20
If it bothers you use a binding framework like RxSwift then your model updates automagically when your ui changes.
– Josh Homann
Mar 23 at 16:11
add a comment |
I'm creating an app that requires users to setup the game with certain preferences/parameters to the game (number of points to play to, number of players, etc.) and am wondering what is a generally recommended way to gather these inputs. The things I'm struggling with is that I'm trying to adhere to MVC design to separate my View (buttons) from my Model (variable values), but that means that whenever the user touches a button to change one preference, I need to update 2 things: both the View and the Model. Seems kind of inefficient. In my case, would it be better to reload the display and re-save the relevant variable for that preference every time the button is clicked, or would it be better to do nothing with my model when each button is clicked until the user finally clicks to "create the game", in which I scan through all the buttons and gather what their current states are?
swift design-patterns
I'm creating an app that requires users to setup the game with certain preferences/parameters to the game (number of points to play to, number of players, etc.) and am wondering what is a generally recommended way to gather these inputs. The things I'm struggling with is that I'm trying to adhere to MVC design to separate my View (buttons) from my Model (variable values), but that means that whenever the user touches a button to change one preference, I need to update 2 things: both the View and the Model. Seems kind of inefficient. In my case, would it be better to reload the display and re-save the relevant variable for that preference every time the button is clicked, or would it be better to do nothing with my model when each button is clicked until the user finally clicks to "create the game", in which I scan through all the buttons and gather what their current states are?
swift design-patterns
swift design-patterns
asked Mar 23 at 13:56
KayanKayan
264
264
It seems more efficient to just collect all preferences when the game is created instead of each time a button is clicked, then updating the variables.
– Kayan
Mar 23 at 15:20
If it bothers you use a binding framework like RxSwift then your model updates automagically when your ui changes.
– Josh Homann
Mar 23 at 16:11
add a comment |
It seems more efficient to just collect all preferences when the game is created instead of each time a button is clicked, then updating the variables.
– Kayan
Mar 23 at 15:20
If it bothers you use a binding framework like RxSwift then your model updates automagically when your ui changes.
– Josh Homann
Mar 23 at 16:11
It seems more efficient to just collect all preferences when the game is created instead of each time a button is clicked, then updating the variables.
– Kayan
Mar 23 at 15:20
It seems more efficient to just collect all preferences when the game is created instead of each time a button is clicked, then updating the variables.
– Kayan
Mar 23 at 15:20
If it bothers you use a binding framework like RxSwift then your model updates automagically when your ui changes.
– Josh Homann
Mar 23 at 16:11
If it bothers you use a binding framework like RxSwift then your model updates automagically when your ui changes.
– Josh Homann
Mar 23 at 16:11
add a comment |
1 Answer
1
active
oldest
votes
In MVC on iOS, you would usually have your controls/buttons in your view, trigger an IBAction in controller, which would, in turn, update the model with the selected choices.
class StartVC: UIViewController
var game = GameModel()
@IBAction func changedNumberOfPlayers(_ sender: Any)
game.numberOfPlayers = ...
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314428%2fwhat-is-the-best-recommended-way-to-gather-user-input-selections-in-mvc-app-desi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In MVC on iOS, you would usually have your controls/buttons in your view, trigger an IBAction in controller, which would, in turn, update the model with the selected choices.
class StartVC: UIViewController
var game = GameModel()
@IBAction func changedNumberOfPlayers(_ sender: Any)
game.numberOfPlayers = ...
add a comment |
In MVC on iOS, you would usually have your controls/buttons in your view, trigger an IBAction in controller, which would, in turn, update the model with the selected choices.
class StartVC: UIViewController
var game = GameModel()
@IBAction func changedNumberOfPlayers(_ sender: Any)
game.numberOfPlayers = ...
add a comment |
In MVC on iOS, you would usually have your controls/buttons in your view, trigger an IBAction in controller, which would, in turn, update the model with the selected choices.
class StartVC: UIViewController
var game = GameModel()
@IBAction func changedNumberOfPlayers(_ sender: Any)
game.numberOfPlayers = ...
In MVC on iOS, you would usually have your controls/buttons in your view, trigger an IBAction in controller, which would, in turn, update the model with the selected choices.
class StartVC: UIViewController
var game = GameModel()
@IBAction func changedNumberOfPlayers(_ sender: Any)
game.numberOfPlayers = ...
answered Mar 25 at 3:27
DannyDanny
111
111
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314428%2fwhat-is-the-best-recommended-way-to-gather-user-input-selections-in-mvc-app-desi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It seems more efficient to just collect all preferences when the game is created instead of each time a button is clicked, then updating the variables.
– Kayan
Mar 23 at 15:20
If it bothers you use a binding framework like RxSwift then your model updates automagically when your ui changes.
– Josh Homann
Mar 23 at 16:11