locked
Moving from XIB to Storyboard RRS feed

  • Question

  • User397579 posted

    Hi! I'm new to Xamarin development so apologies if I'm making some incorrect assumptions.

    I'm following the Xamarin Mac tutorial about creating a custom Collection View.

    In the tutorial a XIB file is created to define the layout of the Collection View Item. In fact, creating a View Controller from the New File menu always creates a XIB file. But elsewhere in the documentation it is stated that XIB files are no longer recommended for development, and Storyboards should be used instead.

    Can anyone point me to a resource or help me work out how to use a Storyboard instead of a XIB?

    Thanks!!

    Thursday, October 29, 2020 11:35 AM

All replies

  • User35201 posted

    There are a number of resources to xib vs storyboard, one i found included https://www.creitive.com/global/blog/storyboards-versus-xibs-versus-custom-code

    The short version is if you use storyboards they contain many views for a section of your application, so you don't need a separate one per view. The template for CollectionViewItem gives you a xib because of this.

    This documentation is Xamarin.iOS not Xamarin.Mac, and there are differences between UICollectionView and NSCollectionView, but may be helpful: https://docs.microsoft.com/en-us/xamarin/ios/user-interface/controls/uicollectionview

    Thursday, October 29, 2020 4:06 PM
  • User397579 posted

    Thanks Chris

    So to clarify - in the case of a custom collection view it's actually more appropriate to use the XIB file, rather than place inside a storyboard?

    Thanks for your help and the links

    Thursday, October 29, 2020 4:48 PM