You can also use the interface builder to create these effects easily for simple situations. Since the z-values of the views will depend on the order they are listed in the Document Outline, you can drag a UIVisualEffectView
onto the document outline before the view you want to blur. This automatically creates a nested UIView
, which is the contentView
property of the given UIVisualEffectView
. Nest things within this view that you want to appear on top of the blur.
You can also easily take advantage of the vibrancy UIVisualEffect
, which will automatically create another nested UIVisualEffectView
in the document outline with vibrancy enabled by default. You can then add a label or text view to the nested UIView
(again, the contentView
property of the UIVisualEffectView
), to achieve the same effect that the "> slide to unlock" UI element.