Upgrade to Pro — share decks privately, control downloads, hide ads and more …

FLUX approach in Swift

Avatar for DAloG DAloG
February 19, 2016

FLUX approach in Swift

Avatar for DAloG

DAloG

February 19, 2016
Tweet

More Decks by DAloG

Other Decks in Programming

Transcript

  1. @DAlooG ABOUT ME ➤iOS Developer at Sigma Software ➤Enterprise and

    client applications ➤Team leader ➤Mentor ➤Consultant 2
  2. @DAlooG PROBLEMS ➤Controller need to rule view and model layers

    ➤View receive updates. So order of updates is important ➤Model receive updates. So order of updates is important ➤Controller is bloated with responsibilities 8
  3. « @DAlooG I say with confidence as a former UIKit

    author: React's model for the UI layer is vastly better than UIKit's. React Native is a *huge* deal. https://twitter.com/andy_matuschak/ status/560511204867575808 11
  4. « @DAlooG One can merge the MVC roles played by

    an object, making an object, for example, fulfill both the controller and view roles—in which case, it would be called a view controller. http://apple.co/1U6DPF3 13
  5. @DAlooG ACTION / COMMAND ➤Representation of increment ➤User actions (tap,

    gestures, shake) ➤API callbacks ➤Timer events ➤Action is immutable ➤Action is serializable ➤Action is printable 23
  6. @DAlooG STORE / REDUCER / UPDATE ➤Stores data ➤Update data

    according to actions ➤Notify listeners about data updates ➤Most application logic lives here ➤Covered with Unit Tests ➤Implemented as class 25
  7. @DAlooG STATE ➤Immutable value type ➤Valid most of the times

    ➤Domain specific ➤Implemented as struct 26