├── .gitignore ├── BTGlassScrollView ├── BTGlassScrollView.h ├── BTGlassScrollView.m ├── UIImage+ImageEffects.h └── UIImage+ImageEffects.m ├── BTGlassScrollViewExample ├── BTGlassScrollViewExample.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ └── BTGlassScrollViewExample.xccheckout │ │ └── xcuserdata │ │ └── Byte.xcuserdatad │ │ └── WorkspaceSettings.xcsettings ├── BTGlassScrollViewExample │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── BTGlassScrollViewExample-Info.plist │ ├── BTGlassScrollViewExample-Prefix.pch │ ├── FirstViewController.h │ ├── FirstViewController.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── background.imageset │ │ │ ├── Contents.json │ │ │ └── Image.png │ │ ├── background2.imageset │ │ │ ├── Contents.json │ │ │ └── Image.png │ │ └── background3.imageset │ │ │ ├── Contents.json │ │ │ └── landscapes-sea_00343155.png │ ├── ViewController.h │ ├── ViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── BTGlassScrollViewExampleTests │ ├── BTGlassScrollViewExampleTests-Info.plist │ ├── BTGlassScrollViewExampleTests.m │ └── en.lproj │ └── InfoPlist.strings ├── BTGlassScrollViewExample2 ├── BTGlassScrollViewExample2.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── BTGlassScrollViewExample2.xccheckout ├── BTGlassScrollViewExample2 │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── BTGlassScrollViewController.h │ ├── BTGlassScrollViewController.m │ ├── BTGlassScrollViewExample2-Info.plist │ ├── BTGlassScrollViewExample2-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── background.imageset │ │ │ ├── Contents.json │ │ │ └── Image.png │ │ ├── background2.imageset │ │ │ ├── Contents.json │ │ │ └── Image.png │ │ └── background3.imageset │ │ │ ├── Contents.json │ │ │ └── landscapes-sea_00343155.png │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── BTGlassScrollViewExample2Tests │ ├── BTGlassScrollViewExample2Tests-Info.plist │ ├── BTGlassScrollViewExample2Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── Gifs ├── Horizontal.gif └── Vertical.gif └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.xcuserstate -------------------------------------------------------------------------------- /BTGlassScrollView/BTGlassScrollView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BTGlassScrollView.h 3 | // BTGlassScrollViewExample 4 | // 5 | // Created by Byte on 10/18/13. 6 | // Copyright (c) 2013 Byte. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIImage+ImageEffects.h" 11 | 12 | //default blur settings 13 | #define DEFAULT_BLUR_RADIUS 14 14 | #define DEFAULT_BLUR_TINT_COLOR [UIColor colorWithWhite:0 alpha:.3] 15 | #define DEFAULT_BLUR_DELTA_FACTOR 1.4 16 | 17 | //how much the background moves when scroll 18 | #define DEFAULT_MAX_BACKGROUND_MOVEMENT_VERTICAL 30 19 | #define DEFAULT_MAX_BACKGROUND_MOVEMENT_HORIZONTAL 150 20 | 21 | 22 | //the value of the fading space on the top between the view and navigation bar 23 | #define DEFAULT_TOP_FADING_HEIGHT_HALF 10 24 | 25 | @protocol BTGlassScrollViewDelegate; 26 | 27 | @interface BTGlassScrollView : UIView 28 | //width = 640 + 2 * DEFAULT_MAX_BACKGROUND_MOVEMENT_VERTICAL 29 | //height = 1136 + DEFAULT_MAX_BACKGROUND_MOVEMENT_VERTICAL 30 | @property (nonatomic, strong) UIImage *backgroundImage; 31 | @property (nonatomic, strong) UIImage *blurredBackgroundImage;//default blurred is provided, thus nil is acceptable 32 | @property (nonatomic, assign) CGFloat viewDistanceFromBottom;//how much view is showed up from the bottom 33 | @property (nonatomic, strong) UIView *foregroundView;//the view that will contain all the info 34 | @property (nonatomic, assign) CGFloat topLayoutGuideLength;//set this only when using navigation bar of sorts. 35 | @property (nonatomic, strong, readonly) UIScrollView *foregroundScrollView;//readonly just to get the scroll offsets 36 | @property (nonatomic, weak) id delegate; 37 | 38 | - (id)initWithFrame:(CGRect)frame BackgroundImage:(UIImage *)backgroundImage blurredImage:(UIImage *)blurredImage viewDistanceFromBottom:(CGFloat)viewDistanceFromBottom foregroundView:(UIView *)foregroundView; 39 | - (void)scrollHorizontalRatio:(CGFloat)ratio;//from -1 to 1 40 | - (void)scrollVerticallyToOffset:(CGFloat)offsetY; 41 | // change background image on the go 42 | - (void)setBackgroundImage:(UIImage *)backgroundImage overWriteBlur:(BOOL)overWriteBlur animated:(BOOL)animated duration:(NSTimeInterval)interval; 43 | - (void)blurBackground:(BOOL)shouldBlur; 44 | @end 45 | 46 | 47 | @protocol BTGlassScrollViewDelegate 48 | @optional 49 | //use this to configure your foregroundView when the frame of the whole view changed 50 | - (void)glassScrollView:(BTGlassScrollView *)glassScrollView didChangedToFrame:(CGRect)frame; 51 | //make custom blur without messing with default settings 52 | - (UIImage*)glassScrollView:(BTGlassScrollView *)glassScrollView blurForImage:(UIImage *)image; 53 | @end -------------------------------------------------------------------------------- /BTGlassScrollView/BTGlassScrollView.m: -------------------------------------------------------------------------------- 1 | // 2 | // BTGlassScrollView.m 3 | // BTGlassScrollViewExample 4 | // 5 | // Created by Byte on 10/18/13. 6 | // Copyright (c) 2013 Byte. All rights reserved. 7 | // 8 | 9 | #import "BTGlassScrollView.h" 10 | 11 | @implementation BTGlassScrollView 12 | { 13 | UIScrollView *_backgroundScrollView; 14 | UIView *_constraitView; // for autolayout 15 | UIImageView *_backgroundImageView; 16 | UIImageView *_blurredBackgroundImageView; 17 | 18 | CALayer *_topShadowLayer; 19 | CALayer *_botShadowLayer; 20 | 21 | UIView *_foregroundContainerView; // for masking 22 | UIImageView *_topMaskImageView; 23 | } 24 | 25 | 26 | - (id)initWithFrame:(CGRect)frame BackgroundImage:(UIImage *)backgroundImage blurredImage:(UIImage *)blurredImage viewDistanceFromBottom:(CGFloat)viewDistanceFromBottom foregroundView:(UIView *)foregroundView 27 | { 28 | self = [super initWithFrame:frame]; 29 | if (self) { 30 | //initialize values 31 | _backgroundImage = backgroundImage; 32 | if (blurredImage) { 33 | _blurredBackgroundImage = blurredImage; 34 | }else{ 35 | if ([_delegate respondsToSelector:@selector(glassScrollView:blurForImage:)]) { 36 | _blurredBackgroundImage = [_delegate glassScrollView:self blurForImage:_backgroundImage]; 37 | } else { 38 | _blurredBackgroundImage = [backgroundImage applyBlurWithRadius:DEFAULT_BLUR_RADIUS tintColor:DEFAULT_BLUR_TINT_COLOR saturationDeltaFactor:DEFAULT_BLUR_DELTA_FACTOR maskImage:nil]; 39 | } 40 | } 41 | _viewDistanceFromBottom = viewDistanceFromBottom; 42 | _foregroundView = foregroundView; 43 | 44 | //autoresize 45 | [self setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth]; 46 | 47 | //create views 48 | [self createBackgroundView]; 49 | [self createForegroundView]; 50 | [self createTopShadow]; 51 | [self createBottomShadow]; 52 | } 53 | return self; 54 | } 55 | 56 | #pragma mark - Public Functions 57 | 58 | - (void)scrollHorizontalRatio:(CGFloat)ratio 59 | { 60 | // when the view scroll horizontally, this works the parallax magic 61 | [_backgroundScrollView setContentOffset:CGPointMake(DEFAULT_MAX_BACKGROUND_MOVEMENT_HORIZONTAL + ratio * DEFAULT_MAX_BACKGROUND_MOVEMENT_HORIZONTAL, _backgroundScrollView.contentOffset.y)]; 62 | } 63 | 64 | - (void)scrollVerticallyToOffset:(CGFloat)offsetY 65 | { 66 | [_foregroundScrollView setContentOffset:CGPointMake(_foregroundScrollView.contentOffset.x, offsetY)]; 67 | } 68 | 69 | #pragma mark - Setters 70 | - (void)setFrame:(CGRect)frame 71 | { 72 | [super setFrame:frame]; 73 | //work background 74 | CGRect bounds = CGRectOffset(frame, -frame.origin.x, -frame.origin.y); 75 | 76 | [_backgroundScrollView setFrame:bounds]; 77 | [_backgroundScrollView setContentSize:CGSizeMake(bounds.size.width + 2*DEFAULT_MAX_BACKGROUND_MOVEMENT_HORIZONTAL, self.bounds.size.height + DEFAULT_MAX_BACKGROUND_MOVEMENT_VERTICAL)]; 78 | [_backgroundScrollView setContentOffset:CGPointMake(DEFAULT_MAX_BACKGROUND_MOVEMENT_HORIZONTAL, 0)]; 79 | 80 | [_constraitView setFrame:CGRectMake(0, 0, bounds.size.width + 2*DEFAULT_MAX_BACKGROUND_MOVEMENT_HORIZONTAL, bounds.size.height + DEFAULT_MAX_BACKGROUND_MOVEMENT_VERTICAL)]; 81 | 82 | //foreground 83 | [_foregroundContainerView setFrame:bounds]; 84 | [_foregroundScrollView setFrame:bounds]; 85 | [_foregroundView setFrame:CGRectOffset(_foregroundView.bounds, (_foregroundScrollView.frame.size.width - _foregroundView.bounds.size.width)/2, _foregroundScrollView.frame.size.height - _foregroundScrollView.contentInset.top - _viewDistanceFromBottom)]; 86 | [_foregroundScrollView setContentSize:CGSizeMake(bounds.size.width, _foregroundView.frame.origin.y + _foregroundView.bounds.size.height)]; 87 | 88 | //shadows 89 | //[self createTopShadow]; 90 | [_topShadowLayer setFrame:CGRectMake(0, 0, bounds.size.width, _foregroundScrollView.contentInset.top + DEFAULT_TOP_FADING_HEIGHT_HALF)]; 91 | [_botShadowLayer setFrame:CGRectMake(0, bounds.size.height - _viewDistanceFromBottom, bounds.size.width, bounds.size.height)];//CGRectOffset(_botShadowLayer.bounds, 0, frame.size.height - _viewDistanceFromBottom)]; 92 | 93 | if (_delegate && [_delegate respondsToSelector:@selector(glassScrollView:didChangedToFrame:)]) { 94 | [_delegate glassScrollView:self didChangedToFrame:frame]; 95 | } 96 | } 97 | 98 | - (void)setTopLayoutGuideLength:(CGFloat)topLayoutGuideLength 99 | { 100 | if (topLayoutGuideLength == 0) { 101 | return; 102 | } 103 | 104 | //set inset 105 | [_foregroundScrollView setContentInset:UIEdgeInsetsMake(topLayoutGuideLength, 0, 0, 0)]; 106 | 107 | //reposition 108 | [_foregroundView setFrame:CGRectOffset(_foregroundView.bounds, (_foregroundScrollView.frame.size.width - _foregroundView.bounds.size.width)/2, _foregroundScrollView.frame.size.height - _foregroundScrollView.contentInset.top - _viewDistanceFromBottom)]; 109 | 110 | //resize contentSize 111 | [_foregroundScrollView setContentSize:CGSizeMake(self.frame.size.width, _foregroundView.frame.origin.y + _foregroundView.frame.size.height)]; 112 | 113 | //reset the offset 114 | if (_foregroundScrollView.contentOffset.y == 0) { 115 | [_foregroundScrollView setContentOffset:CGPointMake(0, -_foregroundScrollView.contentInset.top)]; 116 | } 117 | 118 | //adding new mask 119 | _foregroundContainerView.layer.mask = [self createTopMaskWithSize:CGSizeMake(_foregroundContainerView.frame.size.width, _foregroundContainerView.frame.size.height) startFadeAt:_foregroundScrollView.contentInset.top - DEFAULT_TOP_FADING_HEIGHT_HALF endAt:_foregroundScrollView.contentInset.top + DEFAULT_TOP_FADING_HEIGHT_HALF topColor:[UIColor colorWithWhite:1.0 alpha:0.0] botColor:[UIColor colorWithWhite:1.0 alpha:1.0]]; 120 | 121 | //recreate shadow 122 | [self createTopShadow]; 123 | } 124 | 125 | 126 | - (void)setViewDistanceFromBottom:(CGFloat)viewDistanceFromBottom 127 | { 128 | _viewDistanceFromBottom = viewDistanceFromBottom; 129 | 130 | [_foregroundView setFrame:CGRectOffset(_foregroundView.bounds, (_foregroundScrollView.frame.size.width - _foregroundView.bounds.size.width)/2, _foregroundScrollView.frame.size.height - _foregroundScrollView.contentInset.top - _viewDistanceFromBottom)]; 131 | [_foregroundScrollView setContentSize:CGSizeMake(self.frame.size.width, _foregroundView.frame.origin.y + _foregroundView.frame.size.height)]; 132 | 133 | //shadows 134 | [_botShadowLayer setFrame:CGRectOffset(_botShadowLayer.bounds, 0, self.frame.size.height - _viewDistanceFromBottom)]; 135 | } 136 | 137 | - (void)setBackgroundImage:(UIImage *)backgroundImage overWriteBlur:(BOOL)overWriteBlur animated:(BOOL)animated duration:(NSTimeInterval)interval 138 | { 139 | _backgroundImage = backgroundImage; 140 | if (overWriteBlur) { 141 | _blurredBackgroundImage = [backgroundImage applyBlurWithRadius:DEFAULT_BLUR_RADIUS tintColor:DEFAULT_BLUR_TINT_COLOR saturationDeltaFactor:DEFAULT_BLUR_DELTA_FACTOR maskImage:nil]; 142 | } 143 | 144 | if (animated) { 145 | UIImageView *previousBackgroundImageView = _backgroundImageView; 146 | UIImageView *previousBlurredBackgroundImageView = _blurredBackgroundImageView; 147 | [self createBackgroundImageView]; 148 | 149 | [_backgroundImageView setAlpha:0]; 150 | [_blurredBackgroundImageView setAlpha:0]; 151 | 152 | // blur needs to get animated first if the background is blurred 153 | if (previousBlurredBackgroundImageView.alpha == 1) { 154 | [UIView animateWithDuration:interval animations:^{ 155 | [_blurredBackgroundImageView setAlpha:previousBlurredBackgroundImageView.alpha]; 156 | } completion:^(BOOL finished) { 157 | [_backgroundImageView setAlpha:previousBackgroundImageView.alpha]; 158 | [previousBackgroundImageView removeFromSuperview]; 159 | [previousBlurredBackgroundImageView removeFromSuperview]; 160 | }]; 161 | } else { 162 | [UIView animateWithDuration:interval animations:^{ 163 | [_backgroundImageView setAlpha:previousBackgroundImageView.alpha]; 164 | [_blurredBackgroundImageView setAlpha:previousBlurredBackgroundImageView.alpha]; 165 | } completion:^(BOOL finished) { 166 | [previousBackgroundImageView removeFromSuperview]; 167 | [previousBlurredBackgroundImageView removeFromSuperview]; 168 | }]; 169 | } 170 | 171 | 172 | } else { 173 | [_backgroundImageView setImage:_backgroundImage]; 174 | [_blurredBackgroundImageView setImage:_blurredBackgroundImage]; 175 | } 176 | } 177 | 178 | 179 | - (void)blurBackground:(BOOL)shouldBlur 180 | { 181 | [_blurredBackgroundImageView setAlpha:shouldBlur?1:0]; 182 | } 183 | 184 | #pragma mark - Views creation 185 | #pragma mark ScrollViews 186 | 187 | - (void)createBackgroundView 188 | { 189 | //background 190 | _backgroundScrollView = [[UIScrollView alloc] initWithFrame:self.frame]; 191 | [_backgroundScrollView setUserInteractionEnabled:NO]; 192 | [_backgroundScrollView setContentSize:CGSizeMake(self.frame.size.width + 2*DEFAULT_MAX_BACKGROUND_MOVEMENT_HORIZONTAL, self.frame.size.height + DEFAULT_MAX_BACKGROUND_MOVEMENT_VERTICAL)]; 193 | [_backgroundScrollView setContentOffset:CGPointMake(DEFAULT_MAX_BACKGROUND_MOVEMENT_HORIZONTAL, 0)]; 194 | [self addSubview:_backgroundScrollView]; 195 | 196 | _constraitView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width + 2*DEFAULT_MAX_BACKGROUND_MOVEMENT_HORIZONTAL, self.frame.size.height + DEFAULT_MAX_BACKGROUND_MOVEMENT_VERTICAL)]; 197 | [_backgroundScrollView addSubview:_constraitView]; 198 | 199 | [self createBackgroundImageView]; 200 | } 201 | 202 | - (void)createBackgroundImageView 203 | { 204 | _backgroundImageView = [[UIImageView alloc] initWithImage:_backgroundImage]; 205 | [_backgroundImageView setTranslatesAutoresizingMaskIntoConstraints:NO]; 206 | [_backgroundImageView setContentMode:UIViewContentModeScaleAspectFill]; 207 | [_constraitView addSubview:_backgroundImageView]; 208 | _blurredBackgroundImageView = [[UIImageView alloc] initWithImage:_blurredBackgroundImage]; 209 | [_blurredBackgroundImageView setTranslatesAutoresizingMaskIntoConstraints:NO]; 210 | [_blurredBackgroundImageView setContentMode:UIViewContentModeScaleAspectFill]; 211 | [_blurredBackgroundImageView setAlpha:0]; 212 | [_constraitView addSubview:_blurredBackgroundImageView]; 213 | 214 | [_constraitView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_backgroundImageView]|" options:0 metrics:0 views:NSDictionaryOfVariableBindings(_backgroundImageView)]]; 215 | [_constraitView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_backgroundImageView]|" options:0 metrics:0 views:NSDictionaryOfVariableBindings(_backgroundImageView)]]; 216 | [_constraitView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_blurredBackgroundImageView]|" options:0 metrics:0 views:NSDictionaryOfVariableBindings(_blurredBackgroundImageView)]]; 217 | [_constraitView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_blurredBackgroundImageView]|" options:0 metrics:0 views:NSDictionaryOfVariableBindings(_blurredBackgroundImageView)]]; 218 | } 219 | 220 | 221 | - (void)createForegroundView 222 | { 223 | _foregroundContainerView = [[UIView alloc] initWithFrame:self.frame]; 224 | [self addSubview:_foregroundContainerView]; 225 | 226 | _foregroundScrollView = [[UIScrollView alloc] initWithFrame:self.frame]; 227 | [_foregroundScrollView setDelegate:self]; 228 | [_foregroundScrollView setShowsVerticalScrollIndicator:NO]; 229 | [_foregroundScrollView setShowsHorizontalScrollIndicator:NO]; 230 | [_foregroundContainerView addSubview:_foregroundScrollView]; 231 | 232 | UITapGestureRecognizer *_tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(foregroundTapped:)]; 233 | [_foregroundScrollView addGestureRecognizer:_tapRecognizer]; 234 | 235 | 236 | [_foregroundView setFrame:CGRectOffset(_foregroundView.bounds, (_foregroundScrollView.frame.size.width - _foregroundView.bounds.size.width)/2, _foregroundScrollView.frame.size.height - _viewDistanceFromBottom)]; 237 | [_foregroundScrollView addSubview:_foregroundView]; 238 | 239 | [_foregroundScrollView setContentSize:CGSizeMake(self.frame.size.width, _foregroundView.frame.origin.y + _foregroundView.frame.size.height)]; 240 | } 241 | 242 | #pragma mark Shadow and Mask Layer 243 | - (CALayer *)createTopMaskWithSize:(CGSize)size startFadeAt:(CGFloat)top endAt:(CGFloat)bottom topColor:(UIColor *)topColor botColor:(UIColor *)botColor; 244 | { 245 | top = top/size.height; 246 | bottom = bottom/size.height; 247 | 248 | CAGradientLayer *maskLayer = [CAGradientLayer layer]; 249 | maskLayer.anchorPoint = CGPointZero; 250 | maskLayer.startPoint = CGPointMake(0.5f, 0.0f); 251 | maskLayer.endPoint = CGPointMake(0.5f, 1.0f); 252 | 253 | //an array of colors that dictatates the gradient(s) 254 | maskLayer.colors = @[(id)topColor.CGColor, (id)topColor.CGColor, (id)botColor.CGColor, (id)botColor.CGColor]; 255 | maskLayer.locations = @[@0.0, @(top), @(bottom), @1.0f]; 256 | maskLayer.frame = CGRectMake(0, 0, size.width, size.height); 257 | 258 | return maskLayer; 259 | } 260 | 261 | - (void)createTopShadow 262 | { 263 | //changing the top shadow 264 | [_topShadowLayer removeFromSuperlayer]; 265 | _topShadowLayer = [self createTopMaskWithSize:CGSizeMake(_foregroundContainerView.frame.size.width, _foregroundScrollView.contentInset.top + DEFAULT_TOP_FADING_HEIGHT_HALF) startFadeAt:_foregroundScrollView.contentInset.top - DEFAULT_TOP_FADING_HEIGHT_HALF endAt:_foregroundScrollView.contentInset.top + DEFAULT_TOP_FADING_HEIGHT_HALF topColor:[UIColor colorWithWhite:0 alpha:.15] botColor:[UIColor colorWithWhite:0 alpha:0]]; 266 | [self.layer insertSublayer:_topShadowLayer below:_foregroundContainerView.layer]; 267 | } 268 | - (void)createBottomShadow 269 | { 270 | [_botShadowLayer removeFromSuperlayer]; 271 | _botShadowLayer = [self createTopMaskWithSize:CGSizeMake(self.frame.size.width,_viewDistanceFromBottom) startFadeAt:0 endAt:_viewDistanceFromBottom topColor:[UIColor colorWithWhite:0 alpha:0] botColor:[UIColor colorWithWhite:0 alpha:.8]]; 272 | [_botShadowLayer setFrame:CGRectOffset(_botShadowLayer.bounds, 0, self.frame.size.height - _viewDistanceFromBottom)]; 273 | [self.layer insertSublayer:_botShadowLayer below:_foregroundContainerView.layer]; 274 | } 275 | 276 | 277 | #pragma mark - Button 278 | - (void)foregroundTapped:(UITapGestureRecognizer *)tapRecognizer 279 | { 280 | CGPoint tappedPoint = [tapRecognizer locationInView:_foregroundScrollView]; 281 | if (tappedPoint.y < _foregroundScrollView.frame.size.height) { 282 | CGFloat ratio = _foregroundScrollView.contentOffset.y == -_foregroundScrollView.contentInset.top? 1:0; 283 | [_foregroundScrollView setContentOffset:CGPointMake(0, ratio * _foregroundView.frame.origin.y - _foregroundScrollView.contentInset.top) animated:YES]; 284 | } 285 | } 286 | 287 | #pragma mark - Delegate 288 | #pragma mark UIScrollView 289 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 290 | { 291 | //translate into ratio to height 292 | CGFloat ratio = (scrollView.contentOffset.y + _foregroundScrollView.contentInset.top)/(_foregroundScrollView.frame.size.height - _foregroundScrollView.contentInset.top - _viewDistanceFromBottom); 293 | ratio = ratio<0?0:ratio; 294 | ratio = ratio>1?1:ratio; 295 | 296 | //set background scroll 297 | [_backgroundScrollView setContentOffset:CGPointMake(DEFAULT_MAX_BACKGROUND_MOVEMENT_HORIZONTAL, ratio * DEFAULT_MAX_BACKGROUND_MOVEMENT_VERTICAL)]; 298 | 299 | //set alpha 300 | [_blurredBackgroundImageView setAlpha:ratio]; 301 | } 302 | 303 | - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset 304 | { 305 | 306 | CGPoint point = *targetContentOffset; 307 | CGFloat ratio = (point.y + _foregroundScrollView.contentInset.top)/(_foregroundScrollView.frame.size.height - _foregroundScrollView.contentInset.top - _viewDistanceFromBottom); 308 | 309 | //it cannot be inbetween 0 to 1 so if it is >.5 it is one, otherwise 0 310 | if (ratio > 0 && ratio < 1) { 311 | if (velocity.y == 0) { 312 | ratio = ratio > .5?1:0; 313 | }else if(velocity.y > 0){ 314 | ratio = ratio > .1?1:0; 315 | }else{ 316 | ratio = ratio > .9?1:0; 317 | } 318 | targetContentOffset->y = ratio * _foregroundView.frame.origin.y - _foregroundScrollView.contentInset.top; 319 | } 320 | 321 | } 322 | @end 323 | -------------------------------------------------------------------------------- /BTGlassScrollView/UIImage+ImageEffects.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: UIImage+ImageEffects.h 3 | Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur. 4 | Version: 1.0 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2013 Apple Inc. All Rights Reserved. 45 | 46 | 47 | Copyright © 2013 Apple Inc. All rights reserved. 48 | WWDC 2013 License 49 | 50 | NOTE: This Apple Software was supplied by Apple as part of a WWDC 2013 51 | Session. Please refer to the applicable WWDC 2013 Session for further 52 | information. 53 | 54 | IMPORTANT: This Apple software is supplied to you by Apple Inc. 55 | ("Apple") in consideration of your agreement to the following terms, and 56 | your use, installation, modification or redistribution of this Apple 57 | software constitutes acceptance of these terms. If you do not agree with 58 | these terms, please do not use, install, modify or redistribute this 59 | Apple software. 60 | 61 | In consideration of your agreement to abide by the following terms, and 62 | subject to these terms, Apple grants you a non-exclusive license, under 63 | Apple's copyrights in this original Apple software (the "Apple 64 | Software"), to use, reproduce, modify and redistribute the Apple 65 | Software, with or without modifications, in source and/or binary forms; 66 | provided that if you redistribute the Apple Software in its entirety and 67 | without modifications, you must retain this notice and the following 68 | text and disclaimers in all such redistributions of the Apple Software. 69 | Neither the name, trademarks, service marks or logos of Apple Inc. may 70 | be used to endorse or promote products derived from the Apple Software 71 | without specific prior written permission from Apple. Except as 72 | expressly stated in this notice, no other rights or licenses, express or 73 | implied, are granted by Apple herein, including but not limited to any 74 | patent rights that may be infringed by your derivative works or by other 75 | works in which the Apple Software may be incorporated. 76 | 77 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES 78 | NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 79 | IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR 80 | A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 81 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 82 | 83 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 84 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 85 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 86 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 87 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 88 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 89 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 90 | POSSIBILITY OF SUCH DAMAGE. 91 | 92 | EA1002 93 | 5/3/2013 94 | */ 95 | 96 | @import UIKit; 97 | 98 | @interface UIImage (ImageEffects) 99 | 100 | - (UIImage *)applyLightEffect; 101 | - (UIImage *)applyExtraLightEffect; 102 | - (UIImage *)applyDarkEffect; 103 | - (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor; 104 | 105 | - (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage; 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /BTGlassScrollView/UIImage+ImageEffects.m: -------------------------------------------------------------------------------- 1 | /* 2 | File: UIImage+ImageEffects.m 3 | Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur. 4 | Version: 1.0 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2013 Apple Inc. All Rights Reserved. 45 | 46 | 47 | Copyright © 2013 Apple Inc. All rights reserved. 48 | WWDC 2013 License 49 | 50 | NOTE: This Apple Software was supplied by Apple as part of a WWDC 2013 51 | Session. Please refer to the applicable WWDC 2013 Session for further 52 | information. 53 | 54 | IMPORTANT: This Apple software is supplied to you by Apple Inc. 55 | ("Apple") in consideration of your agreement to the following terms, and 56 | your use, installation, modification or redistribution of this Apple 57 | software constitutes acceptance of these terms. If you do not agree with 58 | these terms, please do not use, install, modify or redistribute this 59 | Apple software. 60 | 61 | In consideration of your agreement to abide by the following terms, and 62 | subject to these terms, Apple grants you a non-exclusive license, under 63 | Apple's copyrights in this original Apple software (the "Apple 64 | Software"), to use, reproduce, modify and redistribute the Apple 65 | Software, with or without modifications, in source and/or binary forms; 66 | provided that if you redistribute the Apple Software in its entirety and 67 | without modifications, you must retain this notice and the following 68 | text and disclaimers in all such redistributions of the Apple Software. 69 | Neither the name, trademarks, service marks or logos of Apple Inc. may 70 | be used to endorse or promote products derived from the Apple Software 71 | without specific prior written permission from Apple. Except as 72 | expressly stated in this notice, no other rights or licenses, express or 73 | implied, are granted by Apple herein, including but not limited to any 74 | patent rights that may be infringed by your derivative works or by other 75 | works in which the Apple Software may be incorporated. 76 | 77 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES 78 | NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 79 | IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR 80 | A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 81 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 82 | 83 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 84 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 85 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 86 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 87 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 88 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 89 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 90 | POSSIBILITY OF SUCH DAMAGE. 91 | 92 | EA1002 93 | 5/3/2013 94 | */ 95 | 96 | #import "UIImage+ImageEffects.h" 97 | 98 | @import Accelerate; 99 | #import 100 | 101 | 102 | @implementation UIImage (ImageEffects) 103 | 104 | 105 | - (UIImage *)applyLightEffect 106 | { 107 | UIColor *tintColor = [UIColor colorWithWhite:1.0 alpha:0.3]; 108 | return [self applyBlurWithRadius:30 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 109 | } 110 | 111 | 112 | - (UIImage *)applyExtraLightEffect 113 | { 114 | UIColor *tintColor = [UIColor colorWithWhite:0.97 alpha:0.82]; 115 | return [self applyBlurWithRadius:20 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 116 | } 117 | 118 | 119 | - (UIImage *)applyDarkEffect 120 | { 121 | UIColor *tintColor = [UIColor colorWithWhite:0.11 alpha:0.73]; 122 | return [self applyBlurWithRadius:20 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 123 | } 124 | 125 | 126 | - (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor 127 | { 128 | const CGFloat EffectColorAlpha = 0.6; 129 | UIColor *effectColor = tintColor; 130 | int componentCount = CGColorGetNumberOfComponents(tintColor.CGColor); 131 | if (componentCount == 2) { 132 | CGFloat b; 133 | if ([tintColor getWhite:&b alpha:NULL]) { 134 | effectColor = [UIColor colorWithWhite:b alpha:EffectColorAlpha]; 135 | } 136 | } 137 | else { 138 | CGFloat r, g, b; 139 | if ([tintColor getRed:&r green:&g blue:&b alpha:NULL]) { 140 | effectColor = [UIColor colorWithRed:r green:g blue:b alpha:EffectColorAlpha]; 141 | } 142 | } 143 | return [self applyBlurWithRadius:10 tintColor:effectColor saturationDeltaFactor:-1.0 maskImage:nil]; 144 | } 145 | 146 | 147 | - (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage 148 | { 149 | // Check pre-conditions. 150 | if (self.size.width < 1 || self.size.height < 1) { 151 | NSLog (@"*** error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self); 152 | return nil; 153 | } 154 | if (!self.CGImage) { 155 | NSLog (@"*** error: image must be backed by a CGImage: %@", self); 156 | return nil; 157 | } 158 | if (maskImage && !maskImage.CGImage) { 159 | NSLog (@"*** error: maskImage must be backed by a CGImage: %@", maskImage); 160 | return nil; 161 | } 162 | 163 | CGRect imageRect = { CGPointZero, self.size }; 164 | UIImage *effectImage = self; 165 | 166 | BOOL hasBlur = blurRadius > __FLT_EPSILON__; 167 | BOOL hasSaturationChange = fabs(saturationDeltaFactor - 1.) > __FLT_EPSILON__; 168 | if (hasBlur || hasSaturationChange) { 169 | UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); 170 | CGContextRef effectInContext = UIGraphicsGetCurrentContext(); 171 | CGContextScaleCTM(effectInContext, 1.0, -1.0); 172 | CGContextTranslateCTM(effectInContext, 0, -self.size.height); 173 | CGContextDrawImage(effectInContext, imageRect, self.CGImage); 174 | 175 | vImage_Buffer effectInBuffer; 176 | effectInBuffer.data = CGBitmapContextGetData(effectInContext); 177 | effectInBuffer.width = CGBitmapContextGetWidth(effectInContext); 178 | effectInBuffer.height = CGBitmapContextGetHeight(effectInContext); 179 | effectInBuffer.rowBytes = CGBitmapContextGetBytesPerRow(effectInContext); 180 | 181 | UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); 182 | CGContextRef effectOutContext = UIGraphicsGetCurrentContext(); 183 | vImage_Buffer effectOutBuffer; 184 | effectOutBuffer.data = CGBitmapContextGetData(effectOutContext); 185 | effectOutBuffer.width = CGBitmapContextGetWidth(effectOutContext); 186 | effectOutBuffer.height = CGBitmapContextGetHeight(effectOutContext); 187 | effectOutBuffer.rowBytes = CGBitmapContextGetBytesPerRow(effectOutContext); 188 | 189 | if (hasBlur) { 190 | // A description of how to compute the box kernel width from the Gaussian 191 | // radius (aka standard deviation) appears in the SVG spec: 192 | // http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement 193 | // 194 | // For larger values of 's' (s >= 2.0), an approximation can be used: Three 195 | // successive box-blurs build a piece-wise quadratic convolution kernel, which 196 | // approximates the Gaussian kernel to within roughly 3%. 197 | // 198 | // let d = floor(s * 3*sqrt(2*pi)/4 + 0.5) 199 | // 200 | // ... if d is odd, use three box-blurs of size 'd', centered on the output pixel. 201 | // 202 | CGFloat inputRadius = blurRadius * [[UIScreen mainScreen] scale]; 203 | NSUInteger radius = floor(inputRadius * 3. * sqrt(2 * M_PI) / 4 + 0.5); 204 | if (radius % 2 != 1) { 205 | radius += 1; // force radius to be odd so that the three box-blur methodology works. 206 | } 207 | vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend); 208 | vImageBoxConvolve_ARGB8888(&effectOutBuffer, &effectInBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend); 209 | vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend); 210 | } 211 | BOOL effectImageBuffersAreSwapped = NO; 212 | if (hasSaturationChange) { 213 | CGFloat s = saturationDeltaFactor; 214 | CGFloat floatingPointSaturationMatrix[] = { 215 | 0.0722 + 0.9278 * s, 0.0722 - 0.0722 * s, 0.0722 - 0.0722 * s, 0, 216 | 0.7152 - 0.7152 * s, 0.7152 + 0.2848 * s, 0.7152 - 0.7152 * s, 0, 217 | 0.2126 - 0.2126 * s, 0.2126 - 0.2126 * s, 0.2126 + 0.7873 * s, 0, 218 | 0, 0, 0, 1, 219 | }; 220 | const int32_t divisor = 256; 221 | NSUInteger matrixSize = sizeof(floatingPointSaturationMatrix)/sizeof(floatingPointSaturationMatrix[0]); 222 | int16_t saturationMatrix[matrixSize]; 223 | for (NSUInteger i = 0; i < matrixSize; ++i) { 224 | saturationMatrix[i] = (int16_t)roundf(floatingPointSaturationMatrix[i] * divisor); 225 | } 226 | if (hasBlur) { 227 | vImageMatrixMultiply_ARGB8888(&effectOutBuffer, &effectInBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags); 228 | effectImageBuffersAreSwapped = YES; 229 | } 230 | else { 231 | vImageMatrixMultiply_ARGB8888(&effectInBuffer, &effectOutBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags); 232 | } 233 | } 234 | if (!effectImageBuffersAreSwapped) 235 | effectImage = UIGraphicsGetImageFromCurrentImageContext(); 236 | UIGraphicsEndImageContext(); 237 | 238 | if (effectImageBuffersAreSwapped) 239 | effectImage = UIGraphicsGetImageFromCurrentImageContext(); 240 | UIGraphicsEndImageContext(); 241 | } 242 | 243 | // Set up output context. 244 | UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); 245 | CGContextRef outputContext = UIGraphicsGetCurrentContext(); 246 | CGContextScaleCTM(outputContext, 1.0, -1.0); 247 | CGContextTranslateCTM(outputContext, 0, -self.size.height); 248 | 249 | // Draw base image. 250 | CGContextDrawImage(outputContext, imageRect, self.CGImage); 251 | 252 | // Draw effect image. 253 | if (hasBlur) { 254 | CGContextSaveGState(outputContext); 255 | if (maskImage) { 256 | CGContextClipToMask(outputContext, imageRect, maskImage.CGImage); 257 | } 258 | CGContextDrawImage(outputContext, imageRect, effectImage.CGImage); 259 | CGContextRestoreGState(outputContext); 260 | } 261 | 262 | // Add in color tint. 263 | if (tintColor) { 264 | CGContextSaveGState(outputContext); 265 | CGContextSetFillColorWithColor(outputContext, tintColor.CGColor); 266 | CGContextFillRect(outputContext, imageRect); 267 | CGContextRestoreGState(outputContext); 268 | } 269 | 270 | // Output image is ready. 271 | UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext(); 272 | UIGraphicsEndImageContext(); 273 | 274 | return outputImage; 275 | } 276 | 277 | 278 | @end 279 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 083047FB1811D7500068CA79 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 083047FA1811D7500068CA79 /* Foundation.framework */; }; 11 | 083047FD1811D7500068CA79 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 083047FC1811D7500068CA79 /* CoreGraphics.framework */; }; 12 | 083047FF1811D7500068CA79 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 083047FE1811D7500068CA79 /* UIKit.framework */; }; 13 | 083048051811D7500068CA79 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 083048031811D7500068CA79 /* InfoPlist.strings */; }; 14 | 083048071811D7500068CA79 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 083048061811D7500068CA79 /* main.m */; }; 15 | 0830480B1811D7500068CA79 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0830480A1811D7500068CA79 /* AppDelegate.m */; }; 16 | 0830480D1811D7500068CA79 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0830480C1811D7500068CA79 /* Images.xcassets */; }; 17 | 083048141811D7500068CA79 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 083048131811D7500068CA79 /* XCTest.framework */; }; 18 | 083048151811D7500068CA79 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 083047FA1811D7500068CA79 /* Foundation.framework */; }; 19 | 083048161811D7500068CA79 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 083047FE1811D7500068CA79 /* UIKit.framework */; }; 20 | 0830481E1811D7500068CA79 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0830481C1811D7500068CA79 /* InfoPlist.strings */; }; 21 | 083048201811D7500068CA79 /* BTGlassScrollViewExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0830481F1811D7500068CA79 /* BTGlassScrollViewExampleTests.m */; }; 22 | 083048381811D7D30068CA79 /* BTGlassScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 083048351811D7D30068CA79 /* BTGlassScrollView.m */; }; 23 | 083048391811D7D30068CA79 /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = 083048371811D7D30068CA79 /* UIImage+ImageEffects.m */; }; 24 | 0830483C1811D7F60068CA79 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0830483B1811D7F60068CA79 /* ViewController.m */; }; 25 | 4C9EDEE51816268400FD2642 /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9EDEE41816268400FD2642 /* FirstViewController.m */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 083048171811D7500068CA79 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 083047EF1811D7500068CA79 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 083047F61811D7500068CA79; 34 | remoteInfo = BTGlassScrollViewExample; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 083047F71811D7500068CA79 /* BTGlassScrollViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BTGlassScrollViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 083047FA1811D7500068CA79 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 41 | 083047FC1811D7500068CA79 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 42 | 083047FE1811D7500068CA79 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 43 | 083048021811D7500068CA79 /* BTGlassScrollViewExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BTGlassScrollViewExample-Info.plist"; sourceTree = ""; }; 44 | 083048041811D7500068CA79 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 45 | 083048061811D7500068CA79 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 46 | 083048081811D7500068CA79 /* BTGlassScrollViewExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BTGlassScrollViewExample-Prefix.pch"; sourceTree = ""; }; 47 | 083048091811D7500068CA79 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 48 | 0830480A1811D7500068CA79 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 49 | 0830480C1811D7500068CA79 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 50 | 083048121811D7500068CA79 /* BTGlassScrollViewExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BTGlassScrollViewExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 083048131811D7500068CA79 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 52 | 0830481B1811D7500068CA79 /* BTGlassScrollViewExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BTGlassScrollViewExampleTests-Info.plist"; sourceTree = ""; }; 53 | 0830481D1811D7500068CA79 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 54 | 0830481F1811D7500068CA79 /* BTGlassScrollViewExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BTGlassScrollViewExampleTests.m; sourceTree = ""; }; 55 | 083048341811D7D30068CA79 /* BTGlassScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTGlassScrollView.h; sourceTree = ""; }; 56 | 083048351811D7D30068CA79 /* BTGlassScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTGlassScrollView.m; sourceTree = ""; }; 57 | 083048361811D7D30068CA79 /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ImageEffects.h"; sourceTree = ""; }; 58 | 083048371811D7D30068CA79 /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ImageEffects.m"; sourceTree = ""; }; 59 | 0830483A1811D7F60068CA79 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 60 | 0830483B1811D7F60068CA79 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 61 | 4C9EDEE31816268400FD2642 /* FirstViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FirstViewController.h; sourceTree = ""; }; 62 | 4C9EDEE41816268400FD2642 /* FirstViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FirstViewController.m; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 083047F41811D7500068CA79 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | 083047FD1811D7500068CA79 /* CoreGraphics.framework in Frameworks */, 71 | 083047FF1811D7500068CA79 /* UIKit.framework in Frameworks */, 72 | 083047FB1811D7500068CA79 /* Foundation.framework in Frameworks */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | 0830480F1811D7500068CA79 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | 083048141811D7500068CA79 /* XCTest.framework in Frameworks */, 81 | 083048161811D7500068CA79 /* UIKit.framework in Frameworks */, 82 | 083048151811D7500068CA79 /* Foundation.framework in Frameworks */, 83 | ); 84 | runOnlyForDeploymentPostprocessing = 0; 85 | }; 86 | /* End PBXFrameworksBuildPhase section */ 87 | 88 | /* Begin PBXGroup section */ 89 | 083047EE1811D7500068CA79 = { 90 | isa = PBXGroup; 91 | children = ( 92 | 083048331811D7D30068CA79 /* BTGlassScrollView */, 93 | 083048001811D7500068CA79 /* BTGlassScrollViewExample */, 94 | 083048191811D7500068CA79 /* BTGlassScrollViewExampleTests */, 95 | 083047F91811D7500068CA79 /* Frameworks */, 96 | 083047F81811D7500068CA79 /* Products */, 97 | ); 98 | sourceTree = ""; 99 | }; 100 | 083047F81811D7500068CA79 /* Products */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 083047F71811D7500068CA79 /* BTGlassScrollViewExample.app */, 104 | 083048121811D7500068CA79 /* BTGlassScrollViewExampleTests.xctest */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | 083047F91811D7500068CA79 /* Frameworks */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 083047FA1811D7500068CA79 /* Foundation.framework */, 113 | 083047FC1811D7500068CA79 /* CoreGraphics.framework */, 114 | 083047FE1811D7500068CA79 /* UIKit.framework */, 115 | 083048131811D7500068CA79 /* XCTest.framework */, 116 | ); 117 | name = Frameworks; 118 | sourceTree = ""; 119 | }; 120 | 083048001811D7500068CA79 /* BTGlassScrollViewExample */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 083048091811D7500068CA79 /* AppDelegate.h */, 124 | 0830480A1811D7500068CA79 /* AppDelegate.m */, 125 | 4C9EDEE31816268400FD2642 /* FirstViewController.h */, 126 | 4C9EDEE41816268400FD2642 /* FirstViewController.m */, 127 | 0830483A1811D7F60068CA79 /* ViewController.h */, 128 | 0830483B1811D7F60068CA79 /* ViewController.m */, 129 | 0830480C1811D7500068CA79 /* Images.xcassets */, 130 | 083048011811D7500068CA79 /* Supporting Files */, 131 | ); 132 | path = BTGlassScrollViewExample; 133 | sourceTree = ""; 134 | }; 135 | 083048011811D7500068CA79 /* Supporting Files */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 083048021811D7500068CA79 /* BTGlassScrollViewExample-Info.plist */, 139 | 083048031811D7500068CA79 /* InfoPlist.strings */, 140 | 083048061811D7500068CA79 /* main.m */, 141 | 083048081811D7500068CA79 /* BTGlassScrollViewExample-Prefix.pch */, 142 | ); 143 | name = "Supporting Files"; 144 | sourceTree = ""; 145 | }; 146 | 083048191811D7500068CA79 /* BTGlassScrollViewExampleTests */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 0830481F1811D7500068CA79 /* BTGlassScrollViewExampleTests.m */, 150 | 0830481A1811D7500068CA79 /* Supporting Files */, 151 | ); 152 | path = BTGlassScrollViewExampleTests; 153 | sourceTree = ""; 154 | }; 155 | 0830481A1811D7500068CA79 /* Supporting Files */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 0830481B1811D7500068CA79 /* BTGlassScrollViewExampleTests-Info.plist */, 159 | 0830481C1811D7500068CA79 /* InfoPlist.strings */, 160 | ); 161 | name = "Supporting Files"; 162 | sourceTree = ""; 163 | }; 164 | 083048331811D7D30068CA79 /* BTGlassScrollView */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 083048341811D7D30068CA79 /* BTGlassScrollView.h */, 168 | 083048351811D7D30068CA79 /* BTGlassScrollView.m */, 169 | 083048361811D7D30068CA79 /* UIImage+ImageEffects.h */, 170 | 083048371811D7D30068CA79 /* UIImage+ImageEffects.m */, 171 | ); 172 | name = BTGlassScrollView; 173 | path = ../BTGlassScrollView; 174 | sourceTree = ""; 175 | }; 176 | /* End PBXGroup section */ 177 | 178 | /* Begin PBXNativeTarget section */ 179 | 083047F61811D7500068CA79 /* BTGlassScrollViewExample */ = { 180 | isa = PBXNativeTarget; 181 | buildConfigurationList = 083048231811D7500068CA79 /* Build configuration list for PBXNativeTarget "BTGlassScrollViewExample" */; 182 | buildPhases = ( 183 | 083047F31811D7500068CA79 /* Sources */, 184 | 083047F41811D7500068CA79 /* Frameworks */, 185 | 083047F51811D7500068CA79 /* Resources */, 186 | ); 187 | buildRules = ( 188 | ); 189 | dependencies = ( 190 | ); 191 | name = BTGlassScrollViewExample; 192 | productName = BTGlassScrollViewExample; 193 | productReference = 083047F71811D7500068CA79 /* BTGlassScrollViewExample.app */; 194 | productType = "com.apple.product-type.application"; 195 | }; 196 | 083048111811D7500068CA79 /* BTGlassScrollViewExampleTests */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = 083048261811D7500068CA79 /* Build configuration list for PBXNativeTarget "BTGlassScrollViewExampleTests" */; 199 | buildPhases = ( 200 | 0830480E1811D7500068CA79 /* Sources */, 201 | 0830480F1811D7500068CA79 /* Frameworks */, 202 | 083048101811D7500068CA79 /* Resources */, 203 | ); 204 | buildRules = ( 205 | ); 206 | dependencies = ( 207 | 083048181811D7500068CA79 /* PBXTargetDependency */, 208 | ); 209 | name = BTGlassScrollViewExampleTests; 210 | productName = BTGlassScrollViewExampleTests; 211 | productReference = 083048121811D7500068CA79 /* BTGlassScrollViewExampleTests.xctest */; 212 | productType = "com.apple.product-type.bundle.unit-test"; 213 | }; 214 | /* End PBXNativeTarget section */ 215 | 216 | /* Begin PBXProject section */ 217 | 083047EF1811D7500068CA79 /* Project object */ = { 218 | isa = PBXProject; 219 | attributes = { 220 | LastUpgradeCheck = 0500; 221 | ORGANIZATIONNAME = Byte; 222 | TargetAttributes = { 223 | 083047F61811D7500068CA79 = { 224 | DevelopmentTeam = G9BS5LA6CZ; 225 | }; 226 | 083048111811D7500068CA79 = { 227 | TestTargetID = 083047F61811D7500068CA79; 228 | }; 229 | }; 230 | }; 231 | buildConfigurationList = 083047F21811D7500068CA79 /* Build configuration list for PBXProject "BTGlassScrollViewExample" */; 232 | compatibilityVersion = "Xcode 3.2"; 233 | developmentRegion = English; 234 | hasScannedForEncodings = 0; 235 | knownRegions = ( 236 | en, 237 | ); 238 | mainGroup = 083047EE1811D7500068CA79; 239 | productRefGroup = 083047F81811D7500068CA79 /* Products */; 240 | projectDirPath = ""; 241 | projectRoot = ""; 242 | targets = ( 243 | 083047F61811D7500068CA79 /* BTGlassScrollViewExample */, 244 | 083048111811D7500068CA79 /* BTGlassScrollViewExampleTests */, 245 | ); 246 | }; 247 | /* End PBXProject section */ 248 | 249 | /* Begin PBXResourcesBuildPhase section */ 250 | 083047F51811D7500068CA79 /* Resources */ = { 251 | isa = PBXResourcesBuildPhase; 252 | buildActionMask = 2147483647; 253 | files = ( 254 | 083048051811D7500068CA79 /* InfoPlist.strings in Resources */, 255 | 0830480D1811D7500068CA79 /* Images.xcassets in Resources */, 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | }; 259 | 083048101811D7500068CA79 /* Resources */ = { 260 | isa = PBXResourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | 0830481E1811D7500068CA79 /* InfoPlist.strings in Resources */, 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | /* End PBXResourcesBuildPhase section */ 268 | 269 | /* Begin PBXSourcesBuildPhase section */ 270 | 083047F31811D7500068CA79 /* Sources */ = { 271 | isa = PBXSourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 083048391811D7D30068CA79 /* UIImage+ImageEffects.m in Sources */, 275 | 4C9EDEE51816268400FD2642 /* FirstViewController.m in Sources */, 276 | 0830480B1811D7500068CA79 /* AppDelegate.m in Sources */, 277 | 083048381811D7D30068CA79 /* BTGlassScrollView.m in Sources */, 278 | 083048071811D7500068CA79 /* main.m in Sources */, 279 | 0830483C1811D7F60068CA79 /* ViewController.m in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | 0830480E1811D7500068CA79 /* Sources */ = { 284 | isa = PBXSourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | 083048201811D7500068CA79 /* BTGlassScrollViewExampleTests.m in Sources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | /* End PBXSourcesBuildPhase section */ 292 | 293 | /* Begin PBXTargetDependency section */ 294 | 083048181811D7500068CA79 /* PBXTargetDependency */ = { 295 | isa = PBXTargetDependency; 296 | target = 083047F61811D7500068CA79 /* BTGlassScrollViewExample */; 297 | targetProxy = 083048171811D7500068CA79 /* PBXContainerItemProxy */; 298 | }; 299 | /* End PBXTargetDependency section */ 300 | 301 | /* Begin PBXVariantGroup section */ 302 | 083048031811D7500068CA79 /* InfoPlist.strings */ = { 303 | isa = PBXVariantGroup; 304 | children = ( 305 | 083048041811D7500068CA79 /* en */, 306 | ); 307 | name = InfoPlist.strings; 308 | sourceTree = ""; 309 | }; 310 | 0830481C1811D7500068CA79 /* InfoPlist.strings */ = { 311 | isa = PBXVariantGroup; 312 | children = ( 313 | 0830481D1811D7500068CA79 /* en */, 314 | ); 315 | name = InfoPlist.strings; 316 | sourceTree = ""; 317 | }; 318 | /* End PBXVariantGroup section */ 319 | 320 | /* Begin XCBuildConfiguration section */ 321 | 083048211811D7500068CA79 /* 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 = "iPhone Developer"; 339 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 340 | COPY_PHASE_STRIP = NO; 341 | GCC_C_LANGUAGE_STANDARD = gnu99; 342 | GCC_DYNAMIC_NO_PIC = NO; 343 | GCC_OPTIMIZATION_LEVEL = 0; 344 | GCC_PREPROCESSOR_DEFINITIONS = ( 345 | "DEBUG=1", 346 | "$(inherited)", 347 | ); 348 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 349 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 350 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 351 | GCC_WARN_UNDECLARED_SELECTOR = YES; 352 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 353 | GCC_WARN_UNUSED_FUNCTION = YES; 354 | GCC_WARN_UNUSED_VARIABLE = YES; 355 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 356 | ONLY_ACTIVE_ARCH = YES; 357 | SDKROOT = iphoneos; 358 | TARGETED_DEVICE_FAMILY = "1,2"; 359 | }; 360 | name = Debug; 361 | }; 362 | 083048221811D7500068CA79 /* Release */ = { 363 | isa = XCBuildConfiguration; 364 | buildSettings = { 365 | ALWAYS_SEARCH_USER_PATHS = NO; 366 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 367 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 368 | CLANG_CXX_LIBRARY = "libc++"; 369 | CLANG_ENABLE_MODULES = YES; 370 | CLANG_ENABLE_OBJC_ARC = YES; 371 | CLANG_WARN_BOOL_CONVERSION = YES; 372 | CLANG_WARN_CONSTANT_CONVERSION = YES; 373 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 374 | CLANG_WARN_EMPTY_BODY = YES; 375 | CLANG_WARN_ENUM_CONVERSION = YES; 376 | CLANG_WARN_INT_CONVERSION = YES; 377 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 378 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 379 | CODE_SIGN_IDENTITY = "iPhone Developer"; 380 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 381 | COPY_PHASE_STRIP = YES; 382 | ENABLE_NS_ASSERTIONS = NO; 383 | GCC_C_LANGUAGE_STANDARD = gnu99; 384 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 385 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 386 | GCC_WARN_UNDECLARED_SELECTOR = YES; 387 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 388 | GCC_WARN_UNUSED_FUNCTION = YES; 389 | GCC_WARN_UNUSED_VARIABLE = YES; 390 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 391 | SDKROOT = iphoneos; 392 | TARGETED_DEVICE_FAMILY = "1,2"; 393 | VALIDATE_PRODUCT = YES; 394 | }; 395 | name = Release; 396 | }; 397 | 083048241811D7500068CA79 /* Debug */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 401 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 402 | CODE_SIGN_IDENTITY = "iPhone Developer"; 403 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 404 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 405 | GCC_PREFIX_HEADER = "BTGlassScrollViewExample/BTGlassScrollViewExample-Prefix.pch"; 406 | INFOPLIST_FILE = "BTGlassScrollViewExample/BTGlassScrollViewExample-Info.plist"; 407 | PRODUCT_NAME = "$(TARGET_NAME)"; 408 | PROVISIONING_PROFILE = ""; 409 | WRAPPER_EXTENSION = app; 410 | }; 411 | name = Debug; 412 | }; 413 | 083048251811D7500068CA79 /* Release */ = { 414 | isa = XCBuildConfiguration; 415 | buildSettings = { 416 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 417 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 418 | CODE_SIGN_IDENTITY = "iPhone Developer"; 419 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 420 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 421 | GCC_PREFIX_HEADER = "BTGlassScrollViewExample/BTGlassScrollViewExample-Prefix.pch"; 422 | INFOPLIST_FILE = "BTGlassScrollViewExample/BTGlassScrollViewExample-Info.plist"; 423 | PRODUCT_NAME = "$(TARGET_NAME)"; 424 | PROVISIONING_PROFILE = ""; 425 | WRAPPER_EXTENSION = app; 426 | }; 427 | name = Release; 428 | }; 429 | 083048271811D7500068CA79 /* Debug */ = { 430 | isa = XCBuildConfiguration; 431 | buildSettings = { 432 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 433 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/BTGlassScrollViewExample.app/BTGlassScrollViewExample"; 434 | FRAMEWORK_SEARCH_PATHS = ( 435 | "$(SDKROOT)/Developer/Library/Frameworks", 436 | "$(inherited)", 437 | "$(DEVELOPER_FRAMEWORKS_DIR)", 438 | ); 439 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 440 | GCC_PREFIX_HEADER = "BTGlassScrollViewExample/BTGlassScrollViewExample-Prefix.pch"; 441 | GCC_PREPROCESSOR_DEFINITIONS = ( 442 | "DEBUG=1", 443 | "$(inherited)", 444 | ); 445 | INFOPLIST_FILE = "BTGlassScrollViewExampleTests/BTGlassScrollViewExampleTests-Info.plist"; 446 | PRODUCT_NAME = "$(TARGET_NAME)"; 447 | TEST_HOST = "$(BUNDLE_LOADER)"; 448 | WRAPPER_EXTENSION = xctest; 449 | }; 450 | name = Debug; 451 | }; 452 | 083048281811D7500068CA79 /* Release */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 456 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/BTGlassScrollViewExample.app/BTGlassScrollViewExample"; 457 | FRAMEWORK_SEARCH_PATHS = ( 458 | "$(SDKROOT)/Developer/Library/Frameworks", 459 | "$(inherited)", 460 | "$(DEVELOPER_FRAMEWORKS_DIR)", 461 | ); 462 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 463 | GCC_PREFIX_HEADER = "BTGlassScrollViewExample/BTGlassScrollViewExample-Prefix.pch"; 464 | INFOPLIST_FILE = "BTGlassScrollViewExampleTests/BTGlassScrollViewExampleTests-Info.plist"; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | TEST_HOST = "$(BUNDLE_LOADER)"; 467 | WRAPPER_EXTENSION = xctest; 468 | }; 469 | name = Release; 470 | }; 471 | /* End XCBuildConfiguration section */ 472 | 473 | /* Begin XCConfigurationList section */ 474 | 083047F21811D7500068CA79 /* Build configuration list for PBXProject "BTGlassScrollViewExample" */ = { 475 | isa = XCConfigurationList; 476 | buildConfigurations = ( 477 | 083048211811D7500068CA79 /* Debug */, 478 | 083048221811D7500068CA79 /* Release */, 479 | ); 480 | defaultConfigurationIsVisible = 0; 481 | defaultConfigurationName = Release; 482 | }; 483 | 083048231811D7500068CA79 /* Build configuration list for PBXNativeTarget "BTGlassScrollViewExample" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 083048241811D7500068CA79 /* Debug */, 487 | 083048251811D7500068CA79 /* Release */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | 083048261811D7500068CA79 /* Build configuration list for PBXNativeTarget "BTGlassScrollViewExampleTests" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | 083048271811D7500068CA79 /* Debug */, 496 | 083048281811D7500068CA79 /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | /* End XCConfigurationList section */ 502 | }; 503 | rootObject = 083047EF1811D7500068CA79 /* Project object */; 504 | } 505 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample.xcodeproj/project.xcworkspace/xcshareddata/BTGlassScrollViewExample.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 8534360A-5065-42E2-923D-1AADE490F50B 9 | IDESourceControlProjectName 10 | BTGlassScrollViewExample 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 9C63C6AE-5143-461C-A6D1-518A92469C67 14 | https://github.com/BTLibrary/BTGlassScrollView.git 15 | 16 | IDESourceControlProjectPath 17 | BTGlassScrollViewExample/BTGlassScrollViewExample.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 9C63C6AE-5143-461C-A6D1-518A92469C67 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/BTLibrary/BTGlassScrollView.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | 9C63C6AE-5143-461C-A6D1-518A92469C67 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 9C63C6AE-5143-461C-A6D1-518A92469C67 36 | IDESourceControlWCCName 37 | BTGlassScrollView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample.xcodeproj/project.xcworkspace/xcuserdata/Byte.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // BTGlassScrollViewExample 4 | // 5 | // Created by Byte on 10/18/13. 6 | // Copyright (c) 2013 Byte. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ViewController.h" 11 | #import "FirstViewController.h" 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // BTGlassScrollViewExample 4 | // 5 | // Created by Byte on 10/18/13. 6 | // Copyright (c) 2013 Byte. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 16 | self.window.backgroundColor = [UIColor whiteColor]; 17 | [self.window makeKeyAndVisible]; 18 | 19 | //pick one 20 | //self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[ViewController alloc] init]]; 21 | //self.window.rootViewController = [[ViewController alloc] init]; 22 | self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[FirstViewController alloc] init]]; 23 | 24 | return YES; 25 | } 26 | 27 | - (void)applicationWillResignActive:(UIApplication *)application 28 | { 29 | // 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. 30 | // 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. 31 | } 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application 34 | { 35 | // 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. 36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application 40 | { 41 | // 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. 42 | } 43 | 44 | - (void)applicationDidBecomeActive:(UIApplication *)application 45 | { 46 | // 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. 47 | } 48 | 49 | - (void)applicationWillTerminate:(UIApplication *)application 50 | { 51 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/BTGlassScrollViewExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIViewControllerBasedStatusBarAppearance 6 | 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleDisplayName 10 | ${PRODUCT_NAME} 11 | CFBundleExecutable 12 | ${EXECUTABLE_NAME} 13 | CFBundleIdentifier 14 | com.BTLibrary.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/BTGlassScrollViewExample-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_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/FirstViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.h 3 | // BTGlassScrollViewExample 4 | // 5 | // Created by Byte on 10/21/13. 6 | // Copyright (c) 2013 Byte. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ViewController.h" 11 | 12 | @interface FirstViewController : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/FirstViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.m 3 | // BTGlassScrollViewExample 4 | // 5 | // Created by Byte on 10/21/13. 6 | // Copyright (c) 2013 Byte. All rights reserved. 7 | // 8 | 9 | #import "FirstViewController.h" 10 | 11 | @interface FirstViewController () 12 | 13 | @end 14 | 15 | @implementation FirstViewController 16 | 17 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 18 | { 19 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 20 | if (self) { 21 | // Custom initialization 22 | UIButton * button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 23 | [button setFrame:self.view.frame]; 24 | [button setTitle:@"GO TO THE MAIN APP" forState:UIControlStateNormal]; 25 | [button addTarget:self action:@selector(goToViewController) forControlEvents:UIControlEventTouchUpInside]; 26 | [button setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth]; 27 | [self.view addSubview:button]; 28 | 29 | } 30 | return self; 31 | } 32 | 33 | - (void)goToViewController 34 | { 35 | [self.navigationController pushViewController:[[ViewController alloc] init] animated:YES]; 36 | } 37 | 38 | - (void)viewDidLoad 39 | { 40 | [super viewDidLoad]; 41 | // Do any additional setup after loading the view. 42 | } 43 | 44 | - (void)didReceiveMemoryWarning 45 | { 46 | [super didReceiveMemoryWarning]; 47 | // Dispose of any resources that can be recreated. 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/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 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/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 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/Images.xcassets/background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "Image.png" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/Images.xcassets/background.imageset/Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTLibrary/BTGlassScrollView/24b290e8e8b2a2effbd10db2656435eda503c4b3/BTGlassScrollViewExample/BTGlassScrollViewExample/Images.xcassets/background.imageset/Image.png -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/Images.xcassets/background2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "Image.png" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/Images.xcassets/background2.imageset/Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTLibrary/BTGlassScrollView/24b290e8e8b2a2effbd10db2656435eda503c4b3/BTGlassScrollViewExample/BTGlassScrollViewExample/Images.xcassets/background2.imageset/Image.png -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/Images.xcassets/background3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "landscapes-sea_00343155.png" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/Images.xcassets/background3.imageset/landscapes-sea_00343155.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTLibrary/BTGlassScrollView/24b290e8e8b2a2effbd10db2656435eda503c4b3/BTGlassScrollViewExample/BTGlassScrollViewExample/Images.xcassets/background3.imageset/landscapes-sea_00343155.png -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // BTGlassScrollViewExample 4 | // 5 | // Created by Byte on 10/18/13. 6 | // Copyright (c) 2013 Byte. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BTGlassScrollView.h" 11 | 12 | @interface ViewController : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // BTGlassScrollViewExample 4 | // 5 | // Created by Byte on 10/18/13. 6 | // Copyright (c) 2013 Byte. All rights reserved. 7 | // 8 | 9 | #define SIMPLE_SAMPLE NO 10 | 11 | 12 | #import "ViewController.h" 13 | 14 | @interface ViewController () 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | { 20 | BTGlassScrollView *_glassScrollView; 21 | 22 | UIScrollView *_viewScroller; 23 | BTGlassScrollView *_glassScrollView1; 24 | BTGlassScrollView *_glassScrollView2; 25 | BTGlassScrollView *_glassScrollView3; 26 | int _page; 27 | 28 | } 29 | 30 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 31 | { 32 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 33 | if (self) { 34 | // Custom initialization 35 | _page = 0; 36 | } 37 | return self; 38 | } 39 | - (void)viewDidLoad 40 | { 41 | [super viewDidLoad]; 42 | //showing white status 43 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 44 | 45 | //preventing weird inset 46 | [self setAutomaticallyAdjustsScrollViewInsets: NO]; 47 | 48 | //navigation bar work 49 | NSShadow *shadow = [[NSShadow alloc] init]; 50 | [shadow setShadowOffset:CGSizeMake(1, 1)]; 51 | [shadow setShadowColor:[UIColor blackColor]]; 52 | [shadow setShadowBlurRadius:1]; 53 | self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor], NSShadowAttributeName: shadow}; 54 | [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 55 | self.navigationController.navigationBar.shadowImage = [UIImage new]; 56 | self.title = @"Awesome App"; 57 | 58 | //background 59 | self.view.backgroundColor = [UIColor blackColor]; 60 | 61 | #warning Toggle this to see the more complex build of this version 62 | if (SIMPLE_SAMPLE) { 63 | //create your custom info views 64 | UIView *view = [self customView]; 65 | 66 | _glassScrollView = [[BTGlassScrollView alloc] initWithFrame:self.view.frame BackgroundImage:[UIImage imageNamed:@"background3"] blurredImage:nil viewDistanceFromBottom:120 foregroundView:view]; 67 | 68 | [self.view addSubview:_glassScrollView]; 69 | }else{ 70 | CGFloat blackSideBarWidth = 2; 71 | 72 | _viewScroller = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width + 2*blackSideBarWidth, self.view.frame.size.height)]; 73 | [_viewScroller setPagingEnabled:YES]; 74 | [_viewScroller setDelegate:self]; 75 | [_viewScroller setShowsHorizontalScrollIndicator:NO]; 76 | [self.view addSubview:_viewScroller]; 77 | 78 | _glassScrollView1 = [[BTGlassScrollView alloc] initWithFrame:self.view.frame BackgroundImage:[UIImage imageNamed:@"background3"] blurredImage:nil viewDistanceFromBottom:120 foregroundView:[self customView]]; 79 | _glassScrollView2 = [[BTGlassScrollView alloc] initWithFrame:self.view.frame BackgroundImage:[UIImage imageNamed:@"background2"] blurredImage:nil viewDistanceFromBottom:120 foregroundView:[self customView]]; 80 | _glassScrollView3 = [[BTGlassScrollView alloc] initWithFrame:self.view.frame BackgroundImage:[UIImage imageNamed:@"background"] blurredImage:nil viewDistanceFromBottom:120 foregroundView:[self customView]]; 81 | 82 | [_viewScroller addSubview:_glassScrollView1]; 83 | [_viewScroller addSubview:_glassScrollView2]; 84 | [_viewScroller addSubview:_glassScrollView3]; 85 | } 86 | } 87 | - (void)viewWillAppear:(BOOL)animated 88 | { 89 | if (!SIMPLE_SAMPLE) { 90 | int page = _page; // resize scrollview can cause setContentOffset off for no reason and screw things up 91 | 92 | CGFloat blackSideBarWidth = 2; 93 | [_viewScroller setFrame:CGRectMake(0, 0, self.view.frame.size.width + 2*blackSideBarWidth, self.view.frame.size.height)]; 94 | [_viewScroller setContentSize:CGSizeMake(3*_viewScroller.frame.size.width, self.view.frame.size.height)]; 95 | 96 | [_glassScrollView1 setFrame:self.view.frame]; 97 | [_glassScrollView2 setFrame:self.view.frame]; 98 | [_glassScrollView3 setFrame:self.view.frame]; 99 | 100 | [_glassScrollView2 setFrame:CGRectOffset(_glassScrollView2.bounds, _viewScroller.frame.size.width, 0)]; 101 | [_glassScrollView3 setFrame:CGRectOffset(_glassScrollView3.bounds, 2*_viewScroller.frame.size.width, 0)]; 102 | 103 | [_viewScroller setContentOffset:CGPointMake(page * _viewScroller.frame.size.width, _viewScroller.contentOffset.y)]; 104 | _page = page; 105 | } 106 | 107 | //show animation trick 108 | double delayInSeconds = 2.0; 109 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); 110 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 111 | // [_glassScrollView1 setBackgroundImage:[UIImage imageNamed:@"background"] overWriteBlur:YES animated:YES duration:1]; 112 | }); 113 | } 114 | 115 | - (void)viewWillLayoutSubviews 116 | { 117 | // if the view has navigation bar, this is a great place to realign the top part to allow navigation controller 118 | // or even the status bar 119 | if (SIMPLE_SAMPLE) { 120 | [_glassScrollView setTopLayoutGuideLength:[self.topLayoutGuide length]]; 121 | }else{ 122 | [_glassScrollView1 setTopLayoutGuideLength:[self.topLayoutGuide length]]; 123 | [_glassScrollView2 setTopLayoutGuideLength:[self.topLayoutGuide length]]; 124 | [_glassScrollView3 setTopLayoutGuideLength:[self.topLayoutGuide length]]; 125 | } 126 | } 127 | 128 | - (UIView *)customView 129 | { 130 | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 705)]; 131 | 132 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 310, 120)]; 133 | [label setText:[NSString stringWithFormat:@"%i℉",arc4random_uniform(20) + 60]]; 134 | [label setTextColor:[UIColor whiteColor]]; 135 | [label setFont:[UIFont fontWithName:@"HelveticaNeue-UltraLight" size:120]]; 136 | [label setShadowColor:[UIColor blackColor]]; 137 | [label setShadowOffset:CGSizeMake(1, 1)]; 138 | [view addSubview:label]; 139 | 140 | UIView *box1 = [[UIView alloc] initWithFrame:CGRectMake(5, 140, 310, 125)]; 141 | box1.layer.cornerRadius = 3; 142 | box1.backgroundColor = [UIColor colorWithWhite:0 alpha:.15]; 143 | [view addSubview:box1]; 144 | 145 | UIView *box2 = [[UIView alloc] initWithFrame:CGRectMake(5, 270, 310, 300)]; 146 | box2.layer.cornerRadius = 3; 147 | box2.backgroundColor = [UIColor colorWithWhite:0 alpha:.15]; 148 | [view addSubview:box2]; 149 | 150 | UIView *box3 = [[UIView alloc] initWithFrame:CGRectMake(5, 575, 310, 125)]; 151 | box3.layer.cornerRadius = 3; 152 | box3.backgroundColor = [UIColor colorWithWhite:0 alpha:.15]; 153 | [view addSubview:box3]; 154 | 155 | return view; 156 | } 157 | 158 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 159 | { 160 | CGFloat ratio = scrollView.contentOffset.x/scrollView.frame.size.width; 161 | _page = (int)floor(ratio); 162 | NSLog(@"%i",_page); 163 | if (ratio > -1 && ratio < 1) { 164 | [_glassScrollView1 scrollHorizontalRatio:-ratio]; 165 | } 166 | if (ratio > 0 && ratio < 2) { 167 | [_glassScrollView2 scrollHorizontalRatio:-ratio + 1]; 168 | } 169 | if (ratio > 1 && ratio < 3) { 170 | [_glassScrollView3 scrollHorizontalRatio:-ratio + 2]; 171 | } 172 | } 173 | 174 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView 175 | { 176 | BTGlassScrollView *glass = [self currentGlass]; 177 | 178 | //can probably be optimized better than this 179 | //this is just a demonstration without optimization 180 | [_glassScrollView1 scrollVerticallyToOffset:glass.foregroundScrollView.contentOffset.y]; 181 | [_glassScrollView2 scrollVerticallyToOffset:glass.foregroundScrollView.contentOffset.y]; 182 | [_glassScrollView3 scrollVerticallyToOffset:glass.foregroundScrollView.contentOffset.y]; 183 | } 184 | 185 | - (BTGlassScrollView *)currentGlass 186 | { 187 | BTGlassScrollView *glass; 188 | switch (_page) { 189 | case 0: 190 | glass = _glassScrollView1; 191 | break; 192 | case 1: 193 | glass = _glassScrollView2; 194 | break; 195 | case 2: 196 | glass = _glassScrollView3; 197 | default: 198 | break; 199 | } 200 | return glass; 201 | } 202 | 203 | - (BOOL)shouldAutorotate 204 | { 205 | return YES; 206 | } 207 | 208 | - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 209 | { 210 | [self viewWillAppear:YES]; 211 | } 212 | 213 | @end 214 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BTGlassScrollViewExample 4 | // 5 | // Created by Byte on 10/18/13. 6 | // Copyright (c) 2013 Byte. 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 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExampleTests/BTGlassScrollViewExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.BTLibrary.${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 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExampleTests/BTGlassScrollViewExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // BTGlassScrollViewExampleTests.m 3 | // BTGlassScrollViewExampleTests 4 | // 5 | // Created by Byte on 10/18/13. 6 | // Copyright (c) 2013 Byte. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BTGlassScrollViewExampleTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation BTGlassScrollViewExampleTests 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 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample/BTGlassScrollViewExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4CA1B9C5189172B300A4FE72 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CA1B9C4189172B300A4FE72 /* Foundation.framework */; }; 11 | 4CA1B9C7189172B300A4FE72 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CA1B9C6189172B300A4FE72 /* CoreGraphics.framework */; }; 12 | 4CA1B9C9189172B400A4FE72 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CA1B9C8189172B400A4FE72 /* UIKit.framework */; }; 13 | 4CA1B9CF189172B400A4FE72 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4CA1B9CD189172B400A4FE72 /* InfoPlist.strings */; }; 14 | 4CA1B9D1189172B400A4FE72 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA1B9D0189172B400A4FE72 /* main.m */; }; 15 | 4CA1B9D5189172B400A4FE72 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA1B9D4189172B400A4FE72 /* AppDelegate.m */; }; 16 | 4CA1B9D7189172B400A4FE72 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4CA1B9D6189172B400A4FE72 /* Images.xcassets */; }; 17 | 4CA1B9DE189172B400A4FE72 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CA1B9DD189172B400A4FE72 /* XCTest.framework */; }; 18 | 4CA1B9DF189172B400A4FE72 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CA1B9C4189172B300A4FE72 /* Foundation.framework */; }; 19 | 4CA1B9E0189172B400A4FE72 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CA1B9C8189172B400A4FE72 /* UIKit.framework */; }; 20 | 4CA1B9E8189172B400A4FE72 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4CA1B9E6189172B400A4FE72 /* InfoPlist.strings */; }; 21 | 4CA1B9EA189172B400A4FE72 /* BTGlassScrollViewExample2Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA1B9E9189172B400A4FE72 /* BTGlassScrollViewExample2Tests.m */; }; 22 | 4CA1B9F8189172E800A4FE72 /* BTGlassScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA1B9F5189172E800A4FE72 /* BTGlassScrollView.m */; }; 23 | 4CA1B9F9189172E800A4FE72 /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA1B9F7189172E800A4FE72 /* UIImage+ImageEffects.m */; }; 24 | 4CA1B9FC1891734E00A4FE72 /* BTGlassScrollViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA1B9FB1891734E00A4FE72 /* BTGlassScrollViewController.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | 4CA1B9E1189172B400A4FE72 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 4CA1B9B9189172B300A4FE72 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 4CA1B9C0189172B300A4FE72; 33 | remoteInfo = BTGlassScrollViewExample2; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 4CA1B9C1189172B300A4FE72 /* BTGlassScrollViewExample2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BTGlassScrollViewExample2.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 4CA1B9C4189172B300A4FE72 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 40 | 4CA1B9C6189172B300A4FE72 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 41 | 4CA1B9C8189172B400A4FE72 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 42 | 4CA1B9CC189172B400A4FE72 /* BTGlassScrollViewExample2-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BTGlassScrollViewExample2-Info.plist"; sourceTree = ""; }; 43 | 4CA1B9CE189172B400A4FE72 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 44 | 4CA1B9D0189172B400A4FE72 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | 4CA1B9D2189172B400A4FE72 /* BTGlassScrollViewExample2-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BTGlassScrollViewExample2-Prefix.pch"; sourceTree = ""; }; 46 | 4CA1B9D3189172B400A4FE72 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 47 | 4CA1B9D4189172B400A4FE72 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 48 | 4CA1B9D6189172B400A4FE72 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 49 | 4CA1B9DC189172B400A4FE72 /* BTGlassScrollViewExample2Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BTGlassScrollViewExample2Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 4CA1B9DD189172B400A4FE72 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 51 | 4CA1B9E5189172B400A4FE72 /* BTGlassScrollViewExample2Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BTGlassScrollViewExample2Tests-Info.plist"; sourceTree = ""; }; 52 | 4CA1B9E7189172B400A4FE72 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 53 | 4CA1B9E9189172B400A4FE72 /* BTGlassScrollViewExample2Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BTGlassScrollViewExample2Tests.m; sourceTree = ""; }; 54 | 4CA1B9F4189172E800A4FE72 /* BTGlassScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTGlassScrollView.h; sourceTree = ""; }; 55 | 4CA1B9F5189172E800A4FE72 /* BTGlassScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTGlassScrollView.m; sourceTree = ""; }; 56 | 4CA1B9F6189172E800A4FE72 /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ImageEffects.h"; sourceTree = ""; }; 57 | 4CA1B9F7189172E800A4FE72 /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ImageEffects.m"; sourceTree = ""; }; 58 | 4CA1B9FA1891734E00A4FE72 /* BTGlassScrollViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTGlassScrollViewController.h; sourceTree = ""; }; 59 | 4CA1B9FB1891734E00A4FE72 /* BTGlassScrollViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTGlassScrollViewController.m; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | 4CA1B9BE189172B300A4FE72 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | 4CA1B9C7189172B300A4FE72 /* CoreGraphics.framework in Frameworks */, 68 | 4CA1B9C9189172B400A4FE72 /* UIKit.framework in Frameworks */, 69 | 4CA1B9C5189172B300A4FE72 /* Foundation.framework in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | 4CA1B9D9189172B400A4FE72 /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 4CA1B9DE189172B400A4FE72 /* XCTest.framework in Frameworks */, 78 | 4CA1B9E0189172B400A4FE72 /* UIKit.framework in Frameworks */, 79 | 4CA1B9DF189172B400A4FE72 /* Foundation.framework in Frameworks */, 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXFrameworksBuildPhase section */ 84 | 85 | /* Begin PBXGroup section */ 86 | 4CA1B9B8189172B300A4FE72 = { 87 | isa = PBXGroup; 88 | children = ( 89 | 4CA1B9F3189172E800A4FE72 /* BTGlassScrollView */, 90 | 4CA1B9CA189172B400A4FE72 /* BTGlassScrollViewExample2 */, 91 | 4CA1B9E3189172B400A4FE72 /* BTGlassScrollViewExample2Tests */, 92 | 4CA1B9C3189172B300A4FE72 /* Frameworks */, 93 | 4CA1B9C2189172B300A4FE72 /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 4CA1B9C2189172B300A4FE72 /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 4CA1B9C1189172B300A4FE72 /* BTGlassScrollViewExample2.app */, 101 | 4CA1B9DC189172B400A4FE72 /* BTGlassScrollViewExample2Tests.xctest */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | 4CA1B9C3189172B300A4FE72 /* Frameworks */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 4CA1B9C4189172B300A4FE72 /* Foundation.framework */, 110 | 4CA1B9C6189172B300A4FE72 /* CoreGraphics.framework */, 111 | 4CA1B9C8189172B400A4FE72 /* UIKit.framework */, 112 | 4CA1B9DD189172B400A4FE72 /* XCTest.framework */, 113 | ); 114 | name = Frameworks; 115 | sourceTree = ""; 116 | }; 117 | 4CA1B9CA189172B400A4FE72 /* BTGlassScrollViewExample2 */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 4CA1B9D3189172B400A4FE72 /* AppDelegate.h */, 121 | 4CA1B9D4189172B400A4FE72 /* AppDelegate.m */, 122 | 4CA1B9D6189172B400A4FE72 /* Images.xcassets */, 123 | 4CA1B9CB189172B400A4FE72 /* Supporting Files */, 124 | 4CA1B9FA1891734E00A4FE72 /* BTGlassScrollViewController.h */, 125 | 4CA1B9FB1891734E00A4FE72 /* BTGlassScrollViewController.m */, 126 | ); 127 | path = BTGlassScrollViewExample2; 128 | sourceTree = ""; 129 | }; 130 | 4CA1B9CB189172B400A4FE72 /* Supporting Files */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 4CA1B9CC189172B400A4FE72 /* BTGlassScrollViewExample2-Info.plist */, 134 | 4CA1B9CD189172B400A4FE72 /* InfoPlist.strings */, 135 | 4CA1B9D0189172B400A4FE72 /* main.m */, 136 | 4CA1B9D2189172B400A4FE72 /* BTGlassScrollViewExample2-Prefix.pch */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | 4CA1B9E3189172B400A4FE72 /* BTGlassScrollViewExample2Tests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 4CA1B9E9189172B400A4FE72 /* BTGlassScrollViewExample2Tests.m */, 145 | 4CA1B9E4189172B400A4FE72 /* Supporting Files */, 146 | ); 147 | path = BTGlassScrollViewExample2Tests; 148 | sourceTree = ""; 149 | }; 150 | 4CA1B9E4189172B400A4FE72 /* Supporting Files */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 4CA1B9E5189172B400A4FE72 /* BTGlassScrollViewExample2Tests-Info.plist */, 154 | 4CA1B9E6189172B400A4FE72 /* InfoPlist.strings */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | 4CA1B9F3189172E800A4FE72 /* BTGlassScrollView */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 4CA1B9F4189172E800A4FE72 /* BTGlassScrollView.h */, 163 | 4CA1B9F5189172E800A4FE72 /* BTGlassScrollView.m */, 164 | 4CA1B9F6189172E800A4FE72 /* UIImage+ImageEffects.h */, 165 | 4CA1B9F7189172E800A4FE72 /* UIImage+ImageEffects.m */, 166 | ); 167 | name = BTGlassScrollView; 168 | path = ../BTGlassScrollView; 169 | sourceTree = ""; 170 | }; 171 | /* End PBXGroup section */ 172 | 173 | /* Begin PBXNativeTarget section */ 174 | 4CA1B9C0189172B300A4FE72 /* BTGlassScrollViewExample2 */ = { 175 | isa = PBXNativeTarget; 176 | buildConfigurationList = 4CA1B9ED189172B400A4FE72 /* Build configuration list for PBXNativeTarget "BTGlassScrollViewExample2" */; 177 | buildPhases = ( 178 | 4CA1B9BD189172B300A4FE72 /* Sources */, 179 | 4CA1B9BE189172B300A4FE72 /* Frameworks */, 180 | 4CA1B9BF189172B300A4FE72 /* Resources */, 181 | ); 182 | buildRules = ( 183 | ); 184 | dependencies = ( 185 | ); 186 | name = BTGlassScrollViewExample2; 187 | productName = BTGlassScrollViewExample2; 188 | productReference = 4CA1B9C1189172B300A4FE72 /* BTGlassScrollViewExample2.app */; 189 | productType = "com.apple.product-type.application"; 190 | }; 191 | 4CA1B9DB189172B400A4FE72 /* BTGlassScrollViewExample2Tests */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 4CA1B9F0189172B400A4FE72 /* Build configuration list for PBXNativeTarget "BTGlassScrollViewExample2Tests" */; 194 | buildPhases = ( 195 | 4CA1B9D8189172B400A4FE72 /* Sources */, 196 | 4CA1B9D9189172B400A4FE72 /* Frameworks */, 197 | 4CA1B9DA189172B400A4FE72 /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | 4CA1B9E2189172B400A4FE72 /* PBXTargetDependency */, 203 | ); 204 | name = BTGlassScrollViewExample2Tests; 205 | productName = BTGlassScrollViewExample2Tests; 206 | productReference = 4CA1B9DC189172B400A4FE72 /* BTGlassScrollViewExample2Tests.xctest */; 207 | productType = "com.apple.product-type.bundle.unit-test"; 208 | }; 209 | /* End PBXNativeTarget section */ 210 | 211 | /* Begin PBXProject section */ 212 | 4CA1B9B9189172B300A4FE72 /* Project object */ = { 213 | isa = PBXProject; 214 | attributes = { 215 | LastUpgradeCheck = 0500; 216 | ORGANIZATIONNAME = Byte; 217 | TargetAttributes = { 218 | 4CA1B9DB189172B400A4FE72 = { 219 | TestTargetID = 4CA1B9C0189172B300A4FE72; 220 | }; 221 | }; 222 | }; 223 | buildConfigurationList = 4CA1B9BC189172B300A4FE72 /* Build configuration list for PBXProject "BTGlassScrollViewExample2" */; 224 | compatibilityVersion = "Xcode 3.2"; 225 | developmentRegion = English; 226 | hasScannedForEncodings = 0; 227 | knownRegions = ( 228 | en, 229 | ); 230 | mainGroup = 4CA1B9B8189172B300A4FE72; 231 | productRefGroup = 4CA1B9C2189172B300A4FE72 /* Products */; 232 | projectDirPath = ""; 233 | projectRoot = ""; 234 | targets = ( 235 | 4CA1B9C0189172B300A4FE72 /* BTGlassScrollViewExample2 */, 236 | 4CA1B9DB189172B400A4FE72 /* BTGlassScrollViewExample2Tests */, 237 | ); 238 | }; 239 | /* End PBXProject section */ 240 | 241 | /* Begin PBXResourcesBuildPhase section */ 242 | 4CA1B9BF189172B300A4FE72 /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | 4CA1B9CF189172B400A4FE72 /* InfoPlist.strings in Resources */, 247 | 4CA1B9D7189172B400A4FE72 /* Images.xcassets in Resources */, 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | 4CA1B9DA189172B400A4FE72 /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | 4CA1B9E8189172B400A4FE72 /* InfoPlist.strings in Resources */, 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | }; 259 | /* End PBXResourcesBuildPhase section */ 260 | 261 | /* Begin PBXSourcesBuildPhase section */ 262 | 4CA1B9BD189172B300A4FE72 /* Sources */ = { 263 | isa = PBXSourcesBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | 4CA1B9F9189172E800A4FE72 /* UIImage+ImageEffects.m in Sources */, 267 | 4CA1B9D5189172B400A4FE72 /* AppDelegate.m in Sources */, 268 | 4CA1B9FC1891734E00A4FE72 /* BTGlassScrollViewController.m in Sources */, 269 | 4CA1B9F8189172E800A4FE72 /* BTGlassScrollView.m in Sources */, 270 | 4CA1B9D1189172B400A4FE72 /* main.m in Sources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | 4CA1B9D8189172B400A4FE72 /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | 4CA1B9EA189172B400A4FE72 /* BTGlassScrollViewExample2Tests.m in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | /* End PBXSourcesBuildPhase section */ 283 | 284 | /* Begin PBXTargetDependency section */ 285 | 4CA1B9E2189172B400A4FE72 /* PBXTargetDependency */ = { 286 | isa = PBXTargetDependency; 287 | target = 4CA1B9C0189172B300A4FE72 /* BTGlassScrollViewExample2 */; 288 | targetProxy = 4CA1B9E1189172B400A4FE72 /* PBXContainerItemProxy */; 289 | }; 290 | /* End PBXTargetDependency section */ 291 | 292 | /* Begin PBXVariantGroup section */ 293 | 4CA1B9CD189172B400A4FE72 /* InfoPlist.strings */ = { 294 | isa = PBXVariantGroup; 295 | children = ( 296 | 4CA1B9CE189172B400A4FE72 /* en */, 297 | ); 298 | name = InfoPlist.strings; 299 | sourceTree = ""; 300 | }; 301 | 4CA1B9E6189172B400A4FE72 /* InfoPlist.strings */ = { 302 | isa = PBXVariantGroup; 303 | children = ( 304 | 4CA1B9E7189172B400A4FE72 /* en */, 305 | ); 306 | name = InfoPlist.strings; 307 | sourceTree = ""; 308 | }; 309 | /* End PBXVariantGroup section */ 310 | 311 | /* Begin XCBuildConfiguration section */ 312 | 4CA1B9EB189172B400A4FE72 /* Debug */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | ALWAYS_SEARCH_USER_PATHS = NO; 316 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 317 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 318 | CLANG_CXX_LIBRARY = "libc++"; 319 | CLANG_ENABLE_MODULES = YES; 320 | CLANG_ENABLE_OBJC_ARC = YES; 321 | CLANG_WARN_BOOL_CONVERSION = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 324 | CLANG_WARN_EMPTY_BODY = YES; 325 | CLANG_WARN_ENUM_CONVERSION = YES; 326 | CLANG_WARN_INT_CONVERSION = YES; 327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 328 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 329 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 330 | COPY_PHASE_STRIP = NO; 331 | GCC_C_LANGUAGE_STANDARD = gnu99; 332 | GCC_DYNAMIC_NO_PIC = NO; 333 | GCC_OPTIMIZATION_LEVEL = 0; 334 | GCC_PREPROCESSOR_DEFINITIONS = ( 335 | "DEBUG=1", 336 | "$(inherited)", 337 | ); 338 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 340 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 341 | GCC_WARN_UNDECLARED_SELECTOR = YES; 342 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 343 | GCC_WARN_UNUSED_FUNCTION = YES; 344 | GCC_WARN_UNUSED_VARIABLE = YES; 345 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 346 | ONLY_ACTIVE_ARCH = YES; 347 | SDKROOT = iphoneos; 348 | TARGETED_DEVICE_FAMILY = "1,2"; 349 | }; 350 | name = Debug; 351 | }; 352 | 4CA1B9EC189172B400A4FE72 /* Release */ = { 353 | isa = XCBuildConfiguration; 354 | buildSettings = { 355 | ALWAYS_SEARCH_USER_PATHS = NO; 356 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 357 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 358 | CLANG_CXX_LIBRARY = "libc++"; 359 | CLANG_ENABLE_MODULES = YES; 360 | CLANG_ENABLE_OBJC_ARC = YES; 361 | CLANG_WARN_BOOL_CONVERSION = YES; 362 | CLANG_WARN_CONSTANT_CONVERSION = YES; 363 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 364 | CLANG_WARN_EMPTY_BODY = YES; 365 | CLANG_WARN_ENUM_CONVERSION = YES; 366 | CLANG_WARN_INT_CONVERSION = YES; 367 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 368 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 369 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 370 | COPY_PHASE_STRIP = YES; 371 | ENABLE_NS_ASSERTIONS = NO; 372 | GCC_C_LANGUAGE_STANDARD = gnu99; 373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 375 | GCC_WARN_UNDECLARED_SELECTOR = YES; 376 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 377 | GCC_WARN_UNUSED_FUNCTION = YES; 378 | GCC_WARN_UNUSED_VARIABLE = YES; 379 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 380 | SDKROOT = iphoneos; 381 | TARGETED_DEVICE_FAMILY = "1,2"; 382 | VALIDATE_PRODUCT = YES; 383 | }; 384 | name = Release; 385 | }; 386 | 4CA1B9EE189172B400A4FE72 /* Debug */ = { 387 | isa = XCBuildConfiguration; 388 | buildSettings = { 389 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 390 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 391 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 392 | GCC_PREFIX_HEADER = "BTGlassScrollViewExample2/BTGlassScrollViewExample2-Prefix.pch"; 393 | INFOPLIST_FILE = "BTGlassScrollViewExample2/BTGlassScrollViewExample2-Info.plist"; 394 | PRODUCT_NAME = "$(TARGET_NAME)"; 395 | WRAPPER_EXTENSION = app; 396 | }; 397 | name = Debug; 398 | }; 399 | 4CA1B9EF189172B400A4FE72 /* Release */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 403 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 404 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 405 | GCC_PREFIX_HEADER = "BTGlassScrollViewExample2/BTGlassScrollViewExample2-Prefix.pch"; 406 | INFOPLIST_FILE = "BTGlassScrollViewExample2/BTGlassScrollViewExample2-Info.plist"; 407 | PRODUCT_NAME = "$(TARGET_NAME)"; 408 | WRAPPER_EXTENSION = app; 409 | }; 410 | name = Release; 411 | }; 412 | 4CA1B9F1189172B400A4FE72 /* Debug */ = { 413 | isa = XCBuildConfiguration; 414 | buildSettings = { 415 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 416 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/BTGlassScrollViewExample2.app/BTGlassScrollViewExample2"; 417 | FRAMEWORK_SEARCH_PATHS = ( 418 | "$(SDKROOT)/Developer/Library/Frameworks", 419 | "$(inherited)", 420 | "$(DEVELOPER_FRAMEWORKS_DIR)", 421 | ); 422 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 423 | GCC_PREFIX_HEADER = "BTGlassScrollViewExample2/BTGlassScrollViewExample2-Prefix.pch"; 424 | GCC_PREPROCESSOR_DEFINITIONS = ( 425 | "DEBUG=1", 426 | "$(inherited)", 427 | ); 428 | INFOPLIST_FILE = "BTGlassScrollViewExample2Tests/BTGlassScrollViewExample2Tests-Info.plist"; 429 | PRODUCT_NAME = "$(TARGET_NAME)"; 430 | TEST_HOST = "$(BUNDLE_LOADER)"; 431 | WRAPPER_EXTENSION = xctest; 432 | }; 433 | name = Debug; 434 | }; 435 | 4CA1B9F2189172B400A4FE72 /* Release */ = { 436 | isa = XCBuildConfiguration; 437 | buildSettings = { 438 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 439 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/BTGlassScrollViewExample2.app/BTGlassScrollViewExample2"; 440 | FRAMEWORK_SEARCH_PATHS = ( 441 | "$(SDKROOT)/Developer/Library/Frameworks", 442 | "$(inherited)", 443 | "$(DEVELOPER_FRAMEWORKS_DIR)", 444 | ); 445 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 446 | GCC_PREFIX_HEADER = "BTGlassScrollViewExample2/BTGlassScrollViewExample2-Prefix.pch"; 447 | INFOPLIST_FILE = "BTGlassScrollViewExample2Tests/BTGlassScrollViewExample2Tests-Info.plist"; 448 | PRODUCT_NAME = "$(TARGET_NAME)"; 449 | TEST_HOST = "$(BUNDLE_LOADER)"; 450 | WRAPPER_EXTENSION = xctest; 451 | }; 452 | name = Release; 453 | }; 454 | /* End XCBuildConfiguration section */ 455 | 456 | /* Begin XCConfigurationList section */ 457 | 4CA1B9BC189172B300A4FE72 /* Build configuration list for PBXProject "BTGlassScrollViewExample2" */ = { 458 | isa = XCConfigurationList; 459 | buildConfigurations = ( 460 | 4CA1B9EB189172B400A4FE72 /* Debug */, 461 | 4CA1B9EC189172B400A4FE72 /* Release */, 462 | ); 463 | defaultConfigurationIsVisible = 0; 464 | defaultConfigurationName = Release; 465 | }; 466 | 4CA1B9ED189172B400A4FE72 /* Build configuration list for PBXNativeTarget "BTGlassScrollViewExample2" */ = { 467 | isa = XCConfigurationList; 468 | buildConfigurations = ( 469 | 4CA1B9EE189172B400A4FE72 /* Debug */, 470 | 4CA1B9EF189172B400A4FE72 /* Release */, 471 | ); 472 | defaultConfigurationIsVisible = 0; 473 | }; 474 | 4CA1B9F0189172B400A4FE72 /* Build configuration list for PBXNativeTarget "BTGlassScrollViewExample2Tests" */ = { 475 | isa = XCConfigurationList; 476 | buildConfigurations = ( 477 | 4CA1B9F1189172B400A4FE72 /* Debug */, 478 | 4CA1B9F2189172B400A4FE72 /* Release */, 479 | ); 480 | defaultConfigurationIsVisible = 0; 481 | }; 482 | /* End XCConfigurationList section */ 483 | }; 484 | rootObject = 4CA1B9B9189172B300A4FE72 /* Project object */; 485 | } 486 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2.xcodeproj/project.xcworkspace/xcshareddata/BTGlassScrollViewExample2.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 56CD8CDC-979B-4E55-9E56-0C65D7DAB9EB 9 | IDESourceControlProjectName 10 | BTGlassScrollViewExample2 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 9C63C6AE-5143-461C-A6D1-518A92469C67 14 | https://github.com/BTLibrary/BTGlassScrollView.git 15 | 16 | IDESourceControlProjectPath 17 | BTGlassScrollViewExample2/BTGlassScrollViewExample2.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 9C63C6AE-5143-461C-A6D1-518A92469C67 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/BTLibrary/BTGlassScrollView.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | 9C63C6AE-5143-461C-A6D1-518A92469C67 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 9C63C6AE-5143-461C-A6D1-518A92469C67 36 | IDESourceControlWCCName 37 | BTGlassScrollView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // BTGlassScrollViewExample2 4 | // 5 | // Created by Byte on 1/23/14. 6 | // Copyright (c) 2014 Byte. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BTGlassScrollViewController.h" 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // BTGlassScrollViewExample2 4 | // 5 | // Created by Byte on 1/23/14. 6 | // Copyright (c) 2014 Byte. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #define NUMBER_OF_PAGES 5 12 | 13 | @implementation AppDelegate 14 | { 15 | NSMutableArray *_viewControllerArray; 16 | int _currentIndex; 17 | CGFloat _glassScrollOffset; 18 | } 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 20 | { 21 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 22 | // Override point for customization after application launch. 23 | self.window.backgroundColor = [UIColor whiteColor]; 24 | [self.window makeKeyAndVisible]; 25 | 26 | _viewControllerArray = [NSMutableArray array]; 27 | UINavigationController *glassScrollVCWithNavC = [self glassScrollVCWithNavigatorForIndex:0]; 28 | _viewControllerArray[0] = glassScrollVCWithNavC; 29 | 30 | 31 | NSDictionary* options = @{ UIPageViewControllerOptionInterPageSpacingKey : [NSNumber numberWithFloat:4.0f] }; 32 | 33 | UIPageViewController *pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:options]; 34 | [pageViewController setViewControllers:_viewControllerArray direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:nil]; 35 | [pageViewController.view setBackgroundColor:[UIColor blackColor]]; 36 | [pageViewController setDelegate:self]; 37 | [pageViewController setDataSource:self]; 38 | 39 | 40 | // THIS IS A HACK INTO THE PAGEVIEWCONTROLLER 41 | // PROCEED WITH CAUTION 42 | // MAY CONTAIN BUG!! (I HAVENT RAN INTO ONE YET) 43 | // looking for the subview that is a scrollview so we can attach a delegate onto the view to mornitor scrolling 44 | for (UIView *subview in pageViewController.view.subviews) { 45 | if ([subview isKindOfClass:[UIScrollView class]]) { 46 | UIScrollView *scrollview = (UIScrollView *) subview; 47 | [scrollview setDelegate:self]; 48 | } 49 | } 50 | 51 | self.window.rootViewController = pageViewController; 52 | return YES; 53 | } 54 | 55 | - (void)applicationWillResignActive:(UIApplication *)application 56 | { 57 | // 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. 58 | // 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. 59 | } 60 | 61 | - (void)applicationDidEnterBackground:(UIApplication *)application 62 | { 63 | // 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. 64 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 65 | } 66 | 67 | - (void)applicationWillEnterForeground:(UIApplication *)application 68 | { 69 | // 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. 70 | } 71 | 72 | - (void)applicationDidBecomeActive:(UIApplication *)application 73 | { 74 | // 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. 75 | } 76 | 77 | - (void)applicationWillTerminate:(UIApplication *)application 78 | { 79 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 80 | } 81 | 82 | #pragma mark - Delegate & Datasource 83 | - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController 84 | { 85 | BTGlassScrollViewController *currentGlass = ((BTGlassScrollViewController*)(((UINavigationController *)viewController).viewControllers)[0]); 86 | _currentIndex = currentGlass.index; 87 | int replacementIndex = _currentIndex - 1; 88 | 89 | if (replacementIndex < 0) { 90 | return nil; 91 | } 92 | 93 | return _viewControllerArray[replacementIndex]; 94 | } 95 | 96 | - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController 97 | { 98 | BTGlassScrollViewController *currentGlass = (BTGlassScrollViewController*)(((UINavigationController *)viewController).viewControllers)[0]; 99 | _currentIndex = currentGlass.index; 100 | int replacementIndex = _currentIndex + 1; 101 | 102 | if (replacementIndex == NUMBER_OF_PAGES) { 103 | return nil; 104 | } 105 | 106 | UINavigationController *replacementViewController; 107 | if (_viewControllerArray.count == replacementIndex) { 108 | replacementViewController = [self glassScrollVCWithNavigatorForIndex:replacementIndex]; 109 | _viewControllerArray[replacementIndex] = replacementViewController; 110 | } else { 111 | replacementViewController = _viewControllerArray[replacementIndex]; 112 | } 113 | return replacementViewController; 114 | } 115 | 116 | - (void)pageViewController:(UIPageViewController *)pageViewController willTransitionToViewControllers:(NSArray *)pendingViewControllers 117 | { 118 | UINavigationController *navVC = _viewControllerArray[_currentIndex]; 119 | BTGlassScrollViewController *glassVC = navVC.viewControllers[0]; 120 | 121 | UINavigationController *pendingNavVC = pendingViewControllers[0]; 122 | BTGlassScrollViewController *pendingGlassVC = pendingNavVC.viewControllers[0]; 123 | 124 | [pendingGlassVC.glassScrollView scrollVerticallyToOffset:glassVC.glassScrollView.foregroundScrollView.contentOffset.y]; 125 | 126 | //this is a hack to make sure the blur does exactly what it should do 127 | if (glassVC.glassScrollView.foregroundScrollView.contentOffset.y > 0) { 128 | [pendingGlassVC.glassScrollView blurBackground:YES]; 129 | } 130 | } 131 | 132 | #pragma mark UIScrollview 133 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 134 | { 135 | // This is a custom ScrollView (private to Apple) 136 | // I found that they resets the scrolling everytime the viewController comes to rest 137 | // it rests at 360 (or width), left scroll causes it to decrease, right causes increase 138 | 139 | CGFloat ratio = (scrollView.contentOffset.x / scrollView.frame.size.width) - 1; 140 | 141 | 142 | // prevent any crazy behaviour due to lag 143 | // sometimes it resets itself when comes to reset and show crazy jumps 144 | if (ratio == 0) { 145 | return; 146 | } 147 | 148 | // retrieve views with index and +/- 1 149 | [((BTGlassScrollViewController*)(((UINavigationController *)_viewControllerArray[_currentIndex]).viewControllers)[0]).glassScrollView scrollHorizontalRatio:-ratio]; 150 | 151 | if (_currentIndex != 0) { 152 | // do the previous scroll 153 | [((BTGlassScrollViewController*)(((UINavigationController *)_viewControllerArray[_currentIndex - 1]).viewControllers)[0]).glassScrollView scrollHorizontalRatio:-ratio-1]; 154 | } 155 | 156 | if (_currentIndex != (_viewControllerArray.count - 1)) { 157 | // do the next scroll 158 | [((BTGlassScrollViewController*)(((UINavigationController *)_viewControllerArray[_currentIndex + 1]).viewControllers)[0]).glassScrollView scrollHorizontalRatio:-ratio+1]; 159 | } 160 | 161 | } 162 | 163 | #pragma mark - Make views 164 | // This method is useful when you want navigation bar, Otherwise return BTGlassScrollViewController object instead 165 | - (UINavigationController *)glassScrollVCWithNavigatorForIndex:(int)index 166 | { 167 | //Here is where you create your next view! 168 | UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController: [self glassScrollViewControllerForIndex:index]]; 169 | NSShadow *shadow = [[NSShadow alloc] init]; 170 | [shadow setShadowOffset:CGSizeMake(1, 1)]; 171 | [shadow setShadowColor:[UIColor blackColor]]; 172 | [shadow setShadowBlurRadius:1]; 173 | navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor], NSShadowAttributeName: shadow}; 174 | 175 | //weird voodoo to remove navigation bar background 176 | [navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 177 | [navigationController.navigationBar setShadowImage:[UIImage new]]; 178 | 179 | return navigationController; 180 | } 181 | 182 | - (BTGlassScrollViewController *)glassScrollViewControllerForIndex:(int)index 183 | { 184 | // This is just an example for a glassScrollViewController set up 185 | BTGlassScrollViewController *glassScrollViewController = [[BTGlassScrollViewController alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"background%i",index%2?2:3]]]; 186 | [glassScrollViewController setTitle:[NSString stringWithFormat:@"Title for #%i", index]]; 187 | [glassScrollViewController setIndex:index]; 188 | return glassScrollViewController; 189 | } 190 | 191 | @end 192 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/BTGlassScrollViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BTGlassScrollViewController.h 3 | // BTGlassScrollViewExample2 4 | // 5 | // Created by Byte on 1/23/14. 6 | // Copyright (c) 2014 Byte. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BTGlassScrollView.h" 11 | 12 | @interface BTGlassScrollViewController : UIViewController 13 | @property (nonatomic, assign) int index; 14 | @property (nonatomic, strong) BTGlassScrollView *glassScrollView; 15 | - (id)initWithImage:(UIImage *)image; 16 | @end 17 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/BTGlassScrollViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BTGlassScrollViewController.m 3 | // BTGlassScrollViewExample2 4 | // 5 | // Created by Byte on 1/23/14. 6 | // Copyright (c) 2014 Byte. All rights reserved. 7 | // 8 | 9 | #import "BTGlassScrollViewController.h" 10 | 11 | @interface BTGlassScrollViewController () 12 | 13 | @end 14 | 15 | @implementation BTGlassScrollViewController 16 | 17 | - (id)initWithImage:(UIImage *)image 18 | { 19 | self = [super init]; 20 | if (self) { 21 | _glassScrollView = [[BTGlassScrollView alloc] initWithFrame:self.view.frame BackgroundImage:image blurredImage:nil viewDistanceFromBottom:120 foregroundView:[self customView]]; 22 | [self.view addSubview:_glassScrollView]; 23 | } 24 | return self; 25 | } 26 | 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | 32 | //white status bar 33 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 34 | 35 | //preventing weird inset 36 | [self setAutomaticallyAdjustsScrollViewInsets:NO]; 37 | 38 | //background 39 | self.view.backgroundColor = [UIColor blackColor]; 40 | } 41 | 42 | - (void)viewWillAppear:(BOOL)animated 43 | { 44 | [self.navigationController.navigationBar setBarTintColor:[UIColor clearColor]]; 45 | 46 | } 47 | 48 | - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 49 | { 50 | //reset offset when rotate 51 | [_glassScrollView scrollVerticallyToOffset:-_glassScrollView.foregroundScrollView.contentInset.top]; 52 | 53 | } 54 | 55 | - (void)viewWillLayoutSubviews 56 | { 57 | [_glassScrollView setTopLayoutGuideLength:[self.topLayoutGuide length]]; 58 | } 59 | 60 | - (void)didReceiveMemoryWarning 61 | { 62 | [super didReceiveMemoryWarning]; 63 | // Dispose of any resources that can be recreated. 64 | } 65 | 66 | 67 | - (UIView *)customView 68 | { 69 | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 705)]; 70 | 71 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 310, 120)]; 72 | [label setText:[NSString stringWithFormat:@"%i℉",arc4random_uniform(20) + 60]]; 73 | [label setTextColor:[UIColor whiteColor]]; 74 | [label setFont:[UIFont fontWithName:@"HelveticaNeue-UltraLight" size:120]]; 75 | [label setShadowColor:[UIColor blackColor]]; 76 | [label setShadowOffset:CGSizeMake(1, 1)]; 77 | [view addSubview:label]; 78 | 79 | UIView *box1 = [[UIView alloc] initWithFrame:CGRectMake(5, 140, 310, 125)]; 80 | box1.layer.cornerRadius = 3; 81 | box1.backgroundColor = [UIColor colorWithWhite:0 alpha:.15]; 82 | [view addSubview:box1]; 83 | 84 | UIView *box2 = [[UIView alloc] initWithFrame:CGRectMake(5, 270, 310, 300)]; 85 | box2.layer.cornerRadius = 3; 86 | box2.backgroundColor = [UIColor colorWithWhite:0 alpha:.15]; 87 | [view addSubview:box2]; 88 | 89 | UIView *box3 = [[UIView alloc] initWithFrame:CGRectMake(5, 575, 310, 125)]; 90 | box3.layer.cornerRadius = 3; 91 | box3.backgroundColor = [UIColor colorWithWhite:0 alpha:.15]; 92 | [view addSubview:box3]; 93 | 94 | return view; 95 | } 96 | @end 97 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/BTGlassScrollViewExample2-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIViewControllerBasedStatusBarAppearance 6 | 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleDisplayName 10 | ${PRODUCT_NAME} 11 | CFBundleExecutable 12 | ${EXECUTABLE_NAME} 13 | CFBundleIdentifier 14 | com.BTLibrary.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/BTGlassScrollViewExample2-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_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/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 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/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 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/Images.xcassets/background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "Image.png" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/Images.xcassets/background.imageset/Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTLibrary/BTGlassScrollView/24b290e8e8b2a2effbd10db2656435eda503c4b3/BTGlassScrollViewExample2/BTGlassScrollViewExample2/Images.xcassets/background.imageset/Image.png -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/Images.xcassets/background2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "Image.png" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/Images.xcassets/background2.imageset/Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTLibrary/BTGlassScrollView/24b290e8e8b2a2effbd10db2656435eda503c4b3/BTGlassScrollViewExample2/BTGlassScrollViewExample2/Images.xcassets/background2.imageset/Image.png -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/Images.xcassets/background3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "landscapes-sea_00343155.png" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/Images.xcassets/background3.imageset/landscapes-sea_00343155.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTLibrary/BTGlassScrollView/24b290e8e8b2a2effbd10db2656435eda503c4b3/BTGlassScrollViewExample2/BTGlassScrollViewExample2/Images.xcassets/background3.imageset/landscapes-sea_00343155.png -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BTGlassScrollViewExample2 4 | // 5 | // Created by Byte on 1/23/14. 6 | // Copyright (c) 2014 Byte. 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 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2Tests/BTGlassScrollViewExample2Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.BTLibrary.${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 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2Tests/BTGlassScrollViewExample2Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // BTGlassScrollViewExample2Tests.m 3 | // BTGlassScrollViewExample2Tests 4 | // 5 | // Created by Byte on 1/23/14. 6 | // Copyright (c) 2014 Byte. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BTGlassScrollViewExample2Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation BTGlassScrollViewExample2Tests 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 | -------------------------------------------------------------------------------- /BTGlassScrollViewExample2/BTGlassScrollViewExample2Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Gifs/Horizontal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTLibrary/BTGlassScrollView/24b290e8e8b2a2effbd10db2656435eda503c4b3/Gifs/Horizontal.gif -------------------------------------------------------------------------------- /Gifs/Vertical.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTLibrary/BTGlassScrollView/24b290e8e8b2a2effbd10db2656435eda503c4b3/Gifs/Vertical.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | BTGlassScrollView 2 | ================= 3 | 4 | ![Vertical](/Gifs/Vertical.gif) _ ![Horizontal](/Gifs/Horizontal.gif) 5 | 6 | This is a view for you to either use as-is or modify the source. The view comes loaded with the ability to: 7 | 8 | 1. Create a self contained view replicating the look and feel of one panel of Yahoo! Weather app 9 | 2. Blur the background image and/or transform them just the right amount without additional code form you 10 | 3. Customized the animation/blur/height/shadow/etc. with a chagne of a number in the header #define 11 | 4. Just work! like magic! 12 | 13 | **Background:** 14 | I have been a big fan of Yahoo! weather app. I highly respect the work they have done. I wanted to replicate and also generalize the approach for anyone to use and/or study. This was not associated with Yahoo! No source was lifted from Yahoo! So there will be a few subtle differences between BTGlassScrollView and Yahoo! weather app. For example, this view is built to stay under one navigation bar which in turns allows for "swipe to back" on iOS7. 15 | 16 | **Implementation:** 17 | The view is a subclass of a UIView. It contains 2 scrollViews, background and foreground. backgroundScrollView consists of 2 imageviews, normal and blurred. The alpha of the blurred one changes as the background scrolls. And the background scrolls as the foreground scrolls (at a different rate). The foregroundScrollView consists of maskLayers (gradient) and the foregroundView (which is whatever you want it to be). Between foreground and background, 2 shadowsLayer is added on the top and bottom to give a better readability. 18 | 19 | **How to use (Simple Version):** 20 | 21 | 1. Import `BTGlassScrollView.h` 22 | 2. Create an instance of glassScrollViewwith `- (id)initWithFrame:(CGRect)frame BackgroundImage:(UIImage *)backgroundImage blurredImage:(UIImage *)blurredImage viewDistanceFromBottom:(CGFloat)viewDistanceFromBottom foregroundView:(UIView *)foregroundView` and add it as subview to whereever you need it to be 23 | 2a. `backgroundImage` is essential, pick the right one makes all the difference 24 | 2b. `blurredImage` is not neccessary but you can provide your own customed one 25 | 2c. `viewDistanceFromBottom` is how much your foregroundView is visible from the bottom (like Yahoo! temperature) 26 | 2d. `foregroundView` is your info view 27 | 4. Adjustment - due to generalization, you need to set the top padding to allow navigation bar/ status bar to get unmasked. Call `- (void)setTopLayoutGuideLength:(CGFloat)topLayoutGuideLength` where appropriate (Usually at `viewWillLayoutSubviews` in your view controller 28 | 29 | Please view example project to get the idea of how to implement. 30 | 31 | **How to implement Yahoo! like horizontal Scroll:** 32 | *To Be Added - it is in the example just not explained in words* 33 | 34 | **Note:** 35 | The example provided are mix of 3 * 2 flavor. 3 ways to create viewController and 2 ways to implement the view. Uncomment the code in Appdelegate to see the different ways of creating ViewController and change the `#define SIMPLE_SAMPLE` to see the two ways of implementing 36 | 37 | *3 ways to create viewController:* 38 | 39 | 1. plain vanilla viewController 40 | 2. viewController with NavigationController 41 | 3. viewController as a second screen of NavigationController 42 | 43 | *2 ways to implement the view* 44 | 45 | 1. simple implementation 46 | 2. complex horizontal scroll implementation 47 | 48 | ---- 49 | 50 | **Example 2 Note** 51 | *It is not without its bug. I would be very glad if someone can help fixing it* 52 | Known issues: 53 | 54 | 1. the scrolling flickers at times (Will be addressed soon!) 55 | 2. some of the method is a hack (heed the warning of the comment) 56 | 57 | ---- 58 | 59 | **Copyright 2014 Byte** 60 | 61 | Licensed under the Apache License, Version 2.0 (the "License"); 62 | you may not use this file except in compliance with the License. 63 | You may obtain a copy of the License at 64 | 65 | http://www.apache.org/licenses/LICENSE-2.0 66 | 67 | Unless required by applicable law or agreed to in writing, software 68 | distributed under the License is distributed on an "AS IS" BASIS, 69 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 70 | See the License for the specific language governing permissions and 71 | limitations under the License. 72 | --------------------------------------------------------------------------------