The methods are slightly different. [UIScreen mainScreen] returns a UIScreen device object, the boundaries of this will always be the screen size of the devices. [UIApplication sharedApplication].keyWindow returns the current UIWindow key for the application, which may not be the full screen size of the devices.
Another obvious case where they may differ is that the device is connected to multiple screens. In this case, [UIScreen mainScreen].bounds will always return the screen size of the device, but the key window may be on one of the other screens, and it will have a completely different size, depending on which screen it is attached to.
source share