├── Classes ├── RNBlurredSideViewController.h └── RNBlurredSideViewController.m ├── Example ├── RNBlurredSideViewControllerExample.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── RNBlurredSideViewControllerExample.xccheckout │ │ └── xcuserdata │ │ │ └── Wenbo.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── Wenbo.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── RNBlurredSideViewControllerExample.xcscheme │ │ └── xcschememanagement.plist ├── RNBlurredSideViewControllerExample │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── RNBlurredSideViewController.h │ ├── RNBlurredSideViewController.m │ ├── RNBlurredSideViewControllerExample-Info.plist │ ├── RNBlurredSideViewControllerExample-Prefix.pch │ ├── ViewController.h │ ├── ViewController.m │ ├── bkg@2x.jpg │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── RNBlurredSideViewControllerExampleTests │ ├── RNBlurredSideViewControllerExampleTests-Info.plist │ ├── RNBlurredSideViewControllerExampleTests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── README.md ├── RNBlurredSideViewController.podspec └── Screenshots ├── screenshot1.png ├── screenshot2.png └── screenshot3.png /Classes/RNBlurredSideViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBlurredSideViewController.h 3 | // RNBlurredSideViewController 4 | // 5 | // Created by Wenbo Shi on 2/12/14. 6 | // Copyright (c) 2014 Zzuumm. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 14 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 15 | 16 | #define DEFAULT_LEFT_WIDTH SCREEN_WIDTH-60 17 | #define DEFAULT_RIGHT_WIDTH SCREEN_WIDTH-60 18 | #define DEFAULT_ALPHA 0.5 19 | #define DEFAULT_DIM_ALPHA 0.4 20 | 21 | @interface UIImage (RNBlurredSideViewController) 22 | 23 | - (UIImage *)blurredImageWithRadius:(CGFloat)radius iterations:(NSUInteger)iterations tintColor:(UIColor *)tintColor; 24 | 25 | @end 26 | 27 | @interface RNBlurredSideViewController : UIViewController 28 | 29 | //The width of the left side view. Set it to 0 if there is no left view. 30 | @property (nonatomic, assign) CGFloat leftWidth; 31 | 32 | //The width of the right side view. Set it to 0 if there is no right view. 33 | @property (nonatomic, assign) CGFloat rightWidth; 34 | 35 | //The layer alpha of the side views. 36 | @property (nonatomic, assign) CGFloat sideViewAlpha; 37 | 38 | //The tint color of the side views. 39 | @property (nonatomic, retain) UIColor *sideViewTintColor; 40 | 41 | //The background image. 42 | @property (nonatomic, retain) UIImage *backgroundImage; 43 | 44 | //The container view of the left side view. 45 | @property (nonatomic, retain) UIView *leftContentView; 46 | 47 | //The container view of the center view. 48 | @property (nonatomic, retain) UIView *centerContentView; 49 | 50 | //The container view of the right side view. 51 | @property (nonatomic, retain) UIView *rightContentView; 52 | 53 | //Dim the background when swiping. Default is YES. 54 | @property (nonatomic, assign) BOOL dim; 55 | 56 | 57 | - (void)openLeftView:(BOOL)animated; 58 | - (void)openRightView:(BOOL)animated; 59 | - (void)closeSideView:(BOOL)animated; 60 | 61 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate; 62 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; 63 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Classes/RNBlurredSideViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RNBlurredSideViewController.m 3 | // RNBlurredSideViewController 4 | // 5 | // Created by Wenbo Shi on 2/12/14. 6 | // Copyright (c) 2014 Zzuumm. All rights reserved. 7 | // 8 | 9 | #import "RNBlurredSideViewController.h" 10 | 11 | 12 | @implementation UIImage (RNBlurredSideViewController) 13 | 14 | - (UIImage *)blurredImageWithRadius:(CGFloat)radius iterations:(NSUInteger)iterations tintColor:(UIColor *)tintColor 15 | { 16 | //image must be nonzero size 17 | if (floorf(self.size.width) * floorf(self.size.height) <= 0.0f) return self; 18 | 19 | //boxsize must be an odd integer 20 | uint32_t boxSize = (uint32_t)(radius * self.scale); 21 | if (boxSize % 2 == 0) boxSize ++; 22 | 23 | //create image buffers 24 | CGImageRef imageRef = self.CGImage; 25 | vImage_Buffer buffer1, buffer2; 26 | buffer1.width = buffer2.width = CGImageGetWidth(imageRef); 27 | buffer1.height = buffer2.height = CGImageGetHeight(imageRef); 28 | buffer1.rowBytes = buffer2.rowBytes = CGImageGetBytesPerRow(imageRef); 29 | size_t bytes = buffer1.rowBytes * buffer1.height; 30 | buffer1.data = malloc(bytes); 31 | buffer2.data = malloc(bytes); 32 | 33 | //create temp buffer 34 | void *tempBuffer = malloc((size_t)vImageBoxConvolve_ARGB8888(&buffer1, &buffer2, NULL, 0, 0, boxSize, boxSize, 35 | NULL, kvImageEdgeExtend + kvImageGetTempBufferSize)); 36 | 37 | //copy image data 38 | CFDataRef dataSource = CGDataProviderCopyData(CGImageGetDataProvider(imageRef)); 39 | memcpy(buffer1.data, CFDataGetBytePtr(dataSource), bytes); 40 | CFRelease(dataSource); 41 | 42 | for (NSUInteger i = 0; i < iterations; i++) 43 | { 44 | //perform blur 45 | vImageBoxConvolve_ARGB8888(&buffer1, &buffer2, tempBuffer, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend); 46 | 47 | //swap buffers 48 | void *temp = buffer1.data; 49 | buffer1.data = buffer2.data; 50 | buffer2.data = temp; 51 | } 52 | 53 | //free buffers 54 | free(buffer2.data); 55 | free(tempBuffer); 56 | 57 | //create image context from buffer 58 | CGContextRef ctx = CGBitmapContextCreate(buffer1.data, buffer1.width, buffer1.height, 59 | 8, buffer1.rowBytes, CGImageGetColorSpace(imageRef), 60 | CGImageGetBitmapInfo(imageRef)); 61 | 62 | //apply tint 63 | if (tintColor && CGColorGetAlpha(tintColor.CGColor) > 0.0f) 64 | { 65 | CGContextSetFillColorWithColor(ctx, [tintColor colorWithAlphaComponent:0.25].CGColor); 66 | CGContextSetBlendMode(ctx, kCGBlendModePlusLighter); 67 | CGContextFillRect(ctx, CGRectMake(0, 0, buffer1.width, buffer1.height)); 68 | } 69 | 70 | //create image from context 71 | imageRef = CGBitmapContextCreateImage(ctx); 72 | UIImage *image = [UIImage imageWithCGImage:imageRef scale:self.scale orientation:self.imageOrientation]; 73 | CGImageRelease(imageRef); 74 | CGContextRelease(ctx); 75 | free(buffer1.data); 76 | return image; 77 | } 78 | 79 | @end 80 | 81 | @interface RNBlurredSideViewController () 82 | 83 | @end 84 | 85 | @implementation RNBlurredSideViewController{ 86 | UIScrollView *mainScrollView; 87 | unsigned screenStatus; 88 | 89 | UIImage *blurredImage; 90 | UIImageView *blurredImageView; 91 | UIView *blurredOverlayView; 92 | 93 | UIView *backgroundView; 94 | } 95 | 96 | @synthesize leftWidth = _leftWidth; 97 | @synthesize rightWidth = _rightWidth; 98 | @synthesize sideViewAlpha = _sideViewAlpha; 99 | @synthesize backgroundImage = _backgroundImage; 100 | @synthesize leftContentView = _leftContentView; 101 | @synthesize centerContentView = _centerContentView; 102 | @synthesize rightContentView = _rightContentView; 103 | @synthesize dim = _dim; 104 | 105 | - (id)initWithCoder:(NSCoder*)aDecoder 106 | { 107 | if(self = [super initWithCoder:aDecoder]) 108 | { 109 | // Do something 110 | [self setDefault]; 111 | } 112 | return self; 113 | } 114 | 115 | - (id)init{ 116 | if (self = [super init]){ 117 | [self setDefault]; 118 | } 119 | return self; 120 | } 121 | 122 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ 123 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]){ 124 | [self setDefault]; 125 | } 126 | return self; 127 | } 128 | 129 | - (void)setDefault{ 130 | self.leftWidth = DEFAULT_LEFT_WIDTH; 131 | self.rightWidth = DEFAULT_RIGHT_WIDTH; 132 | self.sideViewAlpha = DEFAULT_ALPHA; 133 | self.sideViewTintColor = [UIColor blackColor]; 134 | self.dim = YES; 135 | } 136 | 137 | 138 | - (void)viewDidLoad 139 | { 140 | [super viewDidLoad]; 141 | // Do any additional setup after loading the view. 142 | [self loadScrollView]; 143 | } 144 | 145 | - (void)loadScrollView{ 146 | self.view.backgroundColor = [UIColor clearColor]; 147 | 148 | backgroundView = [[UIView alloc] initWithFrame:self.view.frame]; 149 | backgroundView.backgroundColor = [UIColor colorWithPatternImage:self.backgroundImage]; 150 | [self.view addSubview:backgroundView]; 151 | 152 | blurredImage = [self.backgroundImage blurredImageWithRadius:20 iterations:10 tintColor:nil]; 153 | 154 | 155 | mainScrollView = [[UIScrollView alloc] initWithFrame:self.view.frame]; 156 | mainScrollView.contentSize = CGSizeMake(SCREEN_WIDTH+self.leftWidth+self.rightWidth, SCREEN_HEIGHT); 157 | mainScrollView.backgroundColor = [UIColor clearColor]; 158 | mainScrollView.bounces = NO; 159 | mainScrollView.showsHorizontalScrollIndicator = NO; 160 | mainScrollView.showsVerticalScrollIndicator = NO; 161 | mainScrollView.decelerationRate = 0; 162 | 163 | [mainScrollView setCanCancelContentTouches:NO]; 164 | [mainScrollView setDelaysContentTouches:YES]; 165 | 166 | 167 | self.leftContentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.leftWidth, SCREEN_HEIGHT)]; 168 | self.leftContentView.backgroundColor = [UIColor clearColor]; 169 | [mainScrollView addSubview:_leftContentView]; 170 | 171 | UILabel *seperation = [[UILabel alloc] initWithFrame:CGRectMake(self.leftWidth-0.5, 0, 0.5, SCREEN_HEIGHT)]; 172 | seperation.backgroundColor = [UIColor whiteColor]; 173 | seperation.alpha = 0.3; 174 | [mainScrollView addSubview:seperation]; 175 | 176 | self.centerContentView = [[UIView alloc] initWithFrame:CGRectMake(self.leftWidth, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; 177 | self.centerContentView.backgroundColor = [UIColor clearColor]; 178 | [mainScrollView addSubview:_centerContentView]; 179 | 180 | self.rightContentView = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH+self.leftWidth, 0, self.rightWidth, SCREEN_HEIGHT)]; 181 | self.rightContentView.backgroundColor = [UIColor clearColor]; 182 | [mainScrollView addSubview:_rightContentView]; 183 | 184 | seperation = [[UILabel alloc] initWithFrame:CGRectMake(self.leftWidth+SCREEN_WIDTH, 0, 0.5, SCREEN_HEIGHT)]; 185 | seperation.backgroundColor = [UIColor whiteColor]; 186 | seperation.alpha = 0.3; 187 | [mainScrollView addSubview:seperation]; 188 | 189 | 190 | mainScrollView.delegate = self; 191 | 192 | [self.view addSubview:mainScrollView]; 193 | 194 | blurredImageView = [[UIImageView alloc] init]; 195 | blurredImageView.image = blurredImage; 196 | blurredImageView.clipsToBounds = YES; 197 | [self.view insertSubview:blurredImageView belowSubview:mainScrollView]; 198 | 199 | blurredOverlayView = [[UIImageView alloc] init]; 200 | blurredOverlayView.backgroundColor = _sideViewTintColor; 201 | blurredOverlayView.alpha = _sideViewAlpha; 202 | [self.view insertSubview:blurredOverlayView belowSubview:mainScrollView]; 203 | 204 | [self closeSideView:NO]; 205 | 206 | } 207 | 208 | #pragma mark - scrollView 209 | 210 | - (void)closeSideView:(BOOL)animated{ 211 | [mainScrollView setContentOffset:CGPointMake(self.leftWidth, 0) animated:animated]; 212 | screenStatus = 0; 213 | } 214 | 215 | - (void)openLeftView:(BOOL)animated{ 216 | [mainScrollView setContentOffset:CGPointMake(0, 0) animated:animated]; 217 | screenStatus = 1; 218 | } 219 | 220 | - (void)openRightView:(BOOL)animated{ 221 | [mainScrollView setContentOffset:CGPointMake(self.rightWidth+self.leftWidth, 0) animated:animated]; 222 | screenStatus = 2; 223 | } 224 | 225 | - (void)arrangeViews:(UIScrollView *)scrollView{ 226 | if (scrollView.contentOffset.xself.leftWidth+self.rightWidth*4/5){ 238 | if (screenStatus == 0) 239 | [self openRightView:YES]; 240 | else if (screenStatus != 2) { 241 | [self closeSideView:YES]; 242 | } 243 | else{ 244 | [self openRightView:YES]; 245 | } 246 | } 247 | else{ 248 | [self closeSideView:YES]; 249 | } 250 | } 251 | 252 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ 253 | //NSLog(@"%f",scrollView.contentOffset.x); 254 | //NSLog(@"%f",SCREEN_WIDTH-LEFT_SIZE); 255 | if ([scrollView isEqual:mainScrollView]){ 256 | if (!decelerate){ 257 | [self arrangeViews:scrollView]; 258 | } 259 | } 260 | } 261 | 262 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ 263 | if ([scrollView isEqual:mainScrollView]) 264 | [self arrangeViews:scrollView]; 265 | } 266 | 267 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ 268 | if ([scrollView isEqual:mainScrollView]){ 269 | if (scrollView.contentOffset.x < self.leftWidth){ 270 | CGRect blurredRect = CGRectMake(0, 0, self.leftWidth-scrollView.contentOffset.x, SCREEN_HEIGHT); 271 | //UIImage *croppedBlurredImage = [blurredImage croppedImage:blurredRect]; 272 | blurredImageView.frame = blurredRect; 273 | blurredImageView.contentMode = UIViewContentModeTopLeft; 274 | blurredOverlayView.frame = blurredImageView.frame; 275 | if (self.dim){ 276 | backgroundView.alpha = DEFAULT_DIM_ALPHA+(1-DEFAULT_DIM_ALPHA)*(1-(self.leftWidth-scrollView.contentOffset.x)/self.leftWidth); 277 | self.centerContentView.alpha = backgroundView.alpha; 278 | } 279 | } 280 | else if (scrollView.contentOffset.x > self.leftWidth){ 281 | CGRect blurredRect = CGRectMake(SCREEN_WIDTH - (scrollView.contentOffset.x-self.leftWidth), 0, scrollView.contentOffset.x-self.leftWidth, SCREEN_HEIGHT); 282 | blurredImageView.frame = blurredRect; 283 | blurredImageView.contentMode = UIViewContentModeTopRight; 284 | blurredOverlayView.frame = blurredImageView.frame; 285 | if (self.dim){ 286 | backgroundView.alpha = DEFAULT_DIM_ALPHA+(1-DEFAULT_DIM_ALPHA)*(1-(scrollView.contentOffset.x-self.leftWidth)/self.rightWidth); 287 | self.centerContentView.alpha = backgroundView.alpha; 288 | } 289 | } 290 | 291 | } 292 | } 293 | 294 | @end 295 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C253021F18AF18CA0005325C /* RNBlurredSideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C253021E18AF18CA0005325C /* RNBlurredSideViewController.m */; }; 11 | C2DCE76918AC922500966E50 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2DCE76818AC922500966E50 /* Foundation.framework */; }; 12 | C2DCE76B18AC922500966E50 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2DCE76A18AC922500966E50 /* CoreGraphics.framework */; }; 13 | C2DCE76D18AC922500966E50 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2DCE76C18AC922500966E50 /* UIKit.framework */; }; 14 | C2DCE77318AC922500966E50 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C2DCE77118AC922500966E50 /* InfoPlist.strings */; }; 15 | C2DCE77518AC922500966E50 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C2DCE77418AC922500966E50 /* main.m */; }; 16 | C2DCE77918AC922500966E50 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C2DCE77818AC922500966E50 /* AppDelegate.m */; }; 17 | C2DCE77C18AC922600966E50 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C2DCE77A18AC922600966E50 /* Main.storyboard */; }; 18 | C2DCE77F18AC922600966E50 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C2DCE77E18AC922600966E50 /* ViewController.m */; }; 19 | C2DCE78118AC922600966E50 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C2DCE78018AC922600966E50 /* Images.xcassets */; }; 20 | C2DCE78818AC922600966E50 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2DCE78718AC922600966E50 /* XCTest.framework */; }; 21 | C2DCE78918AC922600966E50 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2DCE76818AC922500966E50 /* Foundation.framework */; }; 22 | C2DCE78A18AC922600966E50 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2DCE76C18AC922500966E50 /* UIKit.framework */; }; 23 | C2DCE79218AC922600966E50 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C2DCE79018AC922600966E50 /* InfoPlist.strings */; }; 24 | C2DCE79418AC922600966E50 /* RNBlurredSideViewControllerExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C2DCE79318AC922600966E50 /* RNBlurredSideViewControllerExampleTests.m */; }; 25 | C2DCE7A518AC979700966E50 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2DCE7A418AC979700966E50 /* Accelerate.framework */; }; 26 | C2DCE7B018ADC71000966E50 /* bkg@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C2DCE7AF18ADC71000966E50 /* bkg@2x.jpg */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | C2DCE78B18AC922600966E50 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = C2DCE75D18AC922500966E50 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = C2DCE76418AC922500966E50; 35 | remoteInfo = RNBlurredSideViewControllerExample; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | C253021D18AF18CA0005325C /* RNBlurredSideViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBlurredSideViewController.h; sourceTree = ""; }; 41 | C253021E18AF18CA0005325C /* RNBlurredSideViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNBlurredSideViewController.m; sourceTree = ""; }; 42 | C2DCE76518AC922500966E50 /* RNBlurredSideViewControllerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNBlurredSideViewControllerExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | C2DCE76818AC922500966E50 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 44 | C2DCE76A18AC922500966E50 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 45 | C2DCE76C18AC922500966E50 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 46 | C2DCE77018AC922500966E50 /* RNBlurredSideViewControllerExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RNBlurredSideViewControllerExample-Info.plist"; sourceTree = ""; }; 47 | C2DCE77218AC922500966E50 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 48 | C2DCE77418AC922500966E50 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | C2DCE77618AC922500966E50 /* RNBlurredSideViewControllerExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNBlurredSideViewControllerExample-Prefix.pch"; sourceTree = ""; }; 50 | C2DCE77718AC922500966E50 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | C2DCE77818AC922500966E50 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | C2DCE77B18AC922600966E50 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | C2DCE77D18AC922600966E50 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 54 | C2DCE77E18AC922600966E50 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 55 | C2DCE78018AC922600966E50 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 56 | C2DCE78618AC922600966E50 /* RNBlurredSideViewControllerExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNBlurredSideViewControllerExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | C2DCE78718AC922600966E50 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 58 | C2DCE78F18AC922600966E50 /* RNBlurredSideViewControllerExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RNBlurredSideViewControllerExampleTests-Info.plist"; sourceTree = ""; }; 59 | C2DCE79118AC922600966E50 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 60 | C2DCE79318AC922600966E50 /* RNBlurredSideViewControllerExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNBlurredSideViewControllerExampleTests.m; sourceTree = ""; }; 61 | C2DCE7A418AC979700966E50 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 62 | C2DCE7AF18ADC71000966E50 /* bkg@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "bkg@2x.jpg"; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | C2DCE76218AC922500966E50 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | C2DCE7A518AC979700966E50 /* Accelerate.framework in Frameworks */, 71 | C2DCE76B18AC922500966E50 /* CoreGraphics.framework in Frameworks */, 72 | C2DCE76D18AC922500966E50 /* UIKit.framework in Frameworks */, 73 | C2DCE76918AC922500966E50 /* Foundation.framework in Frameworks */, 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | C2DCE78318AC922600966E50 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | C2DCE78818AC922600966E50 /* XCTest.framework in Frameworks */, 82 | C2DCE78A18AC922600966E50 /* UIKit.framework in Frameworks */, 83 | C2DCE78918AC922600966E50 /* Foundation.framework in Frameworks */, 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXFrameworksBuildPhase section */ 88 | 89 | /* Begin PBXGroup section */ 90 | C2DCE75C18AC922500966E50 = { 91 | isa = PBXGroup; 92 | children = ( 93 | C2DCE76E18AC922500966E50 /* RNBlurredSideViewControllerExample */, 94 | C2DCE78D18AC922600966E50 /* RNBlurredSideViewControllerExampleTests */, 95 | C2DCE76718AC922500966E50 /* Frameworks */, 96 | C2DCE76618AC922500966E50 /* Products */, 97 | ); 98 | sourceTree = ""; 99 | }; 100 | C2DCE76618AC922500966E50 /* Products */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | C2DCE76518AC922500966E50 /* RNBlurredSideViewControllerExample.app */, 104 | C2DCE78618AC922600966E50 /* RNBlurredSideViewControllerExampleTests.xctest */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | C2DCE76718AC922500966E50 /* Frameworks */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | C2DCE7A418AC979700966E50 /* Accelerate.framework */, 113 | C2DCE76818AC922500966E50 /* Foundation.framework */, 114 | C2DCE76A18AC922500966E50 /* CoreGraphics.framework */, 115 | C2DCE76C18AC922500966E50 /* UIKit.framework */, 116 | C2DCE78718AC922600966E50 /* XCTest.framework */, 117 | ); 118 | name = Frameworks; 119 | sourceTree = ""; 120 | }; 121 | C2DCE76E18AC922500966E50 /* RNBlurredSideViewControllerExample */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | C2DCE7AF18ADC71000966E50 /* bkg@2x.jpg */, 125 | C253021D18AF18CA0005325C /* RNBlurredSideViewController.h */, 126 | C253021E18AF18CA0005325C /* RNBlurredSideViewController.m */, 127 | C2DCE77718AC922500966E50 /* AppDelegate.h */, 128 | C2DCE77818AC922500966E50 /* AppDelegate.m */, 129 | C2DCE77A18AC922600966E50 /* Main.storyboard */, 130 | C2DCE77D18AC922600966E50 /* ViewController.h */, 131 | C2DCE77E18AC922600966E50 /* ViewController.m */, 132 | C2DCE78018AC922600966E50 /* Images.xcassets */, 133 | C2DCE76F18AC922500966E50 /* Supporting Files */, 134 | ); 135 | path = RNBlurredSideViewControllerExample; 136 | sourceTree = ""; 137 | }; 138 | C2DCE76F18AC922500966E50 /* Supporting Files */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | C2DCE77018AC922500966E50 /* RNBlurredSideViewControllerExample-Info.plist */, 142 | C2DCE77118AC922500966E50 /* InfoPlist.strings */, 143 | C2DCE77418AC922500966E50 /* main.m */, 144 | C2DCE77618AC922500966E50 /* RNBlurredSideViewControllerExample-Prefix.pch */, 145 | ); 146 | name = "Supporting Files"; 147 | sourceTree = ""; 148 | }; 149 | C2DCE78D18AC922600966E50 /* RNBlurredSideViewControllerExampleTests */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | C2DCE79318AC922600966E50 /* RNBlurredSideViewControllerExampleTests.m */, 153 | C2DCE78E18AC922600966E50 /* Supporting Files */, 154 | ); 155 | path = RNBlurredSideViewControllerExampleTests; 156 | sourceTree = ""; 157 | }; 158 | C2DCE78E18AC922600966E50 /* Supporting Files */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | C2DCE78F18AC922600966E50 /* RNBlurredSideViewControllerExampleTests-Info.plist */, 162 | C2DCE79018AC922600966E50 /* InfoPlist.strings */, 163 | ); 164 | name = "Supporting Files"; 165 | sourceTree = ""; 166 | }; 167 | /* End PBXGroup section */ 168 | 169 | /* Begin PBXNativeTarget section */ 170 | C2DCE76418AC922500966E50 /* RNBlurredSideViewControllerExample */ = { 171 | isa = PBXNativeTarget; 172 | buildConfigurationList = C2DCE79718AC922600966E50 /* Build configuration list for PBXNativeTarget "RNBlurredSideViewControllerExample" */; 173 | buildPhases = ( 174 | C2DCE76118AC922500966E50 /* Sources */, 175 | C2DCE76218AC922500966E50 /* Frameworks */, 176 | C2DCE76318AC922500966E50 /* Resources */, 177 | ); 178 | buildRules = ( 179 | ); 180 | dependencies = ( 181 | ); 182 | name = RNBlurredSideViewControllerExample; 183 | productName = RNBlurredSideViewControllerExample; 184 | productReference = C2DCE76518AC922500966E50 /* RNBlurredSideViewControllerExample.app */; 185 | productType = "com.apple.product-type.application"; 186 | }; 187 | C2DCE78518AC922600966E50 /* RNBlurredSideViewControllerExampleTests */ = { 188 | isa = PBXNativeTarget; 189 | buildConfigurationList = C2DCE79A18AC922600966E50 /* Build configuration list for PBXNativeTarget "RNBlurredSideViewControllerExampleTests" */; 190 | buildPhases = ( 191 | C2DCE78218AC922600966E50 /* Sources */, 192 | C2DCE78318AC922600966E50 /* Frameworks */, 193 | C2DCE78418AC922600966E50 /* Resources */, 194 | ); 195 | buildRules = ( 196 | ); 197 | dependencies = ( 198 | C2DCE78C18AC922600966E50 /* PBXTargetDependency */, 199 | ); 200 | name = RNBlurredSideViewControllerExampleTests; 201 | productName = RNBlurredSideViewControllerExampleTests; 202 | productReference = C2DCE78618AC922600966E50 /* RNBlurredSideViewControllerExampleTests.xctest */; 203 | productType = "com.apple.product-type.bundle.unit-test"; 204 | }; 205 | /* End PBXNativeTarget section */ 206 | 207 | /* Begin PBXProject section */ 208 | C2DCE75D18AC922500966E50 /* Project object */ = { 209 | isa = PBXProject; 210 | attributes = { 211 | LastUpgradeCheck = 0500; 212 | ORGANIZATIONNAME = Zzuumm; 213 | TargetAttributes = { 214 | C2DCE76418AC922500966E50 = { 215 | DevelopmentTeam = V48BJS7H4Z; 216 | }; 217 | C2DCE78518AC922600966E50 = { 218 | TestTargetID = C2DCE76418AC922500966E50; 219 | }; 220 | }; 221 | }; 222 | buildConfigurationList = C2DCE76018AC922500966E50 /* Build configuration list for PBXProject "RNBlurredSideViewControllerExample" */; 223 | compatibilityVersion = "Xcode 3.2"; 224 | developmentRegion = English; 225 | hasScannedForEncodings = 0; 226 | knownRegions = ( 227 | en, 228 | Base, 229 | ); 230 | mainGroup = C2DCE75C18AC922500966E50; 231 | productRefGroup = C2DCE76618AC922500966E50 /* Products */; 232 | projectDirPath = ""; 233 | projectRoot = ""; 234 | targets = ( 235 | C2DCE76418AC922500966E50 /* RNBlurredSideViewControllerExample */, 236 | C2DCE78518AC922600966E50 /* RNBlurredSideViewControllerExampleTests */, 237 | ); 238 | }; 239 | /* End PBXProject section */ 240 | 241 | /* Begin PBXResourcesBuildPhase section */ 242 | C2DCE76318AC922500966E50 /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | C2DCE7B018ADC71000966E50 /* bkg@2x.jpg in Resources */, 247 | C2DCE78118AC922600966E50 /* Images.xcassets in Resources */, 248 | C2DCE77318AC922500966E50 /* InfoPlist.strings in Resources */, 249 | C2DCE77C18AC922600966E50 /* Main.storyboard in Resources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | C2DCE78418AC922600966E50 /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | C2DCE79218AC922600966E50 /* InfoPlist.strings in Resources */, 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | /* End PBXResourcesBuildPhase section */ 262 | 263 | /* Begin PBXSourcesBuildPhase section */ 264 | C2DCE76118AC922500966E50 /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | C253021F18AF18CA0005325C /* RNBlurredSideViewController.m in Sources */, 269 | C2DCE77F18AC922600966E50 /* ViewController.m in Sources */, 270 | C2DCE77918AC922500966E50 /* AppDelegate.m in Sources */, 271 | C2DCE77518AC922500966E50 /* main.m in Sources */, 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | C2DCE78218AC922600966E50 /* Sources */ = { 276 | isa = PBXSourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | C2DCE79418AC922600966E50 /* RNBlurredSideViewControllerExampleTests.m in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | /* End PBXSourcesBuildPhase section */ 284 | 285 | /* Begin PBXTargetDependency section */ 286 | C2DCE78C18AC922600966E50 /* PBXTargetDependency */ = { 287 | isa = PBXTargetDependency; 288 | target = C2DCE76418AC922500966E50 /* RNBlurredSideViewControllerExample */; 289 | targetProxy = C2DCE78B18AC922600966E50 /* PBXContainerItemProxy */; 290 | }; 291 | /* End PBXTargetDependency section */ 292 | 293 | /* Begin PBXVariantGroup section */ 294 | C2DCE77118AC922500966E50 /* InfoPlist.strings */ = { 295 | isa = PBXVariantGroup; 296 | children = ( 297 | C2DCE77218AC922500966E50 /* en */, 298 | ); 299 | name = InfoPlist.strings; 300 | sourceTree = ""; 301 | }; 302 | C2DCE77A18AC922600966E50 /* Main.storyboard */ = { 303 | isa = PBXVariantGroup; 304 | children = ( 305 | C2DCE77B18AC922600966E50 /* Base */, 306 | ); 307 | name = Main.storyboard; 308 | sourceTree = ""; 309 | }; 310 | C2DCE79018AC922600966E50 /* InfoPlist.strings */ = { 311 | isa = PBXVariantGroup; 312 | children = ( 313 | C2DCE79118AC922600966E50 /* en */, 314 | ); 315 | name = InfoPlist.strings; 316 | sourceTree = ""; 317 | }; 318 | /* End PBXVariantGroup section */ 319 | 320 | /* Begin XCBuildConfiguration section */ 321 | C2DCE79518AC922600966E50 /* Debug */ = { 322 | isa = XCBuildConfiguration; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 327 | CLANG_CXX_LIBRARY = "libc++"; 328 | CLANG_ENABLE_MODULES = YES; 329 | CLANG_ENABLE_OBJC_ARC = YES; 330 | CLANG_WARN_BOOL_CONVERSION = YES; 331 | CLANG_WARN_CONSTANT_CONVERSION = YES; 332 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 333 | CLANG_WARN_EMPTY_BODY = YES; 334 | CLANG_WARN_ENUM_CONVERSION = YES; 335 | CLANG_WARN_INT_CONVERSION = YES; 336 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | GCC_C_LANGUAGE_STANDARD = gnu99; 341 | GCC_DYNAMIC_NO_PIC = NO; 342 | GCC_OPTIMIZATION_LEVEL = 0; 343 | GCC_PREPROCESSOR_DEFINITIONS = ( 344 | "DEBUG=1", 345 | "$(inherited)", 346 | ); 347 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 348 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 349 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 350 | GCC_WARN_UNDECLARED_SELECTOR = YES; 351 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 352 | GCC_WARN_UNUSED_FUNCTION = YES; 353 | GCC_WARN_UNUSED_VARIABLE = YES; 354 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 355 | ONLY_ACTIVE_ARCH = YES; 356 | SDKROOT = iphoneos; 357 | }; 358 | name = Debug; 359 | }; 360 | C2DCE79618AC922600966E50 /* Release */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ALWAYS_SEARCH_USER_PATHS = NO; 364 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 365 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 366 | CLANG_CXX_LIBRARY = "libc++"; 367 | CLANG_ENABLE_MODULES = YES; 368 | CLANG_ENABLE_OBJC_ARC = YES; 369 | CLANG_WARN_BOOL_CONVERSION = YES; 370 | CLANG_WARN_CONSTANT_CONVERSION = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INT_CONVERSION = YES; 375 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 376 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 377 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 378 | COPY_PHASE_STRIP = YES; 379 | ENABLE_NS_ASSERTIONS = NO; 380 | GCC_C_LANGUAGE_STANDARD = gnu99; 381 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 382 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 383 | GCC_WARN_UNDECLARED_SELECTOR = YES; 384 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 385 | GCC_WARN_UNUSED_FUNCTION = YES; 386 | GCC_WARN_UNUSED_VARIABLE = YES; 387 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 388 | SDKROOT = iphoneos; 389 | VALIDATE_PRODUCT = YES; 390 | }; 391 | name = Release; 392 | }; 393 | C2DCE79818AC922600966E50 /* Debug */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 397 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 398 | CODE_SIGN_IDENTITY = "iPhone Developer"; 399 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 400 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 401 | GCC_PREFIX_HEADER = "RNBlurredSideViewControllerExample/RNBlurredSideViewControllerExample-Prefix.pch"; 402 | INFOPLIST_FILE = "RNBlurredSideViewControllerExample/RNBlurredSideViewControllerExample-Info.plist"; 403 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | PROVISIONING_PROFILE = ""; 406 | WRAPPER_EXTENSION = app; 407 | }; 408 | name = Debug; 409 | }; 410 | C2DCE79918AC922600966E50 /* Release */ = { 411 | isa = XCBuildConfiguration; 412 | buildSettings = { 413 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 414 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 415 | CODE_SIGN_IDENTITY = "iPhone Developer"; 416 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 417 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 418 | GCC_PREFIX_HEADER = "RNBlurredSideViewControllerExample/RNBlurredSideViewControllerExample-Prefix.pch"; 419 | INFOPLIST_FILE = "RNBlurredSideViewControllerExample/RNBlurredSideViewControllerExample-Info.plist"; 420 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 421 | PRODUCT_NAME = "$(TARGET_NAME)"; 422 | PROVISIONING_PROFILE = ""; 423 | WRAPPER_EXTENSION = app; 424 | }; 425 | name = Release; 426 | }; 427 | C2DCE79B18AC922600966E50 /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 431 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/RNBlurredSideViewControllerExample.app/RNBlurredSideViewControllerExample"; 432 | FRAMEWORK_SEARCH_PATHS = ( 433 | "$(SDKROOT)/Developer/Library/Frameworks", 434 | "$(inherited)", 435 | "$(DEVELOPER_FRAMEWORKS_DIR)", 436 | ); 437 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 438 | GCC_PREFIX_HEADER = "RNBlurredSideViewControllerExample/RNBlurredSideViewControllerExample-Prefix.pch"; 439 | GCC_PREPROCESSOR_DEFINITIONS = ( 440 | "DEBUG=1", 441 | "$(inherited)", 442 | ); 443 | INFOPLIST_FILE = "RNBlurredSideViewControllerExampleTests/RNBlurredSideViewControllerExampleTests-Info.plist"; 444 | PRODUCT_NAME = "$(TARGET_NAME)"; 445 | TEST_HOST = "$(BUNDLE_LOADER)"; 446 | WRAPPER_EXTENSION = xctest; 447 | }; 448 | name = Debug; 449 | }; 450 | C2DCE79C18AC922600966E50 /* Release */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 454 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/RNBlurredSideViewControllerExample.app/RNBlurredSideViewControllerExample"; 455 | FRAMEWORK_SEARCH_PATHS = ( 456 | "$(SDKROOT)/Developer/Library/Frameworks", 457 | "$(inherited)", 458 | "$(DEVELOPER_FRAMEWORKS_DIR)", 459 | ); 460 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 461 | GCC_PREFIX_HEADER = "RNBlurredSideViewControllerExample/RNBlurredSideViewControllerExample-Prefix.pch"; 462 | INFOPLIST_FILE = "RNBlurredSideViewControllerExampleTests/RNBlurredSideViewControllerExampleTests-Info.plist"; 463 | PRODUCT_NAME = "$(TARGET_NAME)"; 464 | TEST_HOST = "$(BUNDLE_LOADER)"; 465 | WRAPPER_EXTENSION = xctest; 466 | }; 467 | name = Release; 468 | }; 469 | /* End XCBuildConfiguration section */ 470 | 471 | /* Begin XCConfigurationList section */ 472 | C2DCE76018AC922500966E50 /* Build configuration list for PBXProject "RNBlurredSideViewControllerExample" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | C2DCE79518AC922600966E50 /* Debug */, 476 | C2DCE79618AC922600966E50 /* Release */, 477 | ); 478 | defaultConfigurationIsVisible = 0; 479 | defaultConfigurationName = Release; 480 | }; 481 | C2DCE79718AC922600966E50 /* Build configuration list for PBXNativeTarget "RNBlurredSideViewControllerExample" */ = { 482 | isa = XCConfigurationList; 483 | buildConfigurations = ( 484 | C2DCE79818AC922600966E50 /* Debug */, 485 | C2DCE79918AC922600966E50 /* Release */, 486 | ); 487 | defaultConfigurationIsVisible = 0; 488 | defaultConfigurationName = Release; 489 | }; 490 | C2DCE79A18AC922600966E50 /* Build configuration list for PBXNativeTarget "RNBlurredSideViewControllerExampleTests" */ = { 491 | isa = XCConfigurationList; 492 | buildConfigurations = ( 493 | C2DCE79B18AC922600966E50 /* Debug */, 494 | C2DCE79C18AC922600966E50 /* Release */, 495 | ); 496 | defaultConfigurationIsVisible = 0; 497 | defaultConfigurationName = Release; 498 | }; 499 | /* End XCConfigurationList section */ 500 | }; 501 | rootObject = C2DCE75D18AC922500966E50 /* Project object */; 502 | } 503 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample.xcodeproj/project.xcworkspace/xcshareddata/RNBlurredSideViewControllerExample.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 9CC8B0CB-4462-4079-B7F3-AF9CEC7C3D16 9 | IDESourceControlProjectName 10 | RNBlurredSideViewControllerExample 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 52A7BAF3-F40E-4133-A814-FCCCE428387B 14 | https://github.com/cwenboshi/RNBlurredSideViewController.git 15 | 16 | IDESourceControlProjectPath 17 | Example/RNBlurredSideViewControllerExample.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 52A7BAF3-F40E-4133-A814-FCCCE428387B 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/cwenboshi/RNBlurredSideViewController.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | 52A7BAF3-F40E-4133-A814-FCCCE428387B 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 52A7BAF3-F40E-4133-A814-FCCCE428387B 36 | IDESourceControlWCCName 37 | RNBlurredSideViewController 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample.xcodeproj/project.xcworkspace/xcuserdata/Wenbo.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwenboshi/RNBlurredSideViewController/efbe8ff7b07230bf18c0b9df80f57b6b6b53b2c8/Example/RNBlurredSideViewControllerExample.xcodeproj/project.xcworkspace/xcuserdata/Wenbo.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample.xcodeproj/xcuserdata/Wenbo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample.xcodeproj/xcuserdata/Wenbo.xcuserdatad/xcschemes/RNBlurredSideViewControllerExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample.xcodeproj/xcuserdata/Wenbo.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RNBlurredSideViewControllerExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C2DCE76418AC922500966E50 16 | 17 | primary 18 | 19 | 20 | C2DCE78518AC922600966E50 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // RNBlurredSideViewControllerExample 4 | // 5 | // Created by Wenbo Shi on 2/12/14. 6 | // Copyright (c) 2014 Zzuumm. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // RNBlurredSideViewControllerExample 4 | // 5 | // Created by Wenbo Shi on 2/12/14. 6 | // Copyright (c) 2014 Zzuumm. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 17 | return YES; 18 | } 19 | 20 | - (void)applicationWillResignActive:(UIApplication *)application 21 | { 22 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 23 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 24 | } 25 | 26 | - (void)applicationDidEnterBackground:(UIApplication *)application 27 | { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | - (void)applicationWillEnterForeground:(UIApplication *)application 33 | { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application 38 | { 39 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 40 | } 41 | 42 | - (void)applicationWillTerminate:(UIApplication *)application 43 | { 44 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/RNBlurredSideViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBlurredSideViewController.h 3 | // RNBlurredSideViewController 4 | // 5 | // Created by Wenbo Shi on 2/12/14. 6 | // Copyright (c) 2014 Zzuumm. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 14 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 15 | 16 | #define DEFAULT_LEFT_WIDTH SCREEN_WIDTH-60 17 | #define DEFAULT_RIGHT_WIDTH SCREEN_WIDTH-60 18 | #define DEFAULT_ALPHA 0.5 19 | #define DEFAULT_DIM_ALPHA 0.4 20 | 21 | @interface UIImage (RNBlurredSideViewController) 22 | 23 | - (UIImage *)blurredImageWithRadius:(CGFloat)radius iterations:(NSUInteger)iterations tintColor:(UIColor *)tintColor; 24 | 25 | @end 26 | 27 | @interface RNBlurredSideViewController : UIViewController 28 | 29 | //The width of the left side view. Set it to 0 if there is no left view. 30 | @property (nonatomic, assign) CGFloat leftWidth; 31 | 32 | //The width of the right side view. Set it to 0 if there is no right view. 33 | @property (nonatomic, assign) CGFloat rightWidth; 34 | 35 | //The layer alpha of the side views. 36 | @property (nonatomic, assign) CGFloat sideViewAlpha; 37 | 38 | //The tint color of the side views. 39 | @property (nonatomic, retain) UIColor *sideViewTintColor; 40 | 41 | //The background image. 42 | @property (nonatomic, retain) UIImage *backgroundImage; 43 | 44 | //The container view of the left side view. 45 | @property (nonatomic, retain) UIView *leftContentView; 46 | 47 | //The container view of the center view. 48 | @property (nonatomic, retain) UIView *centerContentView; 49 | 50 | //The container view of the right side view. 51 | @property (nonatomic, retain) UIView *rightContentView; 52 | 53 | //Dim the background when swiping. Default is YES. 54 | @property (nonatomic, assign) BOOL dim; 55 | 56 | 57 | - (void)openLeftView:(BOOL)animated; 58 | - (void)openRightView:(BOOL)animated; 59 | - (void)closeSideView:(BOOL)animated; 60 | 61 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate; 62 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; 63 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/RNBlurredSideViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RNBlurredSideViewController.m 3 | // RNBlurredSideViewController 4 | // 5 | // Created by Wenbo Shi on 2/12/14. 6 | // Copyright (c) 2014 Zzuumm. All rights reserved. 7 | // 8 | 9 | #import "RNBlurredSideViewController.h" 10 | 11 | 12 | @implementation UIImage (RNBlurredSideViewController) 13 | 14 | - (UIImage *)blurredImageWithRadius:(CGFloat)radius iterations:(NSUInteger)iterations tintColor:(UIColor *)tintColor 15 | { 16 | //image must be nonzero size 17 | if (floorf(self.size.width) * floorf(self.size.height) <= 0.0f) return self; 18 | 19 | //boxsize must be an odd integer 20 | uint32_t boxSize = (uint32_t)(radius * self.scale); 21 | if (boxSize % 2 == 0) boxSize ++; 22 | 23 | //create image buffers 24 | CGImageRef imageRef = self.CGImage; 25 | vImage_Buffer buffer1, buffer2; 26 | buffer1.width = buffer2.width = CGImageGetWidth(imageRef); 27 | buffer1.height = buffer2.height = CGImageGetHeight(imageRef); 28 | buffer1.rowBytes = buffer2.rowBytes = CGImageGetBytesPerRow(imageRef); 29 | size_t bytes = buffer1.rowBytes * buffer1.height; 30 | buffer1.data = malloc(bytes); 31 | buffer2.data = malloc(bytes); 32 | 33 | //create temp buffer 34 | void *tempBuffer = malloc((size_t)vImageBoxConvolve_ARGB8888(&buffer1, &buffer2, NULL, 0, 0, boxSize, boxSize, 35 | NULL, kvImageEdgeExtend + kvImageGetTempBufferSize)); 36 | 37 | //copy image data 38 | CFDataRef dataSource = CGDataProviderCopyData(CGImageGetDataProvider(imageRef)); 39 | memcpy(buffer1.data, CFDataGetBytePtr(dataSource), bytes); 40 | CFRelease(dataSource); 41 | 42 | for (NSUInteger i = 0; i < iterations; i++) 43 | { 44 | //perform blur 45 | vImageBoxConvolve_ARGB8888(&buffer1, &buffer2, tempBuffer, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend); 46 | 47 | //swap buffers 48 | void *temp = buffer1.data; 49 | buffer1.data = buffer2.data; 50 | buffer2.data = temp; 51 | } 52 | 53 | //free buffers 54 | free(buffer2.data); 55 | free(tempBuffer); 56 | 57 | //create image context from buffer 58 | CGContextRef ctx = CGBitmapContextCreate(buffer1.data, buffer1.width, buffer1.height, 59 | 8, buffer1.rowBytes, CGImageGetColorSpace(imageRef), 60 | CGImageGetBitmapInfo(imageRef)); 61 | 62 | //apply tint 63 | if (tintColor && CGColorGetAlpha(tintColor.CGColor) > 0.0f) 64 | { 65 | CGContextSetFillColorWithColor(ctx, [tintColor colorWithAlphaComponent:0.25].CGColor); 66 | CGContextSetBlendMode(ctx, kCGBlendModePlusLighter); 67 | CGContextFillRect(ctx, CGRectMake(0, 0, buffer1.width, buffer1.height)); 68 | } 69 | 70 | //create image from context 71 | imageRef = CGBitmapContextCreateImage(ctx); 72 | UIImage *image = [UIImage imageWithCGImage:imageRef scale:self.scale orientation:self.imageOrientation]; 73 | CGImageRelease(imageRef); 74 | CGContextRelease(ctx); 75 | free(buffer1.data); 76 | return image; 77 | } 78 | 79 | @end 80 | 81 | @interface RNBlurredSideViewController () 82 | 83 | @end 84 | 85 | @implementation RNBlurredSideViewController{ 86 | UIScrollView *mainScrollView; 87 | unsigned screenStatus; 88 | 89 | UIImage *blurredImage; 90 | UIImageView *blurredImageView; 91 | UIView *blurredOverlayView; 92 | 93 | UIView *backgroundView; 94 | } 95 | 96 | @synthesize leftWidth = _leftWidth; 97 | @synthesize rightWidth = _rightWidth; 98 | @synthesize sideViewAlpha = _sideViewAlpha; 99 | @synthesize backgroundImage = _backgroundImage; 100 | @synthesize leftContentView = _leftContentView; 101 | @synthesize centerContentView = _centerContentView; 102 | @synthesize rightContentView = _rightContentView; 103 | @synthesize dim = _dim; 104 | 105 | - (id)initWithCoder:(NSCoder*)aDecoder 106 | { 107 | if(self = [super initWithCoder:aDecoder]) 108 | { 109 | // Do something 110 | [self setDefault]; 111 | } 112 | return self; 113 | } 114 | 115 | - (id)init{ 116 | if (self = [super init]){ 117 | [self setDefault]; 118 | } 119 | return self; 120 | } 121 | 122 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ 123 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]){ 124 | [self setDefault]; 125 | } 126 | return self; 127 | } 128 | 129 | - (void)setDefault{ 130 | self.leftWidth = DEFAULT_LEFT_WIDTH; 131 | self.rightWidth = DEFAULT_RIGHT_WIDTH; 132 | self.sideViewAlpha = DEFAULT_ALPHA; 133 | self.sideViewTintColor = [UIColor blackColor]; 134 | self.dim = YES; 135 | } 136 | 137 | 138 | - (void)viewDidLoad 139 | { 140 | [super viewDidLoad]; 141 | // Do any additional setup after loading the view. 142 | [self loadScrollView]; 143 | } 144 | 145 | - (void)loadScrollView{ 146 | self.view.backgroundColor = [UIColor clearColor]; 147 | 148 | backgroundView = [[UIView alloc] initWithFrame:self.view.frame]; 149 | backgroundView.backgroundColor = [UIColor colorWithPatternImage:self.backgroundImage]; 150 | [self.view addSubview:backgroundView]; 151 | 152 | blurredImage = [self.backgroundImage blurredImageWithRadius:20 iterations:10 tintColor:nil]; 153 | 154 | 155 | mainScrollView = [[UIScrollView alloc] initWithFrame:self.view.frame]; 156 | mainScrollView.contentSize = CGSizeMake(SCREEN_WIDTH+self.leftWidth+self.rightWidth, SCREEN_HEIGHT); 157 | mainScrollView.backgroundColor = [UIColor clearColor]; 158 | mainScrollView.bounces = NO; 159 | mainScrollView.showsHorizontalScrollIndicator = NO; 160 | mainScrollView.showsVerticalScrollIndicator = NO; 161 | mainScrollView.decelerationRate = 0; 162 | 163 | [mainScrollView setCanCancelContentTouches:NO]; 164 | [mainScrollView setDelaysContentTouches:YES]; 165 | 166 | 167 | self.leftContentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.leftWidth, SCREEN_HEIGHT)]; 168 | self.leftContentView.backgroundColor = [UIColor clearColor]; 169 | [mainScrollView addSubview:_leftContentView]; 170 | 171 | UILabel *seperation = [[UILabel alloc] initWithFrame:CGRectMake(self.leftWidth-0.5, 0, 0.5, SCREEN_HEIGHT)]; 172 | seperation.backgroundColor = [UIColor whiteColor]; 173 | seperation.alpha = 0.3; 174 | [mainScrollView addSubview:seperation]; 175 | 176 | self.centerContentView = [[UIView alloc] initWithFrame:CGRectMake(self.leftWidth, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; 177 | self.centerContentView.backgroundColor = [UIColor clearColor]; 178 | [mainScrollView addSubview:_centerContentView]; 179 | 180 | self.rightContentView = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH+self.leftWidth, 0, self.rightWidth, SCREEN_HEIGHT)]; 181 | self.rightContentView.backgroundColor = [UIColor clearColor]; 182 | [mainScrollView addSubview:_rightContentView]; 183 | 184 | seperation = [[UILabel alloc] initWithFrame:CGRectMake(self.leftWidth+SCREEN_WIDTH, 0, 0.5, SCREEN_HEIGHT)]; 185 | seperation.backgroundColor = [UIColor whiteColor]; 186 | seperation.alpha = 0.3; 187 | [mainScrollView addSubview:seperation]; 188 | 189 | 190 | mainScrollView.delegate = self; 191 | 192 | [self.view addSubview:mainScrollView]; 193 | 194 | blurredImageView = [[UIImageView alloc] init]; 195 | blurredImageView.image = blurredImage; 196 | blurredImageView.clipsToBounds = YES; 197 | [self.view insertSubview:blurredImageView belowSubview:mainScrollView]; 198 | 199 | blurredOverlayView = [[UIImageView alloc] init]; 200 | blurredOverlayView.backgroundColor = _sideViewTintColor; 201 | blurredOverlayView.alpha = _sideViewAlpha; 202 | [self.view insertSubview:blurredOverlayView belowSubview:mainScrollView]; 203 | 204 | [self closeSideView:NO]; 205 | 206 | } 207 | 208 | #pragma mark - scrollView 209 | 210 | - (void)closeSideView:(BOOL)animated{ 211 | [mainScrollView setContentOffset:CGPointMake(self.leftWidth, 0) animated:animated]; 212 | screenStatus = 0; 213 | } 214 | 215 | - (void)openLeftView:(BOOL)animated{ 216 | [mainScrollView setContentOffset:CGPointMake(0, 0) animated:animated]; 217 | screenStatus = 1; 218 | } 219 | 220 | - (void)openRightView:(BOOL)animated{ 221 | [mainScrollView setContentOffset:CGPointMake(self.rightWidth+self.leftWidth, 0) animated:animated]; 222 | screenStatus = 2; 223 | } 224 | 225 | - (void)arrangeViews:(UIScrollView *)scrollView{ 226 | if (scrollView.contentOffset.xself.leftWidth+self.rightWidth*4/5){ 238 | if (screenStatus == 0) 239 | [self openRightView:YES]; 240 | else if (screenStatus != 2) { 241 | [self closeSideView:YES]; 242 | } 243 | else{ 244 | [self openRightView:YES]; 245 | } 246 | } 247 | else{ 248 | [self closeSideView:YES]; 249 | } 250 | } 251 | 252 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ 253 | //NSLog(@"%f",scrollView.contentOffset.x); 254 | //NSLog(@"%f",SCREEN_WIDTH-LEFT_SIZE); 255 | if ([scrollView isEqual:mainScrollView]){ 256 | if (!decelerate){ 257 | [self arrangeViews:scrollView]; 258 | } 259 | } 260 | } 261 | 262 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ 263 | if ([scrollView isEqual:mainScrollView]) 264 | [self arrangeViews:scrollView]; 265 | } 266 | 267 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ 268 | if ([scrollView isEqual:mainScrollView]){ 269 | if (scrollView.contentOffset.x < self.leftWidth){ 270 | CGRect blurredRect = CGRectMake(0, 0, self.leftWidth-scrollView.contentOffset.x, SCREEN_HEIGHT); 271 | //UIImage *croppedBlurredImage = [blurredImage croppedImage:blurredRect]; 272 | blurredImageView.frame = blurredRect; 273 | blurredImageView.contentMode = UIViewContentModeTopLeft; 274 | blurredOverlayView.frame = blurredImageView.frame; 275 | if (self.dim){ 276 | backgroundView.alpha = DEFAULT_DIM_ALPHA+(1-DEFAULT_DIM_ALPHA)*(1-(self.leftWidth-scrollView.contentOffset.x)/self.leftWidth); 277 | self.centerContentView.alpha = backgroundView.alpha; 278 | } 279 | } 280 | else if (scrollView.contentOffset.x > self.leftWidth){ 281 | CGRect blurredRect = CGRectMake(SCREEN_WIDTH - (scrollView.contentOffset.x-self.leftWidth), 0, scrollView.contentOffset.x-self.leftWidth, SCREEN_HEIGHT); 282 | blurredImageView.frame = blurredRect; 283 | blurredImageView.contentMode = UIViewContentModeTopRight; 284 | blurredOverlayView.frame = blurredImageView.frame; 285 | if (self.dim){ 286 | backgroundView.alpha = DEFAULT_DIM_ALPHA+(1-DEFAULT_DIM_ALPHA)*(1-(scrollView.contentOffset.x-self.leftWidth)/self.rightWidth); 287 | self.centerContentView.alpha = backgroundView.alpha; 288 | } 289 | } 290 | 291 | } 292 | } 293 | 294 | @end 295 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/RNBlurredSideViewControllerExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.zzuumm.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIViewControllerBasedStatusBarAppearance 30 | 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/RNBlurredSideViewControllerExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // RNBlurredSideViewControllerExample 4 | // 5 | // Created by Wenbo Shi on 2/12/14. 6 | // Copyright (c) 2014 Zzuumm. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "RNBlurredSideViewController.h" 11 | 12 | @interface ViewController : RNBlurredSideViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // RNBlurredSideViewControllerExample 4 | // 5 | // Created by Wenbo Shi on 2/12/14. 6 | // Copyright (c) 2014 Zzuumm. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController{ 16 | UITableView *leftTableView; 17 | UITableView *rightTableView; 18 | } 19 | 20 | - (id)initWithCoder:(NSCoder*)aDecoder 21 | { 22 | if(self = [super initWithCoder:aDecoder]) 23 | { 24 | // Do something 25 | self.backgroundImage = [UIImage imageNamed:@"bkg.jpg"]; 26 | //self.leftWidth = 250; 27 | //self.rightWidth = 250; 28 | //self.sideViewTintColor = [UIColor whiteColor]; 29 | //self.sideViewAlpha = 0.2; 30 | 31 | } 32 | return self; 33 | } 34 | 35 | - (void)viewDidLoad 36 | { 37 | [super viewDidLoad]; 38 | // Do any additional setup after loading the view, typically from a nib. 39 | 40 | leftTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, self.leftContentView.frame.size.width, self.leftContentView.frame.size.height-20)]; 41 | leftTableView.backgroundColor = [UIColor clearColor]; 42 | leftTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 43 | leftTableView.dataSource = self; 44 | leftTableView.delegate = self; 45 | [self.leftContentView addSubview:leftTableView]; 46 | 47 | rightTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, self.rightContentView.frame.size.width, self.rightContentView.frame.size.height-20)]; 48 | rightTableView.backgroundColor = [UIColor clearColor]; 49 | rightTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 50 | rightTableView.dataSource = self; 51 | rightTableView.delegate = self; 52 | [self.rightContentView addSubview:rightTableView]; 53 | } 54 | 55 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 56 | return 5; 57 | } 58 | 59 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 60 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 61 | 62 | if (cell == nil){ 63 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 64 | cell.backgroundColor = [UIColor clearColor]; 65 | cell.textLabel.textColor = [UIColor whiteColor]; 66 | } 67 | 68 | cell.textLabel.text = @"Item"; 69 | 70 | return cell; 71 | } 72 | 73 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 74 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 75 | [self closeSideView:YES]; 76 | } 77 | 78 | - (void)didReceiveMemoryWarning 79 | { 80 | [super didReceiveMemoryWarning]; 81 | // Dispose of any resources that can be recreated. 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/bkg@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwenboshi/RNBlurredSideViewController/efbe8ff7b07230bf18c0b9df80f57b6b6b53b2c8/Example/RNBlurredSideViewControllerExample/bkg@2x.jpg -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RNBlurredSideViewControllerExample 4 | // 5 | // Created by Wenbo Shi on 2/12/14. 6 | // Copyright (c) 2014 Zzuumm. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExampleTests/RNBlurredSideViewControllerExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.zzuumm.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExampleTests/RNBlurredSideViewControllerExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // RNBlurredSideViewControllerExampleTests.m 3 | // RNBlurredSideViewControllerExampleTests 4 | // 5 | // Created by Wenbo Shi on 2/12/14. 6 | // Copyright (c) 2014 Zzuumm. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RNBlurredSideViewControllerExampleTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation RNBlurredSideViewControllerExampleTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Example/RNBlurredSideViewControllerExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Wenbo Shi 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RNBlurredSideViewController 2 | 3 | RNBlurredSideViewController is a side view controller with a dynamic blurred background effect when swiping similar to the iOS 7 control center. It can be used to show views on the side like the Facebook or Path app. The unique feature of RNBlurredSideViewController is that it can blur the side view background dynamically when swiping which is similar to the iOS 7 control center. The implementation of the blur effect is not based on UIToolbar. The blur effect can be customized. 4 | 5 | ![](http://i57.tinypic.com/j7c9zk.png) 6 | ![](http://i58.tinypic.com/23ubl1t.png) 7 | ![](http://i60.tinypic.com/2ibdlkj.png) 8 | 9 | ## Usage 10 | 11 | Subclass RNBlurredSideViewController 12 | ``` 13 | @interface ViewController : RNBlurredSideViewController 14 | ``` 15 | Set the backgroundImage and other parameters in the init method of the viewController 16 | ``` 17 | - (id)initWithCoder:(NSCoder*)aDecoder 18 | { 19 | if(self = [super initWithCoder:aDecoder]) 20 | { 21 | // Do something 22 | self.backgroundImage = [UIImage imageNamed:@"bkg.jpg"]; 23 | self.leftWidth = 250; 24 | self.rightWidth = 250; 25 | self.sideViewTintColor = [UIColor whiteColor]; 26 | self.sideViewAlpha = 0.2; 27 | 28 | } 29 | return self; 30 | } 31 | ``` 32 | 33 | Add your views to self.leftContentView, self.centerContentView, and self.rightContentView 34 | ``` 35 | - (void)viewDidLoad 36 | { 37 | [super viewDidLoad]; 38 | // Do any additional setup after loading the view, typically from a nib. 39 | 40 | leftTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, self.leftContentView.frame.size.width, self.leftContentView.frame.size.height-20)]; 41 | leftTableView.backgroundColor = [UIColor clearColor]; 42 | leftTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 43 | leftTableView.dataSource = self; 44 | leftTableView.delegate = self; 45 | [self.leftContentView addSubview:leftTableView]; 46 | 47 | rightTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, self.rightContentView.frame.size.width, self.rightContentView.frame.size.height-20)]; 48 | rightTableView.backgroundColor = [UIColor clearColor]; 49 | rightTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 50 | rightTableView.dataSource = self; 51 | rightTableView.delegate = self; 52 | [self.rightContentView addSubview:rightTableView]; 53 | 54 | } 55 | ``` 56 | 57 | ## Properties 58 | 59 | The width of the left side view. Set it to 0 if there is no left view. 60 | ``` 61 | @property (nonatomic, assign) CGFloat leftWidth; 62 | ``` 63 | 64 | The width of the right side view. Set it to 0 if there is no right view. 65 | ``` 66 | @property (nonatomic, assign) CGFloat rightWidth; 67 | ``` 68 | 69 | The layer alpha of the side views. 70 | ``` 71 | @property (nonatomic, assign) CGFloat sideViewAlpha; 72 | ``` 73 | 74 | The tint color of the side views. 75 | ``` 76 | @property (nonatomic, retain) UIColor *sideViewTintColor; 77 | ``` 78 | 79 | The background image. 80 | ``` 81 | @property (nonatomic, retain) UIImage *backgroundImage; 82 | ``` 83 | 84 | The container view of the left side view. 85 | ``` 86 | @property (nonatomic, retain) UIView *leftContentView; 87 | ``` 88 | 89 | The container view of the center view. 90 | ``` 91 | @property (nonatomic, retain) UIView *centerContentView; 92 | ``` 93 | 94 | The container view of the right side view. 95 | ``` 96 | @property (nonatomic, retain) UIView *rightContentView; 97 | ``` 98 | 99 | Dim the background when swiping. Default is YES. 100 | ``` 101 | @property (nonatomic, assign) BOOL dim; 102 | ``` 103 | 104 | ## Requirements 105 | 106 | iOS>=6.0 (Example project is built with iOS 7) 107 | 108 | 109 | Accelerate Framework 110 | 111 | ## Installation 112 | 113 | RNBlurredSideViewController is available through [CocoaPods](http://cocoapods.org), to install 114 | it simply add the following line to your Podfile: 115 | 116 | pod "RNBlurredSideViewController" 117 | 118 | You can also drag the class files into your project and add the Accelerate framework. 119 | 120 | ## Supported Orientation 121 | 122 | RNBlurredSideViewController currently does not support horizontal orientation. But you can easily modify the code to support it. 123 | 124 | ## Author 125 | 126 | Wenbo Shi, cwenboshi@gmail.com 127 | 128 | ## License 129 | 130 | RNBlurredSideViewController is available under the MIT license. See the LICENSE file for more info. 131 | 132 | -------------------------------------------------------------------------------- /RNBlurredSideViewController.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = "RNBlurredSideViewController" 4 | s.version = "1.0.1" 5 | s.summary = "A side view controller with a dynamic blurred background effect which is similar to the iOS 7 control center." 6 | s.homepage = 'https://github.com/cwenboshi/RNBlurredSideViewController' 7 | s.license = 'MIT' 8 | s.author = { "Wenbo Shi" => "cwenboshi@gmail.com" } 9 | s.source = { :git => "https://github.com/cwenboshi/RNBlurredSideViewController.git", :tag => s.version.to_s } 10 | s.platform = :ios, '6.0' 11 | s.ios.deployment_target = '6.0' 12 | s.requires_arc = true 13 | s.source_files = 'Classes' 14 | s.frameworks = 'QuartzCore', 'Accelerate' 15 | end 16 | -------------------------------------------------------------------------------- /Screenshots/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwenboshi/RNBlurredSideViewController/efbe8ff7b07230bf18c0b9df80f57b6b6b53b2c8/Screenshots/screenshot1.png -------------------------------------------------------------------------------- /Screenshots/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwenboshi/RNBlurredSideViewController/efbe8ff7b07230bf18c0b9df80f57b6b6b53b2c8/Screenshots/screenshot2.png -------------------------------------------------------------------------------- /Screenshots/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwenboshi/RNBlurredSideViewController/efbe8ff7b07230bf18c0b9df80f57b6b6b53b2c8/Screenshots/screenshot3.png --------------------------------------------------------------------------------