Xcode 9 - Localization Issue Warning Storyboard
The source of the unwanted warnings is that Xcode defaults to having storyboards "prepared" for localization. They are "prepared" by setting them up using base internationalization.
To completely disable this warning in a particular storyboard, you need to let Xcode know that the storyboard should not be considered localizable. The easiest way I was able to do this was to simply move the storyboard file from the Base.lproj
folder up one level and re-add the file to the project. Once I did that, the warnings went away.
Steps
This process should work with old and new projects. Tested on Xcode 9.1 using a project created with Xcode 9.1
- Move the storyboard from the
Base.lproj
folder up one level via Finder - Delete the storyboard reference from your project via Xcode
- Drag and drop (or otherwise re-add) the storyboard to your project
- Verify using the File Inspector that the storyboard no longer has base localization
Pictorial Walkthrough
Xcode defaults to having storyboards "prepared" for localization
Move your storyboard files out of the Base.lproj folder to prevent the warnings
Delete the file reference
Re-add the storyboard
You'll see the "Localize..." button when you've succeeded
If you want to localize in the future
Just tap the "Localize..." button and follow the prompts from Xcode. Additionally, you'll actually need to address the warnings that Xcode is telling you about. There are various ways to address them, I recommend this question to get started.
For a video demonstration of the process, watch this screen recording
Xcode 9 - Fixed Width Constraints May Cause Clipping and Other Localization Warnings
I was getting the same warnings even without multiple languages in my app, which led me to find out what was really going on. . .
There are a few different things going on here. I was able to silence the fixed-width warnings in my own app by changing the width of the object spacings from fixed width to greater than or equal or less than or equal.
This can be done by selecting the object in interface builder, going to the size inspector and changing it there:
Or, select the constraint from the document outline, go to size inspector, and change it there:
As far as the warning at the top of your screenshot:
Fixed leading and trailing constraints with a center constraint may
cause clipping
Here is a screenshot from my own app in which I was getting the exact same warning:
I had the label with the @ sign set to leading and trailing to the buttons but also to align the center with the rating label. Once I removed the center alignment constraint, the warning disappeared, but I was left with an improperly laid out set of objects.
It is then that I resigned myself to embrace the Stack View. As annoying as it is to use, when you get all of the constraints and settings right, it lays out beautifully and with no warnings.
Edit
As Repose writes in the comments, sometimes simply adding >= 0 will be what you need, as you are making sure two elements do not overlap.
How to resolve the Storyboard's warnings on Xcode?
- Give Trailing to Hello, Label with World! label like below image give Constant 8 (What minimum gap you need) to Trailing constraint and change Relation to Grater than or Equal.
Related Topics
Repeating Local Notifications for Specific Days of Week (Swift 3 iOS 10)
How to Cache Resources Loaded in an iPhone Uiwebview
What's Always_Embed_Swift_Standard_Libraries with Cocoapods, Swift 3 and Xcode 8
Ios5 Nsurlconnection Methods Deprecated
Find Facebook Sdk Version on iOS
Black Screen After Presenting Modal View Controller in Current Context from Uitabbarcontroller
Why Does Uicollectionview Log an Error When the Cells Are Fullscreen
Change Uidatepicker Font Color
Swiftui - Navigationlink Cell in a Form Stays Highlighted After Detail Pop
Wanted: How to Reliably, Consistently Select an Mkmapview Annotation
Xcode Tabbed Application - Adding New Tab View
Passing Data from App Delegate to View Controller
Facebooksdk and Bolts Conflicting Each Other (Duplicate Symbols) on Build
Using Core Data with Watchos 2.0
Getting Url of Uiimage Selected from Uiimagepickercontroller