1

This is my code:

if let myWindow: UIWindow = UIApplication.sharedApplication().keyWindow {
    window = myWindow
} else {
    window = myWindow2[0] as? UIWindow
}

It is throwing this exception at the first line (where it says if let):

Bound value in a conditional binding must be of Optional type

It was working in Beta 6 but I upgraded to beta 7 and now bam. does not work.

What must I do to clear the error?

1 Answers1

2

As of Beta 7, keyWindow returns a UIWindow instead of a UIWindow! (it's no longer an optional) so you no longer need the if let.

davecom
  • 1,499
  • 10
  • 30