When accessing UIapplication\'s main window it is returned as a UIWindow??
UIapplication\'s
UIWindow??
let view = UIApplication.sharedApplication().delegate?.w
With advent of Swift2 for me a usual workaround in this kind of cases is
if let _window = UIApplication.sharedApplication().delegate?.window, window = _window { // Some code... i.e. let frame = window.frame }