5
IOS 7 BLUR VIEWS WITHOUT THE HACKS Gerald Kim - iOS Developer at Cook @gerald_kim on Twitter

iOS 7 Blur Views

Embed Size (px)

Citation preview

Page 1: iOS 7 Blur Views

IOS 7 BLUR VIEWS WITHOUT THE HACKS

Gerald Kim - iOS Developer at Cook @gerald_kim on Twitter

Page 2: iOS 7 Blur Views

WHERE’S MY UIBLURVIEW?Blurred views like in UINavigationBar and Control Center

aren’t available out-of-the-box

Page 3: iOS 7 Blur Views

• Can grab layer from UIToolbar or UINavigationBar

• Or can do it with CALayer masking and Apple’s blur example (UIImage+ImageEffects)

Page 4: iOS 7 Blur Views

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;

Page 5: iOS 7 Blur Views

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