I have a very strange problems with Interface Builder in XCode 8 (final, not beta). First, the width and height of ALL my UIViewControllers in the project is changed, but the size of all controls (subviews) remain the same. I suppose this happened when I upgraded the project and Open in Latest Xcode (8.0) and Deployment Target (8.3) settings were set.
Also, today I get a lot of warnings and 1 error in the same designer which yesterday works fine, even in the forms that I did not change.
So it this a bug, and how to return forms to previous state, without manually change each one of them?
Related
Edit: Probable Bug. Seeking fix or workaround…
How can I get the system’s text styles to be available in the interface builder when using Xcode 11?
I just started using Xcode 11 this week. In the interface builder (storyboard mode), when I go to assign a dynamic type text style to a Label or Button, using the Font -> Style pop-up, all the text styles are missing from the popup menu.
I do have the Dynamic Type “Automatically Adjusts Font” checkbox checked, as well.
I’m not sure if this is a bug, an intentional change I can’t find documentation for, or something else.
The expected behaviour is described in Apple’s developer documentation “Scaling Fonts Automatically”. Specifically, in the “Configuring Text Styles Using Interface Builder” section.
Further exploration: I’ve tried it with new projects, old projects (from Xcode 10), projects targeting iOS 12.2 and 13.1. All had the same problem of no text styles in the popup menu.
I experience the same problem when upgrading from Xcode 11.0 to Xcode 11.1 or 11.2 beta 2:
Xcode 11.0:
Xcode 11.1:
I also filed a bug report (FB7415999) with Apple and also opened an issue with them.
**My curren solution at the moment is a downgrade to Xcode 11.0 for UI development and a parallel install of Xcode 11.2 beta for on device runs **
This is probably a bug in Xcode 11.1. I ran into the same thing and filed a bug with Apple (FB7368959). A colleague running Xcode 11.1 on Catalina did not have the same problem, nor did another running Xcode 11.1 on Mojave.
Here is a workaround that got me back on track: I opened the problematic project in both Xcode 10.3 and 11.2 beta. In both, the dynamic type styles were available in IB. I didn't change anything, but reverted to Xcode 11.1, and now the styles are there, too. Hopefully this works for Grant and anyone else that runs into this annoyance.
Edit Mar. 17, 2020: This problem has reoccurred for me on Xcode 11.3.1. It seemed to happen with a specific project, and the problem spread to a second machine as soon as I opened that project. My workaround didn't help when I opened the project in 11.4 beta 3.
I develop mainly IOS apps but, recently, I worked on an OSX app. Both are possible with Xcode (I use 8, with swift).
Unfortunately, when I switched back to my already-existing IOS project (after restarting Xcode), the storyboard selection menu for the object library shows only OSX objects, not IOS (e.g. UIImageView).
I have googled without success and tried restarting Xcode, also without success. Can anyone help me fix this?
I did a lot more searching and came up with:
Xcode is loading in OS X objects instead of iOS objects
There there are other solutions proposed but the one that worked for me was to close the assistant editor and then, in the file list ( leftmost window in Xcode 8), I double clicked on the storyboard file. Problem solved. I am surprised that this bug still exists in this latest version...it is very troublesome.
encountering a very frustrating issue. I have a Xib file for my custom UITableViewCell. I set the constraints up and there are no warning or issues and the app runs fine. However if I close the Xcode and reopen it they are set to different values and the entire view is broken.
There seems to be no way to fix this, even if I reset to a previous commit the view remains broken. Has anyone else encountered this? Is there a fix?
Please try Xcode 8.1 which addresses the following:
Xcode 8.0 did not always restore view frames from storyboards and xibs when layouts were ambiguous. Xcode 8.1 fixes several of these issues. If you have encountered these issues, resolve the ambiguity in the Auto Layout issues and update frames. Xcode 8.1 will persist them correctly. (28221021, 28244619)
(If not, please file a bug with http://bugreport.apple.com.)
I set the constraints of layout properly and also tested it on every device. But the next time I open the project, Xcode just ruined the constraints totally.
How did this happen?
May be the project has a problem and for some reason it is not saving the changes. I have indeed put this solution on my troubleshooting book about Xcode from Apress (shameless advertising... 😃). I have seen this before.
Backup your project and try this:
Quit Xcode
Using finder, right click on the .xcodeproj file of your project and select Show Package Contents.
delete everything from that except the file project.pbxproj.
open the project again fix the constraints and see if the changes are saved the next time you open Xcode.
You did not specify you Xcode version, but my own experiences with code, that is developed using Xcode 8 Beta 1 to Beta 6: The problem may be caused by bug in XCode.
The explanation, if you use Xcode 8 Beta, could be:
New Xcode offers new storyboard-display logic, that shows different difficulties still in Beta 6
After fixing both constraints and frames automatically / manually, warnings come back again after reopening project
This problem moves from Xcode Beta 2 to Beta 6 after my own researches
Let's give Apple a little more time to fix the issues and let's wait until Apple releases GM Seed. It's only beta though
I get this issue when building UI in storyboard (or xib) in xcode's interface builder. After I assign the image (with the same name in asset catalog) to an image view in Interface Builder, the xcode loads 3x image file instead of 2x in any non-retinahd devices which is running ios8.
Note that this bug only happens when app's deployment target is set to 6.0 or 6.1.
I'm using asset catalog to manage image resources.
This issue is tested and happens both in Xcode 6.0.1 and 6.1 GM seed 2.
I googled the issue and could rarely find the related topic. So I wonder if any one gets the same issue with me and what is the best workaround for it. Thank you.
The following is the steps to reproduce this issue in case anyone has the interest:
Install Xcode 6
Create an iOS project and set to use objective-c as project language.
Change the app's deployment target to 6.0 or 6.1.
Add 1x, 2x and 3x version of an image to the asset catalog.
In interface builder, add a UIImageView to the default view controller's view of default storyboard.
In interface builder, set the image's name as the same image name added in step 4 in asset catalog.
Select the simulator as iPhone6 (or any simulator runs on iOS 8.0 except iPhone6 Plus).
Clean the project (Product/Clean).
Run the project.
UPDATE:
As #Andrei Mankevich mentioned in the comment, this bug seems to be fixed in iOS 8.1.
And I have confirmed it using the simulator running iOS 8.1 in Xcode 6.1 GM seed 2(sorry I don't have a real device running iOS 8.1 currently).
So as #Andrei Mankevich pointed out, this bug might only exist in iOS 8.0.x.
After some research it looks like this issue is related to iOS indeed and so it isn't likely to be fixed by upcoming Xcode update. That's what documentation says about Asset Catalog:
For projects with a deployment target of at least iOS 7 or OS X 10.9, Xcode compiles your asset catalogs into a runtime binary file format that reduces the download time for your app.
So when we use deployment target 6.0 resources are just stored in different way inside IPA file. While iOS 8.0 is loading compiled resouces correctly, it has the issue with loading non-compiled resources and always loads 3x density images. And this issue was already fixed in iOS 8.1.
As for possible workaround in our app we fixed it by setting exact size of each element in xib and using UIViewContentModeScaleAspectFit value for contentMode flag . We use the same image resources with just different resolution so after scale they also look the same. But of course it should have negative impact on performance.