Method throwing an exception in Swift
//only the method with the keyword "throws"
//can throw an error
func methodWithException() throws {
throw Exception.text
}
- Log in to post comments
//only the method with the keyword "throws"
//can throw an error
func methodWithException() throws {
throw Exception.text
}