Reputation: 25
i have a UIViewController class that do the following:
detect movement.
array a bunch of images and do some orders manipulation.
insert images to the view.
animate some images.
do i need to separate some of this steps to different classes ? if so why and to which class type.
tia.
Upvotes: 1
Views: 134
Reputation: 15180
I feel this is somewhat subjective, but personally I'd separate them as follows:
MODEL:
VIEW:
CONTROLLER:
Upvotes: 0
Reputation: 4843
Might be an idea to get a book like Beginning iPhone Development. As ennuikiller said iPhone applications are built using the model, view, controllers concept. The book bring you's up the core ideas of how to develop iPhone applications.
Upvotes: 0
Reputation: 46965
Usually you'll want to have separate classes for your model, view, and controllers. Therefore if you'll usually have something like this:
MyViewController.m, MyView.m, MyModel.m
at the very least. Note that if you build your view with IB then you'll have a MyView.xib file instead of MyView.m.
This would be only a beginning point however. Depending upon the complexity of your app you'll probably wind up with many more classes that factor out common state and functionality. In general it is a bad idea to put everything into one class. This holds as much for any oo language as it does for objective-c
Upvotes: 1