Skip to end of metadata
Go to start of metadata

Crosslight fully supports universal iOS apps by providing features that allow you to easily differentiate the root view controller to be used in iPhone and iPad. In the user experience guideline, Apple recommends the use of more intuitive view controller on the iPad due to its larger screen real estate. Crosslight conforms to the guideline by providing iPad specific view controllers such as explained in iOS Master Detail.

Based on the specified root ViewModel, Crosslight can automatically start the iOS apps by picking up the appropriate view controller based on device kind. For example, assuming that you have setup the root ViewModel to ItemListViewModel. In your iOS project, you can have two view controllers targeting the same ViewModel type and decorate them with the RegisterNavigation attribute instantiated with the device kind constructor. See the following illustration for details.

The following example shows the usage of RegisterNavigation attribute which is applied in ItemListViewController for the Phone kind, and ItemCollectionViewController for the Tablet kind.

Additionally, the DeviceKind property specified in the RegisterNavigation attribute is also taken account by navigation services and various navigation components such as drawer navigation and master detail view component.

For more information about navigation concept in Crosslight, see Designing Consistent Navigation Interface.

The approach described above is ideal for scenarios where the view controller type is completely different between the iPhone and iPad version. However, if both device kind is using the same view controller, but you would like to customize the layout for each device kind, please consider using storyboard. Starting with Crosslight 5, you can design view for various iOS device kind and screen resolution with universal storyboard. For more information, see Working with iOS Universal Storyboards.