UIVisualEffects in 10mins
Slides from a talk I gave at Boulder iOS October Meetup
With iOS 8, Apple has provided a new technology which makes it very easy to create frosted, translucent overlays. These overlays are interactive and will reflect the state of activity beneath. This is an upgrade from previous technigues which involved creating static images and applying blur effects.
Instantiate an instance of
UIVisualEffectView and hand it an effect.
Presently, the only effects available are instances of either
UIBlurEffects can be configured for dark, light, or extra light. Apply a
UIVisualEffectView to make it fit properly in a
UIVibrancyEffect is best used with text, or other controls that need to remain readable, as frosted overlays can obscure important details in the foreground.
To apply vibrancy, create another
UIVisualEffectView with an instance of
UIVibrancyEffect. note Vibrancy needs to know about the current
UIBlurEffect settings. Add the second
UIVisualEffectView configured for
vibrancy as a subview of the first. Just like
UIVisualEffectView has a
contentView property for subviews.
A working example complete with animations, blur and vibrancy effects is available here : UISpookyEffects on Github