There are two UIAlertView
variables but only one is optional. Let's say
lazy var a: UIAlertView = {
return UIAlertView() // Which is not important here
}()
var b: UIAlertView?
and the delegate method
func alertView(alertView: SPAlertView!, clickedButtonAtIndex buttonIndex: Int) {
switch (alertView, buttonIndex) {
case (a, 0): // Do something
case (a, 1): // Do something
case (b, 1): // <== Want to do something here but, b is optional.
default: break
}
}
How to unwrap b
while pattern matching?
NB: The questions is about the Swift language
not about the UIAlertView
.
Any help?