Post

Replies

Boosts

Views

Activity

Canvas crashes with Task code
Good day! It seems to be a bug in Xcode that preview can be showed correctly with async code wrapped in Task, for ex: struct MyView: View { var onTapped: (() async -> Bool)? var body: some View { Button {             Task {                 guard await onTapped?() ?? true else { return }             } .....         } label: { Text("Tap me")         } } }      Crash log
2
0
1.2k
Apr ’22
Canvas crashes with Task code
Good day! It seems to be a bug in Xcode that preview can be showed correctly with async code wrapped in Task, for ex: struct MyView: View { var onTapped: (() async -> Bool)? var body: some View { Button {             Task {                 guard await onTapped?() ?? true else { return }             } .....         } label: { Text("Tap me")         } } }      Crash log
Replies
2
Boosts
0
Views
1.2k
Activity
Apr ’22