diff --git a/APParallaxHeader/UIScrollView+APParallaxHeader.h b/APParallaxHeader/UIScrollView+APParallaxHeader.h index e96365e..d749b3f 100755 --- a/APParallaxHeader/UIScrollView+APParallaxHeader.h +++ b/APParallaxHeader/UIScrollView+APParallaxHeader.h @@ -14,12 +14,83 @@ @interface UIScrollView (APParallaxHeader) -- (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height andShadow:(BOOL)shadow; +/** + * Adds a parallax with an image and an initial height. + * + * @param image An UIImage to parallax when scrolling. + * @param height The max height for the parallax header. + */ - (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height; -- (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height; + +/** + * Adds a parallax with an image and an initial height. + * + * @param image An UIImage to parallax when scrolling. + * @param height The max height for the parallax header. + * @param minHeight The min height for the parallax header. + */ +- (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height andMinHeight:(CGFloat)minHeight; + +/** + * Adds a parallax with an image, an initial height and a bottom inner shadow. + * + * @param image An UIImage to parallax when scrolling. + * @param height The max height for the parallax header + * @param shadow BOOL to show or hide the bottom inner shadow. + */ +- (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height andShadow:(BOOL)shadow; + +/** + * Adds a parallax with an image and an initial height. + * + * @param image An UIImage to parallax when scrolling. + * @param height The max height for the parallax header. + * @param minHeight The min height for the parallax header. + * @param shadow BOOL to show or hide the bottom inner shadow. + */ +- (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height andMinHeight:(CGFloat)minHeight andShadow:(BOOL)shadow; + +/** + * Adds a parallax with a custom view with a given initial height. + * + * @param view A UIView to display in the parallax header. + * @param height The max height for the parallax header. + */ +- (void)addParallaxWithView:(UIView *)view andHeight:(CGFloat)height; + +/** + * Adds a parallax with a custom view with a given initial height and minimum height. + * + * @param view A UIView to display in the parallax header. + * @param height The max height for the parallax header. + * @param minHeight The min height for the parallax header. + */ +- (void)addParallaxWithView:(UIView *)view andHeight:(CGFloat)height andMinHeight:(CGFloat)minHeight; + +/** + * Adds a parallax with a custom view with a given initial height and a bottom inner shadow. + * + * @param view A UIView to display in the parallax header. + * @param height The max height for the parallax header. + * @param shadow BOOL to show or hide the bottom inner shadow. + */ - (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height andShadow:(BOOL)shadow; +/** + * Adds a parallax with a custom view with a given initial height and a bottom inner shadow. + * + * @param view A UIView to display in the parallax header. + * @param height The max height for the parallax header. + * @param minHeight The min height for the parallax header. + * @param shadow BOOL to show or hide the bottom inner shadow. + */ +- (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height andMinHeight:(CGFloat)minHeight andShadow:(BOOL)shadow; + +/** + * Getter for the parallaxView + */ @property (nonatomic, strong, readonly) APParallaxView *parallaxView; + @property (nonatomic, assign) BOOL showsParallax; @end @@ -39,7 +110,6 @@ typedef NS_ENUM(NSUInteger, APParallaxTrackingState) { @property (nonatomic, readonly) APParallaxTrackingState state; @property (nonatomic, strong) UIImageView *imageView; -@property (nonatomic, strong) UIView *currentSubView; @property (nonatomic, strong) APParallaxShadowView *shadowView; @property (nonatomic, strong) UIView *customView; @@ -47,9 +117,26 @@ typedef NS_ENUM(NSUInteger, APParallaxTrackingState) { @end +/** + * The APParallaxView delegate will allow you to get information for when the + * parallax header view will change its frame, so that you can do your repositioning etc. + */ @protocol APParallaxViewDelegate @optional +/** + * Delegate call for when the APParallaxView will change its frame. + * + * @param view The APParallaxView that will change its frame. + * @param frame The target frame. + */ - (void)parallaxView:(APParallaxView *)view willChangeFrame:(CGRect)frame; + +/** + * Delegate call for when the APParallaxView did change its frame. + * + * @param view The APParallaxView that changed its frame. + * @param frame The target frame. + */ - (void)parallaxView:(APParallaxView *)view didChangeFrame:(CGRect)frame; @end diff --git a/APParallaxHeader/UIScrollView+APParallaxHeader.m b/APParallaxHeader/UIScrollView+APParallaxHeader.m index b9106ea..c4b557f 100755 --- a/APParallaxHeader/UIScrollView+APParallaxHeader.m +++ b/APParallaxHeader/UIScrollView+APParallaxHeader.m @@ -9,6 +9,8 @@ #import +static char contentOffsetContext; + @interface APParallaxView () @property (nonatomic, readwrite) APParallaxTrackingState state; @@ -16,13 +18,12 @@ @interface APParallaxView () @property (nonatomic, weak) UIScrollView *scrollView; @property (nonatomic, readwrite) CGFloat originalTopInset; @property (nonatomic) CGFloat parallaxHeight; +@property (nonatomic) CGFloat parallaxMinHeight; @property(nonatomic, assign) BOOL isObserving; @end - - #pragma mark - UIScrollView (APParallaxHeader) #import @@ -34,21 +35,30 @@ - (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height { [self addParallaxWithImage:image andHeight:height andShadow:YES]; } +- (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height andMinHeight:(CGFloat)minHeight { + [self addParallaxWithImage:image andHeight:height andShadow:YES]; +} + - (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height andShadow:(BOOL)shadow { + [self addParallaxWithImage:image andHeight:height andMinHeight:0 andShadow:shadow]; +} + +- (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height andMinHeight:(CGFloat)minHeight andShadow:(BOOL)shadow { if(self.parallaxView) { - if(self.parallaxView.currentSubView) { - [self.parallaxView.currentSubView removeFromSuperview]; + if(self.parallaxView.customView) { + [self.parallaxView.customView removeFromSuperview]; } [self.parallaxView.imageView setImage:image]; } - else - { - APParallaxView *parallaxView = [[APParallaxView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width*2, height) andShadow:shadow]; + else { + APParallaxView *parallaxView = [[APParallaxView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, height) andShadow:shadow]; + [parallaxView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight]; [parallaxView setClipsToBounds:YES]; [parallaxView.imageView setImage:image]; parallaxView.scrollView = self; parallaxView.parallaxHeight = height; + parallaxView.parallaxMinHeight = minHeight; [self addSubview:parallaxView]; parallaxView.originalTopInset = self.contentInset.top; @@ -66,23 +76,33 @@ - (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height { [self addParallaxWithView:view andHeight:height andShadow:YES]; } +- (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height andMinHeight:(CGFloat)minHeight { + [self addParallaxWithView:view andHeight:height andMinHeight:minHeight andShadow:YES]; +} + - (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height andShadow:(BOOL)shadow { + [self addParallaxWithView:view andHeight:height andMinHeight:0 andShadow:shadow]; +} + +- (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height andMinHeight:(CGFloat)minHeight andShadow:(BOOL)shadow { if(self.parallaxView) { - [self.parallaxView.currentSubView removeFromSuperview]; + [self.parallaxView.customView removeFromSuperview]; [view setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight]; [self.parallaxView setCustomView:view]; } else { APParallaxView *parallaxView = [[APParallaxView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, height) andShadow:shadow]; + [parallaxView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight]; [parallaxView setClipsToBounds:YES]; - [parallaxView setCustomView:view]; parallaxView.scrollView = self; parallaxView.parallaxHeight = height; + parallaxView.parallaxMinHeight = minHeight; + [self addSubview:parallaxView]; - + parallaxView.originalTopInset = self.contentInset.top; UIEdgeInsets newInset = self.contentInset; @@ -110,14 +130,12 @@ - (void)setShowsParallax:(BOOL)showsParallax { if(!showsParallax) { if (self.parallaxView.isObserving) { [self removeObserver:self.parallaxView forKeyPath:@"contentOffset"]; - [self removeObserver:self.parallaxView forKeyPath:@"frame"]; self.parallaxView.isObserving = NO; } } else { if (!self.parallaxView.isObserving) { - [self addObserver:self.parallaxView forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:nil]; - [self addObserver:self.parallaxView forKeyPath:@"frame" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self.parallaxView forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:&contentOffsetContext]; self.parallaxView.isObserving = YES; } } @@ -127,6 +145,10 @@ - (BOOL)showsParallax { return !self.parallaxView.hidden; } +- (void)didMoveToSuperview { + [super didMoveToSuperview]; +} + @end #pragma mark - ShadowLayer @@ -151,7 +173,7 @@ - (void)drawRect:(CGRect)rect { //// Gradient Declarations NSArray* gradient3Colors = [NSArray arrayWithObjects: - (id)[UIColor colorWithWhite:0 alpha:0.3].CGColor, + (id)[UIColor colorWithWhite:0 alpha:0.2].CGColor, (id)[UIColor clearColor].CGColor, nil]; CGFloat gradient3Locations[] = {0, 1}; CGGradientRef gradient3 = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef)gradient3Colors, gradient3Locations); @@ -167,7 +189,6 @@ - (void)drawRect:(CGRect)rect { //// Cleanup CGGradientRelease(gradient3); CGColorSpaceRelease(colorSpace); - } @end @@ -221,18 +242,12 @@ - (void)willMoveToSuperview:(UIView *)newSuperview { if (self.isObserving) { //If enter this branch, it is the moment just before "APParallaxView's dealloc", so remove observer here [scrollView removeObserver:self forKeyPath:@"contentOffset"]; - [scrollView removeObserver:self forKeyPath:@"frame"]; self.isObserving = NO; } } } } -- (void)addSubview:(UIView *)view { - [super addSubview:view]; - self.currentSubView = view; -} - - (void)setCustomView:(UIView *)customView { if (_customView) { @@ -241,50 +256,59 @@ - (void)setCustomView:(UIView *)customView _customView = customView; - [self addSubview:customView]; - [customView setTranslatesAutoresizingMaskIntoConstraints:NO]; - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[customView]|" options:0 metrics:nil views:@{@"customView" : customView}]]; - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[customView]|" options:0 metrics:nil views:@{@"customView" : customView}]]; -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - if (self.shadowView) { - [self bringSubviewToFront:self.shadowView]; + [self insertSubview:customView belowSubview:self.shadowView]; } + else { + [self addSubview:customView]; + } + + [self.customView setTranslatesAutoresizingMaskIntoConstraints:NO]; + [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[customView]|" options:0 metrics:nil views:@{@"customView" : self.customView}]]; + [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[customView]|" options:0 metrics:nil views:@{@"customView" : self.customView}]]; } #pragma mark - Observing - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if([keyPath isEqualToString:@"contentOffset"]) { + if(context == &contentOffsetContext) { [self scrollViewDidScroll:[[change valueForKey:NSKeyValueChangeNewKey] CGPointValue]]; } - else if([keyPath isEqualToString:@"frame"]) { - [self layoutSubviews]; +} + +- (void)setFrame:(CGRect)frame { + if ([self.delegate respondsToSelector:@selector(parallaxView:willChangeFrame:)]) { + [self.delegate parallaxView:self willChangeFrame:self.frame]; + } + + [super setFrame:frame]; + + if ([self.delegate respondsToSelector:@selector(parallaxView:didChangeFrame:)]) { + [self.delegate parallaxView:self didChangeFrame:self.frame]; } } - (void)scrollViewDidScroll:(CGPoint)contentOffset { - // We do not want to track when the parallax view is hidden - if (contentOffset.y > 0) { + // We do not want to track when the parallax view is hidden + if (contentOffset.y > 0 && self.parallaxMinHeight == 0) { [self setState:APParallaxTrackingInactive]; } else { [self setState:APParallaxTrackingActive]; } - - if(self.state == APParallaxTrackingActive) { + + if(self.state == APParallaxTrackingActive) { + // Resize/reposition the parallaxView based on the content offset CGFloat yOffset = contentOffset.y*-1; - if ([self.delegate respondsToSelector:@selector(parallaxView:willChangeFrame:)]) { - [self.delegate parallaxView:self willChangeFrame:self.frame]; + CGFloat height = MAX(self.parallaxMinHeight, yOffset); + [self setFrame:CGRectMake(0, contentOffset.y, CGRectGetWidth(self.frame), height)]; + + // Correct the scroll indicator position + // Without this the scroll indicator will be displayed on top of the parallax view + if (self.scrollView.contentOffset.y < -self.parallaxHeight) { + [self.scrollView setScrollIndicatorInsets:UIEdgeInsetsMake(self.scrollView.contentInset.top+(abs(self.scrollView.contentOffset.y)-self.parallaxHeight), 0, 0, 0)]; } - - [self setFrame:CGRectMake(0, contentOffset.y, CGRectGetWidth(self.frame), yOffset)]; - - if ([self.delegate respondsToSelector:@selector(parallaxView:didChangeFrame:)]) { - [self.delegate parallaxView:self didChangeFrame:self.frame]; + else { + [self.scrollView setScrollIndicatorInsets:UIEdgeInsetsMake(self.scrollView.contentInset.top, 0, 0, 0)]; } } } diff --git a/Demo/APParallaxHeaderDemo.xcodeproj/project.pbxproj b/Demo/APParallaxHeaderDemo.xcodeproj/project.pbxproj index afc3e96..e5e1a85 100644 --- a/Demo/APParallaxHeaderDemo.xcodeproj/project.pbxproj +++ b/Demo/APParallaxHeaderDemo.xcodeproj/project.pbxproj @@ -20,7 +20,6 @@ C72B5335171834E60093E24F /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C72B5334171834E60093E24F /* Default-568h@2x.png */; }; C72B5338171834E60093E24F /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C72B5336171834E60093E24F /* MainStoryboard.storyboard */; }; C72B533B171834E60093E24F /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C72B533A171834E60093E24F /* MasterViewController.m */; }; - C7AC21E319E57B1200BF5C83 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C7AC21E219E57B1200BF5C83 /* Launch Screen.xib */; }; C7E3C5FF17183E4500489EE2 /* ParallaxImage.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C7E3C5FE17183E4500489EE2 /* ParallaxImage.jpg */; }; C7E3C605171842CA00489EE2 /* UIScrollView+APParallaxHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = C7E3C604171842CA00489EE2 /* UIScrollView+APParallaxHeader.m */; }; /* End PBXBuildFile section */ @@ -44,7 +43,6 @@ C72B5337171834E60093E24F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; C72B5339171834E60093E24F /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; C72B533A171834E60093E24F /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; - C7AC21E219E57B1200BF5C83 /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; C7E3C5FE17183E4500489EE2 /* ParallaxImage.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = ParallaxImage.jpg; sourceTree = ""; }; C7E3C603171842CA00489EE2 /* UIScrollView+APParallaxHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+APParallaxHeader.h"; sourceTree = ""; }; C7E3C604171842CA00489EE2 /* UIScrollView+APParallaxHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+APParallaxHeader.m"; sourceTree = ""; }; @@ -103,7 +101,6 @@ C72B5339171834E60093E24F /* MasterViewController.h */, C72B533A171834E60093E24F /* MasterViewController.m */, C72B5325171834E60093E24F /* Supporting Files */, - C7AC21E219E57B1200BF5C83 /* Launch Screen.xib */, ); path = APParallaxHeaderDemo; sourceTree = ""; @@ -162,6 +159,11 @@ attributes = { LastUpgradeCheck = 0460; ORGANIZATIONNAME = "Apping AB"; + TargetAttributes = { + C72B531A171834E60093E24F = { + DevelopmentTeam = V98K4C44UG; + }; + }; }; buildConfigurationList = C72B5316171834E60093E24F /* Build configuration list for PBXProject "APParallaxHeaderDemo" */; compatibilityVersion = "Xcode 3.2"; @@ -190,7 +192,6 @@ C72B5333171834E60093E24F /* Default@2x.png in Resources */, C72B5335171834E60093E24F /* Default-568h@2x.png in Resources */, C72B5338171834E60093E24F /* MainStoryboard.storyboard in Resources */, - C7AC21E319E57B1200BF5C83 /* Launch Screen.xib in Resources */, C7E3C5FF17183E4500489EE2 /* ParallaxImage.jpg in Resources */, A697F31F17A02B5F003B821D /* Rover.jpg in Resources */, ); @@ -291,11 +292,14 @@ C72B5342171834E60093E24F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "APParallaxHeaderDemo/APParallaxHeaderDemo-Prefix.pch"; INFOPLIST_FILE = "APParallaxHeaderDemo/APParallaxHeaderDemo-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.1; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = app; }; name = Debug; @@ -303,11 +307,14 @@ C72B5343171834E60093E24F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "APParallaxHeaderDemo/APParallaxHeaderDemo-Prefix.pch"; INFOPLIST_FILE = "APParallaxHeaderDemo/APParallaxHeaderDemo-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.1; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/Demo/APParallaxHeaderDemo/MasterViewController.m b/Demo/APParallaxHeaderDemo/MasterViewController.m index 981c109..166c930 100644 --- a/Demo/APParallaxHeaderDemo/MasterViewController.m +++ b/Demo/APParallaxHeaderDemo/MasterViewController.m @@ -9,9 +9,12 @@ #import "MasterViewController.h" #import "UIScrollView+APParallaxHeader.h" -@interface MasterViewController () { - BOOL parallaxWithView; -} +#define PARALLAX_HEIGHT 320 + +@interface MasterViewController () + +@property (nonatomic) BOOL parallaxWithView; + @end @implementation MasterViewController @@ -21,6 +24,10 @@ - (void)viewDidLoad { UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithTitle:@"with view" style:UIBarButtonItemStylePlain target:self action:@selector(toggle:)]; [self.navigationItem setRightBarButtonItem:barButton]; + + [self.navigationController.navigationBar setShadowImage:[UIImage new]]; + + self.automaticallyAdjustsScrollViewInsets = NO; [self toggle:nil]; } @@ -30,13 +37,13 @@ - (void)toggle:(id)sender { * For demo purposes this view controller either adds a parallaxView with a custom view * or a parallaxView with an image. */ - if(parallaxWithView == NO) { + if(_parallaxWithView == NO) { // add parallax with view UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Rover.jpg"]]; - [imageView setFrame:CGRectMake(0, 0, 320, 160)]; + [imageView setFrame:CGRectMake(0, 0, 320, PARALLAX_HEIGHT)]; [imageView setContentMode:UIViewContentModeScaleAspectFill]; - [self.tableView addParallaxWithView:imageView andHeight:160]; - parallaxWithView = YES; + [self.tableView addParallaxWithView:imageView andHeight:PARALLAX_HEIGHT]; + _parallaxWithView = YES; // Update the toggle button UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithTitle:@"with image" style:UIBarButtonItemStylePlain target:self action:@selector(toggle:)]; @@ -44,8 +51,8 @@ - (void)toggle:(id)sender { } else { // add parallax with image - [self.tableView addParallaxWithImage:[UIImage imageNamed:@"ParallaxImage.jpg"] andHeight:160 andShadow:YES]; - parallaxWithView = NO; + [self.tableView addParallaxWithImage:[UIImage imageNamed:@"ParallaxImage.jpg"] andHeight:PARALLAX_HEIGHT andMinHeight:128 andShadow:YES]; + _parallaxWithView = NO; // Update the toggle button UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithTitle:@"with view" style:UIBarButtonItemStylePlain target:self action:@selector(toggle:)]; @@ -74,7 +81,7 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; - cell.textLabel.text = [NSString stringWithFormat:@"Row %li", indexPath.row+1]; + cell.textLabel.text = [NSString stringWithFormat:@"Row %i", (NSInteger)indexPath.row+1]; return cell; } diff --git a/Demo/APParallaxHeaderDemo/en.lproj/MainStoryboard.storyboard b/Demo/APParallaxHeaderDemo/en.lproj/MainStoryboard.storyboard index e2cdc06..395d1c6 100644 --- a/Demo/APParallaxHeaderDemo/en.lproj/MainStoryboard.storyboard +++ b/Demo/APParallaxHeaderDemo/en.lproj/MainStoryboard.storyboard @@ -1,7 +1,9 @@ - + - + + + @@ -20,19 +22,19 @@ - + - - - + + + - + - + @@ -44,8 +46,7 @@ - - + @@ -55,6 +56,7 @@ + @@ -62,14 +64,12 @@ - - - - - - + + + + - \ No newline at end of file + diff --git a/Demo/Podfile b/Demo/Podfile new file mode 100644 index 0000000..633d3d0 --- /dev/null +++ b/Demo/Podfile @@ -0,0 +1,2 @@ +# Uncomment this line to define a global platform for your project +platform :ios, "7.0" diff --git a/Demo/Podfile.lock b/Demo/Podfile.lock new file mode 100644 index 0000000..ef12354 --- /dev/null +++ b/Demo/Podfile.lock @@ -0,0 +1,3 @@ +PODFILE CHECKSUM: 1add239d217c918b094ea5307c0da22e83d84c0d + +COCOAPODS: 1.0.0