Xcode Playgrounds Showing "Empty Image" - ios

I downloaded Xcode 9.2 today and, admittedly I haven't attempted to do so in a while, I tried to render a view in the playground and kept getting a "empty image" in the sidebar.
Anyone know what's up?

I had the same issue, click the assistant editor to view the UI.
In the picture below, it's the icon highlighted in blue.

#Sam P gave the correct hint, however I don't see such button in Xcode 11.2.1 Playgrounds interface.
Enable Live View in the menu on the top right:
And the preview pops up:
I find it strange that they didn't make it any obvious :/

Related

Xcode 12 SwiftUI cannot find Automatic Preview

I am working on an app in SwiftUI in Xcode 12.2.
I have accidentally deleted the Automatic Preview Tab. I cannot seem to find the option to bring it back. Here is a screenshot of my Xcode:
Where do I enable the Automatic preview and bring it back so I can see real-time updates of my UI?
An easy way to find it is from the menu "Editor > Canvas"
In your Xcode snapshot, there is a button the top right corner with a bunch of horizontal lines. Click it and then click Canvas and the preview should come back. FYI, the preview canvas is different than a Storyboard, which is what you included in the "What I want" image.

Xcode 11 (11A420a) not displaying "Embed in H/VStack" menu items when using Command-Click on declaration

I've been playing around with SwiftUI and I'm noticing all these tutorials mentioning to Command-Click Text for example and expecting the following menu items to appear in order to Embed in HStack for example:
The problem is I'm not seeing any of these "Embed in H/VStack" menu items appear. Even if I search for "Embed" it doesn't return anything.
This is what I'm seeing:
I'm on:
Mojave 10.14.6 (18G95).
Xcode Version 11.0 (11A420a).
Being on Catalina (10.15.4 (19E287)) and Xcode (11.4 (11E146)), I've had the same problem.
I've noticed that the requested embed menu appears only when the Canvas is enabled (Editor > Canvas).
You must have the canvas open for the "Embed in H/VStack" menu items to appear.
Press Command + Option + Enter to open the canvas and then select the code you want to embed and then Hold Command + Left Click to try again.
Confirmed on Catalina (10.15.5) and Xcode (11.6)
I have discovered this happen because the Canva it is close, just return it by "Command + Option + Enter" and try again.
This works for me and I hope works for you!
SwiftUI previews and inspectors are only available when running on macOS Catalina 10.15.
https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes?language=objc
I've never seen them as shown but they do exist for me in Xcode 11.4.1 under Show Code Actions rather than Refactor.
The shortcut to get there is [Command][Shift][Left Click] on a SwiftUI element.
This is actually a defect in Xcode I believe. It happens in the 12 betas as well. For me it seems to come and go. The same project will work and then 5 minutes later refuse to shot it in the same project/file. I reported it to Apple but so far no response.

Solid blue rectangle on XCode Tab Bar View Controllers that won't go away?

I recently looked at my app's main.storyboard and realized that there is a big, blue, rectangular box covering half of some of my viewcontrollers (image is pasted here). Only the UIViewControllers connected to the UITabBarController are affected. I did not even realize that this had happened, despite having moved to xCode7 a while ago. It is a bit annoying since dropping any UI element into the view controller causes that element to 'go behind' this blue region and so I can't see them. It is not that the default color is set to blue or anything; it is not a clickable object to even set display parameters to. Anybody have any ideas how to fix this... or even what it is?
Edit: This is not a problem singular to this particular XCode project. Any new project I create and insert a TabBarViewController has this issue.
Edit 2: Problem disappeared then came back. Posted the problem (which persists on for even a brand new xcode project with tab bar view controller). It is at https://github.com/AlekPiasecki/XcodeProblems
Edit 3: To anybody that has the same issue: This is almost certainly due to hardware. I have the latest version of XCode (the XCode 8 beta) and OS Sierra installed on my computer. The github post continues to have the same issue for me, but it appears fine on computers which do not have these betas installed. As far as fixing the problem now that I am stuck with these Xcode and OS versions... I still have no idea.
Adding an image to the TabBarViewController fixes this issue. The blue box goes into whatever size the image is, so making the image really small (like, say, a pixel) shrinks the blue box so that is invisible (essentially). This works in practice as a solution, but don't know how to truly permanently get rid of it.
This is a Xcode error that will be fixed in 8.2 release.
This is the Apple official note about this problem.
Look in the link for Interface Builder > Resolved Issues > UITabBarController
https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html

Xcode 7.3 Visual Debugger - Outline Around Views Missing?

In Xcode 7.3 the visual debugger no longer shows the light grey outline around each view, making it hard to see the different views. This is what I see (it is missing the grey outline):
This is what it used to show in Xcode 7.2 (it has the grey outline arounds views):
Any ideas why, something I need to turn back on, a bug maybe? I have tried toggling the options along the bottom of the visual debugger.
I am showing Wireframes and Contents and toggling constraints seem to be broken too!
Anyone else seeing this?
I looked at another Xcode and the lines were there, so assuming this is a bug, I reinstalled Xcode and it fixed itself.
Editor > Canvas > Show Bounds Rectangles

iOS Bug: Storyboard ID appearing as iOS back button text

I have a lot of navigation bar back buttons in my project with a single space as its text (" "), in order to prevent iOS from showing "Back". However, sometimes XCode will replace the back button text with a Storyboard ID plus ".text" for no apparent reason.
Navigation Bar Back Button Image
Storyboard file
I have noticed that this problem often disappears when I rebuild the app, but this time it appeared after I archived my project, thus causing me some trouble...
Is this a bug with XCode's Interface Builder? Is there a way to fix that? I also have a localized version of the Storyboard, is that what is causing this problem?
XCode 7.2 (7C68)
iOS 9.2.1
EDIT
I have just changed the language of my iPhone and this bug disappeared, it is definitely related to the way XCode handles the localized version of the Storyboard.

Resources