What is the difference between UIApplication.sharedApplication.delegate.window and UIApplication.sharedApplication.keyWindow?

For most uses, they will be the sameā€¦ but not always. [UIApplication sharedApplication].keyWindow is the window which is currently being displayed on the device. This is normally your application’s window, but could be a system window. [UIApplication sharedApplication].delegate.window is the window your application is expected to use. Which one should be used? Well that all … Read more

subclassing UIWindow while using storyboards

UIWindow in a Storyboard project can be subclassed as explained in Apple’s UIApplicationDelegate reference: window When a storyboard is being used, the application must present the storyboard by adding it to a window and putting that window on-screen. The application queries this property for the window. The retained reference to the window by this property … Read more

iPhone – Get Position of UIView within entire UIWindow

That’s an easy one: [aView convertPoint:localPosition toView:nil]; … converts a point in local coordinate space to window coordinates. You can use this method to calculate a view’s origin in window space like this: [aView.superview convertPoint:aView.frame.origin toView:nil]; 2014 Edit: Looking at the popularity of Matt__C’s comment it seems reasonable to point out that the coordinates… don’t … Read more