What is the best way to construct NSError
object by myself in Swift? Is it ok to do it at all? I need to pass it to the some delegate function then.
Thanks in advance.
You can user the constructor of NSError:
let ERROR_CODE = 101
let error = NSError(domain: "my.domain.error", code: ERROR_CODE, userInfo: nil)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With