Search code examples
xamarin.iosxamarinxibviewcontroller

How can I do to associate a Xib to same viewcontrollers?


I have a lot of view controllers that xib is the same. How can I do to associate a Xib to same viewcontrollers in MonoTouch?. I have created a xib only in IB but Xamarin Studio doesn't creates a ".h file".


Solution

  • The simplest and cleanest way is to do a base UIViewController with the nib and inherit from it. This way you follow the DRY principle.