SwiftUI Preview won't show - xcode

I've had this issue happened to me twice now. I'm working in a project and the previews for my SwiftUI views won't show. The entire preview pane is just not there. The only way I've been able to fix it is recreating the project again.
This happened to me in both Xcode 13 (Intel based Mac) and 14 (M1 Mac). Is this a known issue or is there a setting I'm missing to enable and disable previews in a SwiftUI project?

On a Mac computer, using the "Option-Command-Enter" key combination worked well. However, the "Canvas" button did not work and caused a preview crash. (iOS 16, xcode 14, M1 air)

Related

Can't find NavigationStack in autocomplete and can't run playground apps on MacOS

I'm trying to work on editing grids sample app in playgrounds. It works fine on my iPad but it is not working on my Mac. I can see the code but I get an error message that minimum deployment target is 16 and there is no preview showing. MacOS is up to 13 no? So I guess it is refering to iPad OS 16? How do I fix this on my Mac?
Also the code references NavigationStack which now replaced NavigationView but in Xcode it doesn't show up in autocomplete and the compiler doesn't recognize it.
When I go into apple store both xcode and playground just say "open", there is no update option.
What do I do?

My iOS simulator is rendering with glitches

I have a 2019 16-inch Macbook Pro with an i7. My iOS simulator is showing terrible behavior on Xcode 12 and 13. The rendering happens only partially. I start typing but only top part of the TextField updates. When I pull my modally presented controllers up and down, it leaves glitches and artifacts in the render whenever I release the mouse pointer from the window. Only when I drag and click something in the simulator, only then the screen updates properly.
I have tried resetting the simulator and the machine, and different versions of Xcode AND or simulator iOS and nothing helps. I also have not found too specific mentions of this issue online.
This is a known issue that was fixed in Xcode 13. It primarily affects the iPhone mini so you can workaround it by using a different simulator.

Cannot paste text on mac into ios simulator Xcode 12?

I am using Xcode 12.5, and I am trying to paste some text from a file into my ios Simulator (iPhone 11 ios 14.5). This does not work. Any thoughts or ideas on how to fix this?
I have looked at a number of other posts but they all seem outdated and don't work for me.
Also I am using an Apple M1 Mac mini ...if that makes a difference. I am also building my application with Xamarin.
The steps I took:
I turn of Automatically Sync Pasteboard
Copy the text (which is just letters from a .txt file)
Click send pasteboard from the edit menu.
Click on my Editor control and select paste
The outcome is that it shows the bubble at the top saying myappName pasted from CoreSimulatorBridge. However, it doesn't actually paste the text.
I answered this elsewhere, but it took so long to find I am repasting a couple places I looked first. Essentially, with Apple M1 Silicon, iOS 14+ pasting doesn't work. Switching to a simulator running 13.7 or earlier fixed it.
it seems it was an issue that Apple fixed in the latest XCode updates, copy/paste works with me on a simulator with IOS 16.2 and XCode 14.2
Now with XCode 14 I'm not being able to build 13.7 or earlier.

Xcode storyboard showing osX object library. I want IOS object library

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.

NSToolbar items hidden using xibs migrated on Xcode 7

We are using xib files to show a window + toolbar.
Compiling a Mac OS app with the latest Xcode (7 or 7.1) makes our toolbars items to be hidden for Yosemite 10.10.5, but it works fine on El Capitan.
If I click the area, the actions are taken, so only the labels and images are hidden.
I have recreated the xib file from scratch with Xcode 7.1 but the issue is still there.
FYI: going back in our code history, before Xcode 7 was launched, and compiling the app without migrating xibs to Xcode 7 the issue is not reproducible.
It seems that the issue was generated by a missing font which seems that broke the whole CoreText and that's generated the missing toolbar items. Really strange issue.

Resources