Upload
gerald-kim
View
1.077
Download
2
Embed Size (px)
Citation preview
IOS 7 BLUR VIEWS WITHOUT THE HACKS
Gerald Kim - iOS Developer at Cook @gerald_kim on Twitter
WHERE’S MY UIBLURVIEW?Blurred views like in UINavigationBar and Control Center
aren’t available out-of-the-box
• Can grab layer from UIToolbar or UINavigationBar
• Or can do it with CALayer masking and Apple’s blur example (UIImage+ImageEffects)
USING LAYER MASKED BLURS• Clever use of screenshots:
!
• Can combine masks for more complicated mask shapes:
!
• Use images to create masks
- (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates
- (void)addSublayer :(CALayer *)aLayer
(CALayer *)maskLayer.contents = (UIImage *)maskImage.CGImage;
OTHER IMPLEMENTATIONS
• FXBlurView: Scheduled snapshot blurring - https://github.com/nicklockwood/FXBlurView
• GPUImage: Realtime Gaussian blur - https://github.com/BradLarson/GPUImage
• WWDC 2013 Session 226: Implementing Engaging UI
• Code Sample at: https://github.com/geraldk/Fun-with-Masks