问题
My code was working fine (showing UI properly) when I had Xcode 9 and I removed it from the application folder (could not update as it had installed using another apple id) and reinstall the Xcode 10 from the Appstore.
Now Xcode storyboard not showing any added UI elements colors or anything and I removed Xcode 10 and installed Xcode 9 again but problem remains same.
UI screen shot of storyboard.
I tried removing Xcode in this way:
/Applications/Xcode.app
/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/Caches/com.apple.dt.Xcode
~/Library/Application Support/Xcode
~/Library/Developer/Xcode
~/Library/Developer/CoreSimulator
Then I tried installing macOs Mojave and install XCode 10 again from the Appstore. Issue still remains. I tried cleaning derived data, xuserdata and everything.
回答1:
Try cleaning your project using "Command + K" and run your project again! Hope it works!
回答2:
I encountered the same issue that you are facing in my case i had xCode 10.0
installed and everything was working fine. As soon as I installed version 10.1
I faced the same issue that you're facing but the good thing was i had xCode 10.0
installed at the same time so I switched back and everything was working fine.
From my point of view my system(Mac-mini mid 2011)
was lacking hardware specification that was required for xCode 10.1
also had very low graphic processor in my mac mini. If you install the same version in a MacBook or any other system having higher specification you'll face the issue. I hope that helps.
回答3:
I was stuck on this all day. One of my coworkers suggested removing occurrences of IB_DESIGNABLE & @IBDesignable. This fixed the issue for me. It still lags sometimes but doesn’t go invisible anymore.
回答4:
Reinstall Xcode. That worked for me.
回答5:
If you have multiple xib files then just try to switch between or Try moving to launchScreen storyboard and then switch to main storyboard. I think this is just loading issue.
回答6:
Click on library button(Circular Button) which is left to hamburger sign(Top Bar Right Side). Elements will be popup on your screen then you can choose elements.
回答7:
try
xcrun simctl erase all
it helped me with the same problem
来源:https://stackoverflow.com/questions/52637441/xcode-10-storyboard-ui-components-are-not-visible-and-painfully-slow