I recently upgraded to Xcode 8 and I am having issues with the Storyboard.
If I open the project and I don\'t have the Storyboard open, it will compile and run just
After you make the necessary changes, change the storyboard or in my case a .xib to open in "XCode 7", save and close. This is just a stop gap measure to address the errors but ultimately you will need to fix them or do this until you are no longer able to.
I solved the problem by doing the following:
File > Workspace settings
.DerivedData
folder.DerivedData
folder, and delete the folder corresponding to your project.Editor > Refresh all views
.Updated
Sometimes just directly Go to Editor > Refresh all views
worked. If Refresh all views
is disabled, quit Xcode and try again.
When i debugged this i found out there are some classes which are modifying UI. Typically marquelabel which is a subclass of UILabel or any other class subclassing UIView and drawing ui at run time and colliding with Autolayout engine. Try giving fixed width or height for these custom views. If it doesn't solve your problem try Following solutions:-
Solution 1: - Uncomment #use_frameworks inside your pod file.
Solution 2: - Try deleting derived data
If you're using xib file for custom uiview. Try this:
Change from
Bundle.main.loadNibNamed("UserView", owner: self, options: nil)
To:
let bundle = Bundle(for: UserView.self)
bundle.loadNibNamed("UserView", owner: self, options: nil)
In my case, I was using a library which was subclassing UIView
. It was using IB_DESIGNABLE
, and was missing call to [super awakeFromNib]
. Once I've added the call to this method, the bug went away.
I'm not sure if the fact that it was implementing IB_DESIGNABLE
had an impact in this.
I faced this issue in CocoaPod 1.5.0. The solution is to reinstall pod again (pod install again) once this error showing or you may use CocoaPod 1.4.0 instead. It works fine in 1.4.0 (at least for me.)
update:
Add following script in Podfile help me solve the issue in 1.5.0
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings.delete('CODE_SIGNING_ALLOWED')
config.build_settings.delete('CODE_SIGNING_REQUIRED')
end
end
reference: https://github.com/Skyscanner/SkyFloatingLabelTextField/issues/201#issuecomment-381915911