Xamarin iOS interface builder issue
Hello there, it's about few month since I wrote something to this blog and I'm happy to return (:
Today I want to discuss a bug in Xamarin.iOS I encountered with and share a solution for it with you, in case you struggling with the same problem. Lets go!
Today I want to discuss a bug in Xamarin.iOS I encountered with and share a solution for it with you, in case you struggling with the same problem. Lets go!
Before we begin I want to thank Microsoft/Xamarin support for fast response to my ticket and providing me a workaround that I share with you today.
Prehistory.
I was a Xamarin fan since for a pretty long time. I used it primarily on Android as to me as a .NET guy (who owns a bunch of Android devices) a thought that I can bring my .NET expertise to mobile was terrific. Also C# to me was much better, expressive, powerful and compact than Java. Time passed, and now I switched to Apple devices, and decided to develop something for it. I've created simple iOS app in my Xamarin Studio on my Mac. Learned iOS, while Microsoft acquired Xamarin and released Visual Studio for Mac. My app grew and after last update something went wrong...
The problem.
After updating my Xamarin and VS4Mac I wasn't actually able to open my Main.storyboard file. Interface builder couldn't render it at all. Nothing, just endless spinner rotation while app still builds and runs. XCode interface builder was able to render interface but with 1 minute lags on any operation on my app's UI. So bad. Sometimes in Visual Studio "MonoTouchDesignServerUnified quit unexpectedly" error window appeared. Googling solution leads to a bunch of useless advices and I decided to contact support (and learn Swift:)).
Solution.
The problem was that Xamarin rendered my views as custom views which isn't true. That operation take a long time. It's a bug and it will be fixed soon (everyone makes mistakes). As for now solution is to add to all your ViewControllers classes DesignTimeVisibleAttribute with False value. That simple line of code did the trick and saved my project. Storyboard started rendering very fast and even XCode stopped lagging. Hope it will be helpful to someone struggling this error and happy coding :)
It's Very Nice and Such an ideal piece of blog
ReplyDeleteiOS App Development Online Training