Search results for

Swift 6

49,194 results found

Post

Replies

Boosts

Views

Activity

Swift 5.10: Cannot access property '*' with a non-sendable type '*' from non-isolated deinit; this is an error in Swift 6
The following Swift UIKit code produces the warning Cannot access property 'authController' with a non-sendable type 'AuthController' from non-isolated deinit; this is an error in Swift 6: import UIKit class AuthFormNavC: UINavigationController { let authController: AuthController init(authController: AuthController) { self.authController = authController super.init(rootViewController: ConsentVC()) } required init?(coder aDecoder: NSCoder) { fatalError(init(coder:) has not been implemented) } deinit { authController.signInAnonymouslyIfNecessary() } } Swift 5.10, Xcode 15.3 with complete strict concurrency checking. What is the workaround? Please don't ask me why I'm doing what I'm doing or anything unrelated to the question. If you're wondering why I want to call authController.signInAnonymouslyIfNecessary() when the navigation controller is denitialized, my goal is to call it when the navigation controller is dismissed (or popped), and I think that the deinitializer of a view contr
1
0
1.1k
Apr ’24
Reply to Swift 6 concurrency. Apple Watch App target and -disable-dynamic-actor-isolation.
It’s better to reply as a reply, rather than in the comments; see Quinn’s Top Ten DevForums Tips for this and other titbits. I wonder when/if staying on swift 5 will become penalized Keep in mind Xcode 16 uses the Swift 6 compiler in all cases. What we’re talking about here is the language mode. When you enable the Swift 6 language mode, the Swift compilers turns concurrency warnings into errors, inserts traps to catch concurrency problems at runtime, and so on. Language modes tend to be long-lived. For example, the Swift 6 compiler supports the following language modes: 6, 5, 4.2, and 4. So, while I can’t predict the future, I expect that the Swift 5 language mode will be with us for a while. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’25
Reply to GameplayKit usage with Swift 6: Call to main actor-isolated instance method 'run' in a synchronous nonisolated context
Hello @sanderfrenken, Thank you for raising this issue! Unfortunately, I don't have a good solution for you. Anything that you could do to get this integration working in Swift 6 would rely on very fragile assumptions that I won't recommend you make. It is better for you to file an enhancement request using Feedback Assistant, to request changes to SpriteKit and GameplayKit that would better facilitate their integration in a Swift 6 app. For now, I recommend that you stick with the Swift 5 language mode while you wait for resolution on your bug report. Best regards, Greg
Topic: Graphics & Games SubTopic: GameKit Tags:
Oct ’24