Post

Replies

Boosts

Views

Activity

Reply to How to add swift availability check to Environment values?
I thought I found a workable solution but it's no good. It only works in the fallback case and it breaks the feature for watchOS8: struct IsLuminanceReduced: EnvironmentKey {     static var defaultValue: Bool = false } @available(watchOS, obsoleted: 8.0) extension EnvironmentValues {     var isLuminanceReduced: Bool {         get { self[IsLuminanceReduced.self] }         set { self[IsLuminanceReduced.self] = newValue }     } } If I could figure out how to tell Swift "with watchOS8, * IGNORE this…" Maybe you can pick up this fumble and carry it across the line?
Sep ’21
Reply to ObservableObject Array data not updating
This line @StateObject var graph = graphData() initializes a new graph instance in either of your views. They don't communicate with each other. Better use @ObservedObject var graph = GraphData.shared in the views and class GraphData: ObservableObject { static let shared = GraphData() ... } in your model class.
Aug ’21
Reply to SwiftUI Runtime Error from if condition { Text() } in watchOS
Apparently this has been fixed by iOS 15 Beta 4: on my test device I had the error prior to the Beta 4 update, using a test app compiled with Xcode 13 Beta 3. After the update to iOS 15 Beta 4 the error is gone. (Xcode Beta 4 is still downloading currently.) So I think it’s reasonable to say that the update to iOS 15 Beta 4 did fix the error. Apple Feedback ID FB9063694 If any1 would like to confirm…?
Jul ’21