What class should manage/control the CALayers in my view using proper MVC?
Posted
by wanderlust
on Stack Overflow
See other posts from Stack Overflow
or by wanderlust
Published on 2010-04-05T00:11:53Z
Indexed on
2010/04/05
0:13 UTC
Read the original article
Hit count: 300
I have a ViewController with a view (UIView). I need to handle touches, run some logic, check against model data, and and add and remove sublayers to the view based on those touches. Then I need to update the model based on the results.
Should I have:
ViewController - manage touches, get/set model data, add/remove sublayers
UIView
CALayer
Sublayers
or
Controller (NSObject) - get/set data
ViewController - manage touches, add/remove sublayers
UIView
CALayer
Sublayers
or
Controller (NSObject) - get/set data
CustomView - manage touches, add/remove sublayers
CALayer
Sublayers
Or is it something else all together? No matter what I try, it "feels" awkward. SVN is my friend.
Can you guys help a girl (with architectural issues) out?
© Stack Overflow or respective owner