ObservableObject With Typed Throws Closure Crashes on iOS 17
Originator: | nathan.molby | ||
Number: | rdar://FB16399987 | Date Originated: | 01/24/2025 |
Status: | Open | Resolved: | |
Product: | SwiftUI | Product Version: | |
Classification: | Reproducible: | Yes |
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.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at feedbackassistant.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!