Q:

Lock screen compatible with modals

My iOS 8 app has a custom lock screen (a UIView on top of other UIViews within the same UIViewController). When the app goes in the background, the lock screen is displayed, hiding all other content.
The issue is that my lock screen do not appear on top of modals. When the user unlocks the app, I want the app state is be identical to when he left, so I want to keep the modals alive during lock.
How can I make my lock screen UIView appear on top of modals?

A:

Make your lock screen a window and position it in front of all modal system windows, see the View Programming Guidelines for details.
tl,dr:
lockWindow.windowlevel = UIWindowLevelStatusBar + 0.05f:

