07-18-2023, 10:08 PM
None of these answers worked for me but I found my issue. It had to do with [Error Handling](
func getSlider() throws -> UISlider {
... // code that could throw an error
return UISlider()
}
Referencing it like this:
func anotherMethod() -> Float {
return try! getSlider().value
}
gave the error. But, when switching to this, it went away:
func anotherMethod() -> Float {
return (try! getSlider()).value
}
[To see links please register here]
) (in the Disabling Error Propagation section). I had this method:func getSlider() throws -> UISlider {
... // code that could throw an error
return UISlider()
}
Referencing it like this:
func anotherMethod() -> Float {
return try! getSlider().value
}
gave the error. But, when switching to this, it went away:
func anotherMethod() -> Float {
return (try! getSlider()).value
}