Created
February 23, 2016 01:22
-
-
Save anonymous/f4a5357a34fb2651e4ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// JJWParallaxHeaderViewWithVisualEffect.m | |
// ParallaxScrollViewHeaderWithBlur | |
// | |
// Created by Joel West on 2/22/16. | |
// Copyright © 2016 WestSutdios. All rights reserved. | |
// | |
#import "JJWParallaxHeaderViewWithVisualEffect.h" | |
@implementation JJWParallaxHeaderViewWithVisualEffect | |
+ (instancetype)instantiateFromNibWithImage:(UIImage *)image withBlurEffectStyle:(UIBlurEffectStyle)blurEffectStyle { | |
NSArray *views = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil]; | |
JJWParallaxHeaderViewWithVisualEffect *headerView = views[0]; | |
headerView.imageView.image = image; | |
if (blurEffectStyle) { | |
[headerView addBlurEffectWithStyle:blurEffectStyle]; | |
} | |
return headerView; | |
} | |
- (void)addBlurEffectWithStyle:(UIBlurEffectStyle)style { | |
UIVisualEffect *blurEffect = [UIBlurEffect effectWithStyle:style]; | |
self.visualEffectView.effect = blurEffect; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment