Post

Replies

Boosts

Views

Activity

Reply to @Observable and didSet?
So didSet is allowed but you're not able to do much with it as you cannot make any reference to self or any of it's members: Cannot find 'self' in scope; did you mean to use it in a type or extension context? Instance member 'scalingMode' cannot be used on type 'MySettings'; did you mean to use a value of this type instead?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’23
Reply to UIPointerStyle.hidden() with SwiftUI?
With UIKit, it is possible to set the pointer style or just hide it through the UIPointerInteractionDelegate: func pointerInteraction(_ interaction: UIPointerInteraction, styleFor region: UIPointerRegion) -> UIPointerStyle? { // Hide the pointer in the screen view return UIPointerStyle.hidden() } I’m unable to find anything that would do the same on SwiftUI. Apple folks: FB12418053
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’23
Reply to Swift compiler crash in Xcode 15 beta 3 (15A5195k)
Here's a project to demonstrate the issue: import SwiftUI import Observation struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") } .padding() } } typealias ResolveServiceCompletionBlock = (Bool, Error?) -> Void @Observable class ServiceBrowser: NSObject { fileprivate var resolveServiceCompletionHandler: ResolveServiceCompletionBlock? = nil } It seems like the issue is with the Observation protocol as removing @Observable works. Apple folks: FB12567650
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’23