Post

Replies

Boosts

Views

Activity

ObservableObject With Closure With Typed Throws Crashes on iOS 17
Having a property inside of an ObservableObject with a type of a closure with a typed throws will crash the app on the initialization of the observable object on iOS 17. Here is an example: struct ContentView: View { @StateObject var myDataSource = MyDataSource() var body: some View { EmptyView() } } enum MyError: Error { case error } class MyDataSource: ObservableObject { let signUp: (Int) throws(MyError) -> Void = { _ in } } If you run this code on iOS 17, the app will crash. The Radar for this issue is FB16399987.
1
0
290
Jan ’25