Post

Replies

Boosts

Views

Activity

Reply to Binding with optional Value causes runtime crash
There is workaround how to avoid crash var nameBinding: Binding<String>? { guard let name = viewModel.name else { return nil } return Binding { name } set: { value in viewModel.name = value } } ... if let name = nameBinding { ChildView(selectedName: name) } ... Here is some other suggestions https://stackoverflow.com/questions/76241232/binding-with-optional-value-causes-runtime-crash/76243321#76243321
May ’23