NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills today! >>

SOLVED: Xcode: Inspecting view layout not visible

Forums > SwiftUI

Hey all,

this might be a stupid question ... watching Paul's videos, I've noticed whenever he selects a View in the source code, it will draw a rectangle around the view in the canvas / preview.

For me, this isn't the case. I might have turned it off at some point, but I can't find where to turn it back on again. Could anyone drop me a hint please?

Thanks in advance!

   

@Loradim is adrift in an ocean of options:

[...snip...] but I can't find where to turn Canvas selectable mode on.....

There are three buttons in the lower left leading corner of the canvas.

One is the traditional Play button which allows the canvas to be Live.
Live means sliders slide, toggles tog, and buttons butt.

The second looks like a wee mouse arrow. This is Play button's sister, Selectable. The third button, Variants, isn't part of this tutorial.

If you're keen to code like @twoStraws and have the graphical view selected when you click view code you'll need to first change options. Cool trick: if you select the object in the canvas, it will highlight the code in the editor. Sweet Irn Bru, that's nice.

Keep Coding!

Speaking of oceans, in the English phrase Pacific Ocean, all three Cs are pronouced differently. You just tried it, didn't you?

1      

@Obelix

I feel a bit dumb now, thank you again for helping me out.

Speaking of oceans, in the English phrase Pacific Ocean, all three Cs are pronouced differently. You just tried it, didn't you?

Yes, I did.

   

Hacking with Swift is sponsored by Judo

SPONSORED Let’s face it, SwiftUI previews are limited, slow, and painful. Judo takes a different approach to building visually—think Interface Builder for SwiftUI. Build your interface in a completely visual canvas, then drag and drop into your Xcode project and wire up button clicks to custom code. Download the Mac App and start your free trial today!

Try now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.