I want this function be in protocol:
func slideToRight(currentViewController viewController: UIViewController, completion: ((Bool)->())? = nil) {
// do some stuff
}
But when I write such protocol:
protocol SomeDelegate {
func slideToRight(currentViewController viewController: UIViewController, completion: ((Bool)->())? = nil)
}
I got an error:
Default argument not permitted in a protocol method
I know, I can define the signature in this way:
protocol SomeDelegate {
func slideToRight(currentViewController viewController: UIViewController, completion: ((Bool)->())?)
}
But then, I won't be able to call the function missing "completion" word:
slideToRight(currentViewController viewController: vc)