UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Xcode Shortcut to Embed

Forums > SwiftUI

This is an Xcode+SwiftUI question: Within code, I'm looking for the shortcut keystrokes to pull up the menu to embed a SwiftUI element inside another like HStack or VStack. I thought it was Cmd+Ctl and then mouse-click on say a Text(...) item to pullup the option to embed...but can't find it. Any help?

3      

Hold down the CMD key, if you hover over item they will be highlighted. While still holding down the CMD key click on an item to reveal the menu you are asking for.

The "Embed in HStack/Vstack" does not always appear for me, so there is a bug in Xcode...

4      

Ths @loseth. That's what I thought, and it definitely used to work but not now.

FWIW: I'm on XCode ver: Version 11.6 (11E708)

Is anybody seeing that behavior work correctly and if so, what version of XCode are you on?

3      

I have a similar problem in 12 beta 3, with a twist--in some projects I always get the embed options and in other projects I don't. And in some projects, I've had it available, and then it suddenly goes away and never comes back.

4      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.