Forum Xamarin Xamarin.iOS

Creating UIViewController with XIB


The problem I am facing is that in the newest releases of Xamarin iOS there are no options for creating ViewController with XIB.
We are currently working on a project that has already established architecture where we used to create ViewControllers with XIB and they would be synced in automatically.
The usual way would be to choose New Item > Apple > UIViewController with XIB.

I am wonder what is the new alternative for this or was this option moved to some other place?

Sincerely, Aleksandar
Software Developer


  • dqmarkdqmark UAMember ✭✭

    @AleksandarRadosevic how did you solve the issue?

  • dqmarkdqmark UAMember ✭✭
    edited December 2018

    Does anyone know why could ViewController dissapear or move to somewhere? It was in the list two weeks ago. I simply cannot create viewcontroller in new project. I need the one that creates xib, class and designer at once.

  • @dqmark Sadly the only way we got it to work is by copying the old xib/class and designer from previous ViewControllers we had. You will have to get in them and rename everything the way you want it to be, but it seems that Xamarin doesn't want you to create views that way anymore.

  • dqmarkdqmark UAMember ✭✭

    @AleksandarRadosevic that's pretty strange as the problem has just appeared for me and it was alright 2 weeks ago, and you have it since June. Will try to contact Xamarin support regarding this question

  • LandLuLandLu Member, Xamarin Team Xamurai

    @dqmark This template has been removed on Visual Studio for Windows. Apple also doesn't recommend us to use Xib to construct projects. If you do want to use that, Try to use Visual Studio for Mac. That tool still involves this feature.
    Or you can try another workaround:
    Make sure set an unique id for this Xib.

  • dqmarkdqmark UAMember ✭✭

    @LandLu so what's recommended way now? From my experience xib was the best way because it's much more decoupled than storyboard one.

  • LandLuLandLu Member, Xamarin Team Xamurai

    Why not try storyboard. It's not difficult to use. And you can place a group of view controllers which have some relationships between each other in a storyboard file.

  • dqmarkdqmark UAMember ✭✭

    @LandLu as i said standalone viewcontrollers are much more decoupled, therefore reusable, you don't segues to describe transitions (e.g. you can implement custom constructor with parameters you need, say for dependency injection), it's the way IoC frameworks work with viewcontrollers (e.g. MVVMCross mentioned in stackoverflow link you posted). Cannot think of a single reason to use storyboard over standalone xibs. Is there any hope Xamarin team will bring it back? Where can I write to ask for it? Just leave it as an option people who know why they use it will use.

  • @dqmark Sadly I think they are not going to bring them back, at least there was no mention about them. I am not sure is it possible to copy single ViewController from old project to new one and do it the old fashion way. That said, having storyboards, the only way to keep it clean is to decouple them with not having more than 5-7 view controllers in one. Also sagues, iOS standard navigation, push and pop will have to be handled through storyboards and sadly they don't perform that well on Visual Studio on Windows.

  • dqmarkdqmark UAMember ✭✭

    @AleksandarRadosevic but as you have seen above you need to change some ids by yourself, I see it as very error-prone solution. And it's just more tedious. Also I don't want to use storyboards from my personal experience (I have mentioned the reasons above) and from a lot of articles of native development.

Sign In or Register to comment.