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;








0















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?










share|improve this question






















  • 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

















0















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?










share|improve this question






















  • 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













0












0








0








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?










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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

















  • 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












1 Answer
1






active

oldest

votes


















0














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 = ...







share|improve this answer























    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
    );



    );













    draft saved

    draft discarded


















    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









    0














    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 = ...







    share|improve this answer



























      0














      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 = ...







      share|improve this answer

























        0












        0








        0







        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 = ...







        share|improve this answer













        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 = ...








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 3:27









        DannyDanny

        111




        111





























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

            Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?