iOS - Localizing StoryBoard file - ios

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.

Related

XIB files still used in XCode and For IOS Development

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.

Convert only iPhone App to Universal App in Xcode 7.2

I followed a tutorial at Udacity to create an iPhone app and I am not only able to run it on an iPhone as I can in an iPad, that's fine. Nevertheless, the screen looks weird on an iPad. In my storyboard, if it is selected "compact,any" and if I changed it to "any, any" it should work, I think, but the elements in the "company, any" format do not come automatically.
I looked it up on google and found http://pinkstone.co.uk/how-to-convert-your-iphone-storyboard-into-an-ipad-storyboard/ - but this is for Xcode 6. I followed the steps:
change from iPhone to Universal in the project settings
duplicate storyboard file using Finder
Add new storyboard file to project
He says to use a button called "Apply Retina 3.5-inch Form Factor" whose icon looks like a person, but it is does not appear in Xcode 7.2. I think that was changed to the "any,any" options that appear on the bottom.
Change part of xml code of storyboard from targetRuntime="iOS.CocoaTouch" to targetRuntime="iOS.CocoaTouch.iPad"
The steps below just made "compact,any" to "any,any" in the new file but with no buttons, views or labels of the "compact,any". Is there a way to do that? I tried copying and pasting also... but it didn't work quite well somehow... maybe I did it wrong.
I am also wondering if I do need to create a new storyboard file. It seems like the "compact,any" is somehow independent of "any,any" and the same file would work for iPhone and iPad.
I am using only Swift for the development language, although I don't think this is relevant for the layout.
That's what I have thought regarding the question.
Answer to your question: You have to create them for each size class, individually.
Explanation: Your constraints and items in your storyboard are created for a custom size class. You cannot just "copy" your constraints from one size class (compact, any) to another (any, any).
Your question title isn't accurate- you're not asking how to "convert" an app from iPhone to Universal (which means it can be used on iPhone and iPad). You've done that already- in your project settings, so it is now "converted" to be a universal app (even though it's useless to you on an iPad, it is still "supported")- and you've answered your own question.
What you're asking (I think) is how to copy your elements and constraints to another size class, which you can't just "copy". What your question should be is this:
"Convert storyboard views from (compact,any) size class to (any,any) size class" to which there is no easy way- it must be done manually.
Your question is a potential duplicate of many others I found. Here is a related question that has an answer that might help you.

storyboard and apple recommendations

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.

Tab disappears when changing language in iOS

One of the tabs in my UITabBar disappears when I change the language of my iOS Simulator to Norwegian. Why is this? I have created the app with Version 4.6.3 of XCode.
There could be a lot of reasons for this. You need to provide more information. How do you define your UITabBar? Are you using Storyboards or Nibs? Your Norwegian localized Storyboard / Nib might have only 1 tab defined while your English version might have three tabs.
I have found the problem.
When I tried to get my app translated I added my own languange in the Localizations section under Project-Info.
When I did this there was an extra .storyboard file created for the spesific language, so when I change the storyboard I had in xCode that did not change the second storyboard created for my language. I found my second storyboard in the directory of my app, and deleted it, and now everything works fine.
So, if your app is weird with one spesific language, it may have a spesific storyboard that does not change automatic.

Add ipad interface to iphone app

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!

Resources