Reputation: 38142
How should one proceed if he has to develop the same app on iPhone and iPad? Should all View files be separate with same controller and Model files?
Upvotes: 0
Views: 877
Reputation: 70663
This depends on your app, and the differences between your UI on the iPhone and the iPad.
For some views, I've had success in using the same view and view controller classes, with a few run-time checks for the idiom or window size; but that's because there wasn't much difference in those particular view's UI architecture between iPhone/iPad idioms.
Upvotes: 1
Reputation: 20236
You separate things where you need to. If everything in your iPad views match up with items in your iPhone views, you can (typically) reuse much (if not all) of the view controller.
I have found myself, more often than not, creating a subclass for the common idioms, and then extending that for iphone/ipad based on their differences. It's not a fabulous solution, but it works.
Upvotes: 1