xcodeswiftui

How to bring up extra actions like "Embed in VStack" when interacting with code?


I am looking at this SwiftUI tutorial and it suggests I can see extra actions upon Command-Clicking the SwiftUI elements in code. In my Xcode, this jumps me to the class definition.

enter image description here

I see there's an option in XCode 11.0 t change the Option key to show SwiftUI inspector, however, this still does not let me modify SwiftUI code elements using actions like "Embed in VStack"

How can I get both inspector and extra SwiftUI actions when interacting with SwiftUI Code (not the preview)?

enter image description here

enter image description here


Solution

  • Extra SwiftUI actions show when Canvas is opened (shortcut: Option-Command-Enter or ⌥+⌘+↵):

    when canvas close canvas is closed

    when canvas is open canvas is opened