Posts

Post marked as solved
6 Replies
6.3k Views
In section 2 of "Working with UI Controls" the instructions state to add `@Environment(\.editMode) var mode` to the `ProfileHost` view and use that binding to show either the profile summary or the profile editor:if self.mode?.value == .inactive { ProfileSummary(profile: profile) } else { Text("Profile Editor") }When previewing the canvas in live mode it seems the `mode` variable is always nil and thus it never shows the profile editor. Tapping the edit button seems to have no effect.
Posted
by ruckstar.
Last updated
.
Post not yet marked as solved
2 Replies
3.0k Views
Is there a way to measure the computed size of a view after SwiftUI runs its view rendering phase? For example, given the following view:struct MyView : View { var body: some View { Text("Hello World!") .font(.title) .foregroundColor(.white) .padding() .background(Color.red) } }With the view selected, the computed size is displayed In the preview canvas in the bottom left corner. Does anyone know of a way to get access to that size in code?
Posted
by ruckstar.
Last updated
.
Post marked as solved
2 Replies
752 Views
The Xcode 11 beta release notes mention:"Xcode 11 beta doesn’t support working with SwiftUI in a project configured to use UIKit for Mac."Source: https://developer.apple.com/documentation/xcode_release_notes/xcode_11_beta_release_notesDoes anyone know if this is a temporary limitation that will be resolved before Xcode 11 is released? Or is this a fundamental limitation of SwiftUI?
Posted
by ruckstar.
Last updated
.