Post

Replies

Boosts

Views

Activity

Reply to .backgroundTask in SwiftUI cannot compile
Hello, i had the exact same issue on my machine with Xcode 14 beta 3 and beta 4. What worked for me was to change the order of the modifier This does not compile: WindowGroup { Text("Hello world") } .onChange(of: phase) { newPhase in // some changes } .backgroundTask(.appRefresh("appRefresh")) { // async work } This does compile: WindowGroup { Text("Hello world") } .backgroundTask(.appRefresh("appRefresh")) { // async work } .onChange(of: phase) { newPhase in // some changes } I hope this will help.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22