Professional Documents
Culture Documents
CS193p!
Winter 2015
Today
Continuation of Calculator Demo
Another thousand words (or so)?
MVC
CS193p!
Winter 2015
Demo
Calculator continued
Array<T>
Computed properties (instance variables which are computed rather than stored)
switch
Functions as types
Closure syntax for defining functions on the fly
Methods with the same name but different argument types
More Autolayout
CS193p!
Winter 2015
MVC
Controller
Model
View
MVC
Controller
Model
View
MVC
Controller
Model
View
MVC
Controller
Model
View
MVC
Controller
Model
View
MVC
Controller
Model
View
MVC
Controller
Model
outlet
View
MVC
Controller
Model
outlet
View
MVC
Controller
Model
outlet
?
View
MVC
Controller
Model
outlet
View
MVC
target
Controller
Model
outlet
View
MVC
target
Controller
outlet
action
Model
View
MVC
target
Controller
outlet
action
Model
View
The View sends the action when things happen in the UI.
CS193p!
Winter 2015
MVC
target
Controller
outlet
action
should
Model
will
did
View
MVC
target
should
will
did
Controller
outlet
te
ga
le
de
Model
action
View
MVC
target
should
will
did
Controller
outlet
te
ga
le
de
Model
action
View
MVC
target
should
will
did
Controller
outlet
te
ga
le
de
Model
action
View
MVC
target
should
will
did
Controller
outlet
te
ga
le
de
Model
data
at
action
View
count
MVC
target
should
will
did
Controller
data
at
count
Model
te
ga
le
de
da
ta
outlet
so
u
rc
e
action
View
MVC
target
should
will
did
Controller
data
at
count
Model
te
ga
le
de
da
ta
outlet
so
u
rc
e
action
View
MVC
target
should
will
did
Controller
Model
count
da
ta
outlet
te
ga
le
de
data
at
so
u
rc
e
action
View
MVC
target
should
will
did
Controller
data
at
count
Model
te
ga
le
de
da
ta
outlet
so
u
rc
e
action
View
MVC
target
should
will
did
Controller
data
at
count
Model
te
ga
le
de
da
ta
outlet
so
u
rc
e
action
View
MVC
target
should
will
did
Controller
data
at
Model
da
ta
outlet
te
ga
le
de
Notification!
& KVO
count
so
u
rc
e
action
View
MVC
target
should
will
did
Controller
data
at
Model
da
ta
outlet
te
ga
le
de
Notification!
& KVO
count
so
u
rc
e
action
View
MVC
target
should
will
did
Controller
data
at
Model
da
ta
outlet
te
ga
le
de
Notification!
& KVO
count
so
u
rc
e
action
View
MVC
target
should
will
did
Controller
data
at
Model
da
ta
outlet
te
ga
le
de
Notification!
& KVO
count
so
u
rc
e
action
View
CS193p!
Winter 2015
CS193p!
Winter 2015