Can someone explain if there is still any use for nib or xib files in iOS development these days? Are xib files even still supported in XCode?
If you wanted to create a new app and/or multiple views in those apps in a non-programmatic way you would simply use Storyboard now. Am I thinking about this correctly?
I use xibs all the time for common cells and views shared between different views. You can't do that with a storyboard.
Related
I've heard arguments on localizing a StoryBoard file (the way apple recommends - might) not be a good idea. The recommended way is to highlight storyboard in the project navigation and then localize it by clicking a language in the file inspector.
Here is the other way suggested: Remove all strings from the storyboard and in the ViewController file itself load the localized Strings per UI element. The argument for this is that multiple storyboard files are created per localization and the UI constraints are sometimes not kept. You end up with localized storyboards that have different UI constraints. Thus the storyboards are not identical in layout. Can anyone verify if this is the case?
I have a task to localize a few storyboards and want to know all your ideas and best approach ? BTW not all my layouts that i have inherited from other developers are auto-layout.
It seems in the previous version of xcode below xcode 6 it duplicates storyboards when localizing them. In the newer version of xcode it does not duplicate the storyboard. Instead it creates a text localization file and keeps just one storyboard. You can localize the storyboard the same way as you localize any file from the file inspector.
I am trying to understand an app and I'd like to be able to see a visual representation of the project (without running the simulator). It appears the developer didn't use a storyboard in building the app. Is this common? What is a good way to see the views without running the project?
Thanks I'm a pretty serious iOS noob :)
If there's no storyboard, then watch out for .xib file. Those files contain visual representation of a particular class or view controller.
im starting a new project now and I would like to build it with nibs and not with storyboard, apple removed the option in xcode 5 to build an app without storyboard, my question is that is there any recommendations by apple that developers should develop with storyboard and other xib files will not be allowed in the future? or its ok and apple will always support nib files without storyboard projects and allow it to be submitted in the future
thanks
Apple certainly seem to be pushing people to use Storyboards, but there's nothing to stop you removing Storyboards from a project and just using Xibs. I only use Storyboards sometimes, occasionally use Xibs, and often write entire apps programmatically (no Xibs or Storyboards at all). There are a number of important use cases which are only possible using Xibs, so they won't be going anywhere any time soon.
The only change Apple made was that project templates always include a Storyboard - but you can still remove it once you've created a new project.
I have an app that has a single XIB file for the interface. I'd like to move to storyboard. I've created the storyboard, add all of the relevant UI elements and linked them to the header file (IBoutlets). I've gone to my project summary and selected my storyboard in the iPad deployment section.
My problem is that the app is still using the XIB, rather than my storyboard. Any ideas?
Switching from Xib to Storyboard is still buggy...
Delete the App manually from your iPhone/simulator or restore the simulator. Clear your Project, etc. Maybe you have to restart Xcode too.
I have been watching some of the solutions for this problem. There's any solution that not implies changing the code? I have seen solutions like put an if/else with the device type every time I load a ViewController. Theres no a way with xcode that this step is automaticaly done?
If you are using storyboards in the info.plist you can choose by configuration each storyboard, one for iPad and other for iPhone/iPod touch
If you are using xibs you'l need to change it programmatically using ifs and elses
I found a better method to include my iPad Xib in my project. I only have to add ~iPad at the end of the name of my xib. If I have myxib.xib I create a new xib named myxib~iPad.xib and when I run it on my ipad it takes automatically the correct file!