Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in the manual

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

MVVM in iOS/Mac applications with FRP

No description
by

Viktor Belényesi

on 2 April 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of MVVM in iOS/Mac applications with FRP

FRP + iOS + MVVM
What is FRP?
What is MVVM?
Why FRP?
Why MVVM?
Nobody knows
wikipedia
Functional reactive programming (FRP) is a programming paradigm for
reactive programming
using the building blocks of
functional programming
.
What is FRP for me (today)?
Declarative UI programming
Persistence is easy
Network/Service layer is easy
+
=
UI + business logic are hard
users are hard
people are complicated
Details
Software development is about the details
In UI there are
a lot of details
Start with a clear design, then the requests
“If there is network but only 3G please disable this button”
another BOOL flag
another if
another state
Tests
UI is about user interactions and animations
acceptance tests are slow and flaky by nature
Why UI is hard?
What is ReactiveCocoa?
Objective C port of Rx
Signals
of events
Stream
Push
Pull
of values
futures and promises
~
map
filter
fold...
Why ReactiveCocoa?
it has binding, yuhuuuu!
why not?
Demo
MVC
Model
View
Controller
MVVM
Model
View
ViewModel
UT for UI
binding
commands
UIView + UIViewController
MVC vs MVVM
C is more powerful
than VM
V knows about M
V has an M instance
V can't see M
VM is thin, just
ties V to M
V has a VM instance
ViewModel
View
enabled signal [YES/NO]
loginCommand
executing signal
executionSignals
1. loginsignal
...
YES
2. loginsignal
NO
3. loginsignal
YES
4. loginsignal
YES
flatten
...
YES
NO
YES
YES
map
...
"login was
successful"
"wrong username
or password"
bind to errorMessageLabel.text
...
YES
NO
YES
YES
...
NO
YES
NO
NO
not
bind to activityIndicator.hidden
tap
try to execute
tap
ViewModel
View
enabled signal
loginCommand
...
f
fo
foo
type
type
...
x
b
ba
usernameField.rac_textSignal
passwordField.rac_textSignal
...
YES
YES
YES
NO
...
YES
NO
YES
YES
map (isStringValid)
map (isStringValid)
...
YES
NO
YES
NO
combineLatest & reduce
bind to loginButton.hidden
See the full transcript