Stanford CS193p: Developing Applications For iOS Spring 2016
Stanford CS193p: Developing Applications For iOS Spring 2016
CS193p
Spring 2016
Today
MVC
Object-Oriented Design Pattern
CS193p
Spring 2016
MVC
Controller
Model View
Spring 2016
MVC
Controller
Model View
Spring 2016
MVC
Controller
Model View
Spring 2016
MVC
Controller
Model View
Spring 2016
MVC
Controller
Model View
Spring 2016
MVC
Controller
Model View
Spring 2016
MVC
Controller
outlet
Model View
Spring 2016
MVC
Controller
outlet
Model View
Spring 2016
MVC
Controller
?
outlet
Model View
Spring 2016
MVC
Controller
outlet
Model View
Spring 2016
MVC
target
Controller
outlet
Model View
Spring 2016
MVC
target
action
Controller
outlet
Model View
Spring 2016
MVC
target
Controller
outlet
action
Model View
Spring 2016
MVC
target
Controller
outlet
action
Model View
The View sends the action when things happen in the UI.
CS193p
Spring 2016
MVC
target
Controller
outlet
action
should
will did
Model View
Spring 2016
MVC
should target
will did
Controller
outlet
de
le
g
at
action
e
Model View
Spring 2016
MVC
should target
will did
Controller
outlet
de
le
g
at
action
e
Model View
Spring 2016
MVC
should target
will did
Controller
outlet
de
le
g
at
action
e
Model View
Spring 2016
MVC
should target
will did
Controller
outlet
de
le
g
at
action
e
Model data View
count
at
Spring 2016
MVC
should target
will did
Controller
data
count
outlet
at
da
de
ta
le
g
so
at
u action
e
rc
e
Model View
Spring 2016
MVC
should target
will did
Controller
data
count
outlet
at
da
de
ta
le
g
so
at
u action
e
rc
e
Model View
Spring 2016
MVC
should target
will did
Controller
data outlet
?
count
at
da
de
ta
le
g
so
at
u action
e
rc
e
Model View
Spring 2016
MVC
should target
will did
Controller
data
count
outlet
at
da
de
ta
le
g
so
at
u action
e
rc
e
Model View
Spring 2016
MVC
should target
will did
Controller
data
count
outlet
at
da
de
ta
le
g
so
at
u action
e
rc
e
Model View
Spring 2016
MVC
should target
will did
Controller
data
count
outlet
at
da
de
Notification
ta
le
& KVO
g
so
at
u action
e
rc
e
Model View
Spring 2016
MVC
should target
will did
Controller
data
count
outlet
at
da
de
Notification
ta
le
& KVO
g
so
at
u action
e
rc
e
Model View
Spring 2016
MVC
should target
will did
Controller
data
count
outlet
at
da
de
Notification
ta
le
& KVO
g
so
at
u action
e
rc
e
Model View
Spring 2016
MVC
should target
will did
Controller
data
count
outlet
at
da
de
Notification
ta
le
& KVO
g
so
at
u action
e
rc
e
Model View
Spring 2016
MVC
should target
will did
Controller
data
count
outlet
at
da
de
Notification
ta
le
& KVO
g
so
at
u action
e
rc
e
Model View
Spring 2016
MVCs working together
CS193p
Spring 2016
MVCs not working together
CS193p
Spring 2016
Demo
Calculator continued …
“Computed” properties (instance variables which are computed rather than stored)
switch
Functions as types
Closure syntax for defining functions “on the fly”
UIStackView
CS193p
Spring 2016