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

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

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