diff --git a/GBInfiniteScrollView/GBInfiniteScrollView.xcodeproj/project.pbxproj b/GBInfiniteScrollView/GBInfiniteScrollView.xcodeproj/project.pbxproj index 83cfdd2..e74e02a 100644 --- a/GBInfiniteScrollView/GBInfiniteScrollView.xcodeproj/project.pbxproj +++ b/GBInfiniteScrollView/GBInfiniteScrollView.xcodeproj/project.pbxproj @@ -20,6 +20,8 @@ 4388DC371801A3280074CABE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4388DC351801A3280074CABE /* InfoPlist.strings */; }; 4388DC391801A3280074CABE /* GBInfiniteScrollViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4388DC381801A3280074CABE /* GBInfiniteScrollViewTests.m */; }; 4388DC441801A3460074CABE /* GBInfiniteScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4388DC431801A3460074CABE /* GBInfiniteScrollView.m */; }; + 438EF525194C482D00756049 /* GBInfiniteScrollViewWithPageControl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 11279485194B800C008D22A2 /* GBInfiniteScrollViewWithPageControl.h */; }; + 438EF527194C484100756049 /* FXPageControl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 11279482194B800C008D22A2 /* FXPageControl.h */; }; 43E7ABCE184C9CA4007211A5 /* GBInfiniteScrollViewPage.m in Sources */ = {isa = PBXBuildFile; fileRef = 43E7ABCD184C9CA4007211A5 /* GBInfiniteScrollViewPage.m */; }; 43E7ABCF184CE0A8007211A5 /* GBInfiniteScrollViewPage.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 43E7ABCC184C9CA4007211A5 /* GBInfiniteScrollViewPage.h */; }; /* End PBXBuildFile section */ @@ -37,10 +39,12 @@ /* Begin PBXCopyFilesBuildPhase section */ 4388DC171801A3280074CABE /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; + buildActionMask = 12; dstPath = "include/$(PRODUCT_NAME)"; dstSubfolderSpec = 16; files = ( + 438EF527194C484100756049 /* FXPageControl.h in CopyFiles */, + 438EF525194C482D00756049 /* GBInfiniteScrollViewWithPageControl.h in CopyFiles */, 43E7ABCF184CE0A8007211A5 /* GBInfiniteScrollViewPage.h in CopyFiles */, 4357F3DF1801B3C700EF282B /* GBInfiniteScrollView.h in CopyFiles */, ); diff --git a/GBInfiniteScrollViewDemo/GBInfiniteScrollViewDemo/GBViewController.m b/GBInfiniteScrollViewDemo/GBInfiniteScrollViewDemo/GBViewController.m index a9e2e24..b5678ae 100644 --- a/GBInfiniteScrollViewDemo/GBInfiniteScrollViewDemo/GBViewController.m +++ b/GBInfiniteScrollViewDemo/GBInfiniteScrollViewDemo/GBViewController.m @@ -69,7 +69,7 @@ - (void)setUp self.infiniteScrollView.interval = 3.0f; self.infiniteScrollView.pageIndex = 0; self.infiniteScrollView.autoScrollDirection = GBAutoScrollDirectionRightToLeft; - self.infiniteScrollView.scrollDirection = GBScrollDirectionHorizontal; //GBScrollDirectionVertical; + self.infiniteScrollView.scrollDirection = GBScrollDirectionHorizontal; [self.view addSubview:self.infiniteScrollView]; diff --git a/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/GBViewController.m b/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/GBViewController.m index a78b22c..dd1abde 100644 --- a/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/GBViewController.m +++ b/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/GBViewController.m @@ -10,7 +10,7 @@ #import "GBPageRecord.h" -static CGFloat const GBNumberOfPages = 1000.0f; +static CGFloat const GBNumberOfPages = 20.0f; static CGFloat const GBMaxNumberOfPages = 10000.0f; @interface GBViewController () @@ -25,8 +25,8 @@ @interface GBViewController () @property (nonatomic, strong) UIButton *addButton; @property (nonatomic, strong) UIColor *color; @property (nonatomic) GBAutoScrollDirection autoScrollDirection; -@property(nonatomic) CGAffineTransform rightToLeftTransform; -@property(nonatomic) CGAffineTransform leftToRightTransform; +@property(nonatomic) CGAffineTransform topToBottomTransform; +@property(nonatomic) CGAffineTransform bottomToTopTransform; @property(nonatomic) BOOL debug; @end @@ -61,6 +61,8 @@ - (void)setUp [self addRandomColorPage]; } + self.autoScrollDirection = GBAutoScrollDirectionBottomToTop; + self.infiniteScrollView = [[GBInfiniteScrollViewWithPageControl alloc] initWithFrame:self.view.bounds]; self.infiniteScrollView.infiniteScrollViewDataSource = self; self.infiniteScrollView.infiniteScrollViewDelegate = self; @@ -68,11 +70,10 @@ - (void)setUp self.infiniteScrollView.verboseDebug = verboseDebug; self.infiniteScrollView.interval = 3.0f; self.infiniteScrollView.pageIndex = 0; - self.infiniteScrollView.autoScrollDirection = GBAutoScrollDirectionRightToLeft; - - self.infiniteScrollView.scrollDirection = GBScrollDirectionVertical; //GBScrollDirectionHorizontal; + self.infiniteScrollView.autoScrollDirection = self.autoScrollDirection; + self.infiniteScrollView.scrollDirection = GBScrollDirectionVertical; - self.infiniteScrollView.pageControlPosition = GBPageControlPositionHorizontalBottom; + self.infiniteScrollView.pageControlPosition = GBPageControlPositionVerticalLeft; [self.infiniteScrollView.pageControlViewContainer.pageControl setDotColor:[UIColor whiteColor]]; [self.view addSubview:self.infiniteScrollView]; @@ -127,9 +128,9 @@ - (void)setUpDirectionButton [self.view addConstraint:left]; - self.leftToRightTransform = self.directionButton.transform; - self.rightToLeftTransform = CGAffineTransformRotate(self.directionButton.transform, M_PI); - self.directionButton.transform = self.rightToLeftTransform; + self.bottomToTopTransform = self.directionButton.transform; + self.topToBottomTransform = CGAffineTransformRotate(self.directionButton.transform, M_PI); + self.directionButton.transform = self.bottomToTopTransform; } - (void)setUpInfoButton @@ -297,12 +298,12 @@ - (void)switchDirection CGAffineTransform transform; GBAutoScrollDirection autoScrollDirection; - if (self.autoScrollDirection == GBAutoScrollDirectionLeftToRight) { - transform = self.rightToLeftTransform; - autoScrollDirection = GBAutoScrollDirectionRightToLeft; - } else if (self.autoScrollDirection == GBAutoScrollDirectionRightToLeft) { - transform = self.leftToRightTransform; - autoScrollDirection = GBAutoScrollDirectionLeftToRight; + if (self.autoScrollDirection == GBAutoScrollDirectionBottomToTop) { + transform = self.topToBottomTransform; + autoScrollDirection = GBAutoScrollDirectionTopToBottom; + } else if (self.autoScrollDirection == GBAutoScrollDirectionTopToBottom) { + transform = self.bottomToTopTransform; + autoScrollDirection = GBAutoScrollDirectionBottomToTop; } [UIView animateWithDuration:0.5f delay:0.0f options:UIViewAnimationOptionCurveEaseInOut animations:^{ diff --git a/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/Images.xcassets/ArrowButton.imageset/ArrowButton@2x.png b/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/Images.xcassets/ArrowButton.imageset/ArrowButton@2x.png index 0a74ca6..92d285a 100644 Binary files a/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/Images.xcassets/ArrowButton.imageset/ArrowButton@2x.png and b/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/Images.xcassets/ArrowButton.imageset/ArrowButton@2x.png differ diff --git a/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/Images.xcassets/ArrowButtonHighlighted.imageset/ArrowButtonHighlighted@2x.png b/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/Images.xcassets/ArrowButtonHighlighted.imageset/ArrowButtonHighlighted@2x.png index b77f76c..284bd79 100644 Binary files a/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/Images.xcassets/ArrowButtonHighlighted.imageset/ArrowButtonHighlighted@2x.png and b/GBInfiniteScrollViewPageControlDemo/GBInfiniteScrollViewPageControlDemo/Images.xcassets/ArrowButtonHighlighted.imageset/ArrowButtonHighlighted@2x.png differ