I did not find anything in the official documentation, how to call the classes “by Fenshui”, if there is a separation of the UI according to the devices? For example, there is a MenuViewController for iPad and a separate one for the iPhone , while I MenuViewController_iPad stopped at the MenuViewController_iPad and MenuViewController_iPhone
2 answers
I just like you described and doing: MenuViewController_iPad and MenuViewController_iPhone . The code common to the two classes can then be rendered MenuViewController in MenuViewController
Even if all controllers are created with the help of storyboards or xybs, all the same in complex projects there is a problem of quite weighty differences between displaying content for iPad and for iPhone. UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad , of course, a way, but applicable only in the case of small differences. In the case of massive changes, the code becomes unreadable.
You can call a storyboard storyboard-ipad and storyboard-iphone, but why create two classes for the same controller in different storyboards. You only need one class, and you can already connect it to the controller in the storyboard-ipad and connect it to the storyboard-iphone, and divide the code in the class for the ipad and iphone by the condition UI_USER_INTERFACE_IDIOM () == UIUserInterfaceIdiomPad if your code is different
- @ Alexander Sadikov doesn’t use storyboards and xibs in the project, this allows you to create custom views and display content on different devices in completely different ways - Alexey Alybin