From f7383f03eda4e1b31a56f5106d9354590c94a7fa Mon Sep 17 00:00:00 2001 From: JyHu Date: Fri, 21 Jul 2017 23:44:27 +0800 Subject: [PATCH 1/8] add an useful property --- THSegmentedPager/THSegmentedPager.h | 2 ++ THSegmentedPager/THSegmentedPager.m | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/THSegmentedPager/THSegmentedPager.h b/THSegmentedPager/THSegmentedPager.h index a24a8a1..cd51041 100644 --- a/THSegmentedPager/THSegmentedPager.h +++ b/THSegmentedPager/THSegmentedPager.h @@ -15,6 +15,8 @@ @property (weak, nonatomic) IBOutlet HMSegmentedControl *pageControl; @property (weak, nonatomic) IBOutlet UIView *contentContainer; +@property (assign, nonatomic) BOOL needPagerAnimateWhenSegmentSelectionChanged; + @property (strong, nonatomic)NSMutableArray *pages; @property (assign, nonatomic, getter=isShouldBounce)BOOL shouldBounce; /*! Instead of setting the pages manually you can give to the controller an array of identifiers which will be loaded from the storyboard at runtime diff --git a/THSegmentedPager/THSegmentedPager.m b/THSegmentedPager/THSegmentedPager.m index 1389378..a208873 100644 --- a/THSegmentedPager/THSegmentedPager.m +++ b/THSegmentedPager/THSegmentedPager.m @@ -51,6 +51,8 @@ - (void)viewDidLoad { self.pageControl.verticalDividerEnabled = YES; self.pageControl.verticalDividerColor = [UIColor colorWithRed:127/255.0 green:127/255.0 blue:127/255.0 alpha:1]; + self.needPagerAnimateWhenSegmentSelectionChanged = YES; + // Obtain the ScrollViewDelegate self.shouldBounce = YES; for (UIView *view in self.pageViewController.view.subviews ) { @@ -239,7 +241,7 @@ - (void)pageControlValueChanged:(id)sender { __weak THSegmentedPager *blocksafeSelf = self; [self.pageViewController setViewControllers:@[[self selectedController]] direction:direction - animated:YES + animated:self.needPagerAnimateWhenSegmentSelectionChanged completion:^(BOOL finished) { // ref: http://stackoverflow.com/questions/12939280/uipageviewcontroller-navigates-to-wrong-page-with-scroll-transition-style // workaround for UIPageViewController's bug to avoid transition to wrong page From ba308e0748ac3d85d91fe8d50076e3808a845a90 Mon Sep 17 00:00:00 2001 From: JyHu Date: Thu, 24 Aug 2017 19:55:19 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BC=98=E5=8C=96pager=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=B8=AA=E6=B5=8B=E8=AF=95=E7=9A=84demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- THSegmentedPager/THSegmentedPager.h | 19 +- THSegmentedPager/THSegmentedPager.m | 272 +++++++--- THSegmentedPagerExample/Podfile | 12 - THSegmentedPagerExample/Podfile.lock | 32 -- .../project.pbxproj | 498 ++++++------------ .../contents.xcworkspacedata | 2 +- .../THSegmentedPagerExample.xcscheme | 115 ---- .../contents.xcworkspacedata | 1 - .../THSegmentedPagerExample.xccheckout | 41 -- .../THSegmentedPagerExample/AppDelegate.h | 8 +- .../THSegmentedPagerExample/AppDelegate.m | 59 ++- .../AppIcon.appiconset/Contents.json | 30 ++ .../Base.lproj/LaunchScreen.storyboard | 27 + .../Base.lproj/Main.storyboard | 161 ++++++ .../BaseTableViewController.h | 15 + .../BaseTableViewController.m | 66 +++ .../BrandAsset.launchimage/Contents.json | 66 --- .../Images.xcassets/Contents.json | 6 - ...ntedPagerExample-Info.plist => Info.plist} | 23 +- .../Launch Screen.storyboard | 53 -- .../PagerViewController.h | 13 + .../PagerViewController.m | 55 ++ .../SamplePagedViewController.h | 16 - .../SamplePagedViewController.m | 29 - .../THSegmentedPagerExample-Prefix.pch | 16 - .../TestViewController.h | 13 + .../TestViewController.m | 52 ++ .../THSegmentedPagerExample/ViewController.h | 15 + .../THSegmentedPagerExample/ViewController.m | 49 ++ .../en.lproj/InfoPlist.strings | 2 - .../THSegmentedPagerExample/iPhone.storyboard | 146 ----- .../THSegmentedPagerExample/main.m | 10 +- .../with_Foo_Bar_Baz_pages_looks_good@2x.png | Bin 33698 -> 0 bytes ...ges_when_Bar_is_selected_looks_good@2x.png | Bin 35882 -> 0 bytes .../with_one_page_looks_good@2x.png | Bin 31864 -> 0 bytes .../Storyboard.storyboard | 113 ---- .../THSegmentedPagerExampleTests-Info.plist | 22 - .../THSegmentedPagerTests.m | 89 ---- .../en.lproj/InfoPlist.strings | 2 - ThSegmentedPagerExample/Podfile | 8 + ThSegmentedPagerExample/Podfile.lock | 19 + .../contents.xcworkspacedata | 10 + 42 files changed, 959 insertions(+), 1226 deletions(-) delete mode 100644 THSegmentedPagerExample/Podfile delete mode 100644 THSegmentedPagerExample/Podfile.lock delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/xcshareddata/xcschemes/THSegmentedPagerExample.xcscheme delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample.xcworkspace/contents.xcworkspacedata delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample.xcworkspace/xcshareddata/THSegmentedPagerExample.xccheckout rename THSegmentedPagerExample/THSegmentedPagerExample/{Images.xcassets => Assets.xcassets}/AppIcon.appiconset/Contents.json (54%) create mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/Base.lproj/LaunchScreen.storyboard create mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/Base.lproj/Main.storyboard create mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.h create mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/BrandAsset.launchimage/Contents.json delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/Contents.json rename THSegmentedPagerExample/THSegmentedPagerExample/{THSegmentedPagerExample-Info.plist => Info.plist} (68%) delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/Launch Screen.storyboard create mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.h create mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/SamplePagedViewController.h delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/SamplePagedViewController.m delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/THSegmentedPagerExample-Prefix.pch create mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.h create mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.m create mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/ViewController.h create mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/ViewController.m delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/en.lproj/InfoPlist.strings delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExample/iPhone.storyboard delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExampleTests/ReferenceImages/THSegmentedPagerSpec/with_Foo_Bar_Baz_pages_looks_good@2x.png delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExampleTests/ReferenceImages/THSegmentedPagerSpec/with_Foo_Bar_Baz_pages_when_Bar_is_selected_looks_good@2x.png delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExampleTests/ReferenceImages/THSegmentedPagerSpec/with_one_page_looks_good@2x.png delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExampleTests/Storyboard.storyboard delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExampleTests/THSegmentedPagerExampleTests-Info.plist delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExampleTests/THSegmentedPagerTests.m delete mode 100644 THSegmentedPagerExample/THSegmentedPagerExampleTests/en.lproj/InfoPlist.strings create mode 100644 ThSegmentedPagerExample/Podfile create mode 100644 ThSegmentedPagerExample/Podfile.lock create mode 100644 ThSegmentedPagerExample/ThSegmentedPagerExample.xcworkspace/contents.xcworkspacedata diff --git a/THSegmentedPager/THSegmentedPager.h b/THSegmentedPager/THSegmentedPager.h index cd51041..4e9286f 100644 --- a/THSegmentedPager/THSegmentedPager.h +++ b/THSegmentedPager/THSegmentedPager.h @@ -11,18 +11,21 @@ @interface THSegmentedPager : UIViewController -@property (strong, nonatomic)UIPageViewController *pageViewController; -@property (weak, nonatomic) IBOutlet HMSegmentedControl *pageControl; -@property (weak, nonatomic) IBOutlet UIView *contentContainer; +@property (strong, nonatomic, readonly) HMSegmentedControl *pageControl; +@property (strong, nonatomic, readonly) UIPageViewController *pageViewController; +@property (strong, nonatomic, readonly) UIView *contentContainer; @property (assign, nonatomic) BOOL needPagerAnimateWhenSegmentSelectionChanged; -@property (strong, nonatomic)NSMutableArray *pages; -@property (assign, nonatomic, getter=isShouldBounce)BOOL shouldBounce; +@property (strong, nonatomic) NSArray *pages; +@property (assign, nonatomic) BOOL shouldBounce; + /*! Instead of setting the pages manually you can give to the controller an array of identifiers which will be loaded from the storyboard at runtime - * \param identifiers Array of identifiers to load + * \param pageIdentifiers Array of identifiers to load */ -- (void)setupPagesFromStoryboardWithIdentifiers:(NSArray *)identifiers; +- (void)setupPagesFromStoryboardWithIdentifier:(NSString *)storybardIdentifier pageIdentifiers:(NSArray *)pageIdentifiers; +- (void)setupPagesFromStoryboard:(UIStoryboard *)storyboard pageIdentifiers:(NSArray *)pageIdentifiers; +- (void)setupPagesFromStoryboardWithPageIdentifiers:(NSArray *)pageIdentifiers; - (void)setPageControlHidden:(BOOL)hidden animated:(BOOL)animated; - (void)setSelectedPageIndex:(NSUInteger)index animated:(BOOL)animated; @@ -31,7 +34,7 @@ /*! Get the selected viewcontroller * \returns The actual selected viewcontroller */ -- (UIViewController *)selectedController; +@property (strong, nonatomic, readonly) UIViewController *selectedController; /*! The control will ask from every viewcontroller an updated title string */ diff --git a/THSegmentedPager/THSegmentedPager.m b/THSegmentedPager/THSegmentedPager.m index a208873..e02f9b3 100644 --- a/THSegmentedPager/THSegmentedPager.m +++ b/THSegmentedPager/THSegmentedPager.m @@ -14,48 +14,53 @@ @interface THSegmentedPager () @property (nonatomic,assign) NSUInteger currentIndex; @property (nonatomic,assign) NSUInteger nextIndex; @property (nonatomic,assign) BOOL userDraggingStartedTransitionInProgress; + +@property (strong, nonatomic) HMSegmentedControl *pri_segmentControl; +@property (strong, nonatomic) UIPageViewController *pri_pageViewController; +@property (strong, nonatomic) UIView *pri_contentContainer; +@property (strong, nonatomic) NSMutableArray *pri_pages; + @end @implementation THSegmentedPager -@synthesize pageViewController = _pageViewController; -@synthesize pages = _pages; -@synthesize shouldBounce = _shouldBounce; +@synthesize pri_pages = _pri_pages; + +- (instancetype)init { + if (self = [super init]) { + self.needPagerAnimateWhenSegmentSelectionChanged = NO; + } + return self; +} -- (NSMutableArray *)pages { - if (!_pages)_pages = [NSMutableArray new]; - return _pages; +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + if (self = [super initWithCoder:aDecoder]) { + self.needPagerAnimateWhenSegmentSelectionChanged = NO; + } + return self; +} + +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { + self.needPagerAnimateWhenSegmentSelectionChanged = NO; + } + return self; } - (void)viewDidLoad { [super viewDidLoad]; - // Init PageViewController - self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil]; - self.pageViewController.view.frame = CGRectMake(0, 0, self.contentContainer.frame.size.width, self.contentContainer.frame.size.height); - [self.pageViewController setDataSource:self]; - [self.pageViewController setDelegate:self]; - [self.pageViewController.view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; - [self addChildViewController:self.pageViewController]; - [self.contentContainer addSubview:self.pageViewController.view]; - - [self.pageControl addTarget:self - action:@selector(pageControlValueChanged:) - forControlEvents:UIControlEventValueChanged]; - - self.pageControl.backgroundColor = [UIColor colorWithRed:69/255.0 green:69/255.0 blue:69/255.0 alpha:1]; - self.pageControl.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor colorWithRed:127/255.0 green:127/255.0 blue:127/255.0 alpha:1]}; - self.pageControl.selectionIndicatorColor = [UIColor colorWithRed:242/255.0 green:121/255.0 blue:53/255.0 alpha:1]; - self.pageControl.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown; - self.pageControl.selectedTitleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]}; - self.pageControl.selectionStyle = HMSegmentedControlSelectionStyleFullWidthStripe; - self.pageControl.verticalDividerEnabled = YES; - self.pageControl.verticalDividerColor = [UIColor colorWithRed:127/255.0 green:127/255.0 blue:127/255.0 alpha:1]; + + self.view.backgroundColor = [UIColor whiteColor]; - self.needPagerAnimateWhenSegmentSelectionChanged = YES; + [self addChildViewController:self.pri_pageViewController]; + [self.pri_contentContainer addSubview:self.pri_pageViewController.view]; + [self.view addSubview:self.pri_contentContainer]; + + [self.view addSubview:self.pri_segmentControl]; // Obtain the ScrollViewDelegate self.shouldBounce = YES; - for (UIView *view in self.pageViewController.view.subviews ) { + for (UIView *view in self.pri_pageViewController.view.subviews ) { if ([view isKindOfClass:[UIScrollView class]]) { ((UIScrollView *)view).delegate = self; } @@ -64,8 +69,8 @@ - (void)viewDidLoad { - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - if ([self.pages count]>0) { - [self setSelectedPageIndex:[self.pageControl selectedSegmentIndex] animated:animated]; + if ([self.pri_pages count]>0) { + [self setSelectedPageIndex:[self.pri_segmentControl selectedSegmentIndex] animated:animated]; } [self updateTitleLabels]; } @@ -78,24 +83,34 @@ - (void)dealloc { #pragma mark - Setup -- (void)setupPagesFromStoryboardWithIdentifiers:(NSArray *)identifiers { - if (self.storyboard) { - for (NSString *identifier in identifiers) { - UIViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:identifier]; +- (void)setupPagesFromStoryboardWithPageIdentifiers:(NSArray *)pageIdentifiers { + [self setupPagesFromStoryboard:self.storyboard pageIdentifiers:pageIdentifiers]; +} + +- (void)setupPagesFromStoryboardWithIdentifier:(NSString *)storybardIdentifier pageIdentifiers:(NSArray *)pageIdentifiers { + if (storybardIdentifier) { + [self setupPagesFromStoryboard:[UIStoryboard storyboardWithName:storybardIdentifier bundle:nil] pageIdentifiers:pageIdentifiers]; + } +} + +- (void)setupPagesFromStoryboard:(UIStoryboard *)storyboard pageIdentifiers:(NSArray *)pageIdentifiers { + if (storyboard) { + for (NSString *identifier in pageIdentifiers) { + UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:identifier]; if (viewController) { - [self.pages addObject:viewController]; + [self.pri_pages addObject:viewController]; } } } } - (void)updateTitleLabels { - [self.pageControl setSectionTitles:[self titleLabels]]; + [self.pri_segmentControl setSectionTitles:[self titleLabels]]; } - (NSArray *)titleLabels { NSMutableArray *titles = [NSMutableArray new]; - for (UIViewController *vc in self.pages) { + for (UIViewController *vc in self.pri_pages) { if ([vc conformsToProtocol:@protocol(THSegmentedPageViewControllerDelegate)] && [vc respondsToSelector:@selector(viewControllerTitle)] && [((UIViewController *)vc) viewControllerTitle]) { [titles addObject:[((UIViewController *)vc) viewControllerTitle]]; } else { @@ -106,21 +121,32 @@ - (NSArray *)titleLabels { } - (void)setPageControlHidden:(BOOL)hidden animated:(BOOL)animated { - [UIView animateWithDuration:animated ? 0.25f : 0.f animations:^{ - self.pageControl.alpha = hidden ? 0.0f : 1.0f; - }]; - [self.pageControl setHidden:hidden]; - [self.view setNeedsLayout]; -} - -- (UIViewController *)selectedController { - return self.pages[[self.pageControl selectedSegmentIndex]]; + + NSTimeInterval duration = (animated ? 0.25f : 0.0f); + + if (hidden && !self.pri_segmentControl.hidden) { + [UIView animateWithDuration:duration animations:^{ + self.pri_segmentControl.alpha = 0.0f; + self.pri_contentContainer.frame = CGRectUnion(self.pri_contentContainer.frame, self.pri_segmentControl.frame); + } completion:^(BOOL finished) { + self.pri_segmentControl.hidden = YES; + }]; + } else if (!hidden && self.pri_segmentControl.hidden) { + self.pri_segmentControl.hidden = NO; + [UIView animateWithDuration:duration animations:^{ + CGRect remainder; + CGRect slice; + CGRectDivide(self.pri_contentContainer.frame, &slice, &remainder, CGRectGetHeight(self.pri_segmentControl.frame), CGRectMinYEdge); + self.pri_contentContainer.frame = remainder; + self.pri_segmentControl.alpha = 1.0f; + }]; + } } - (void)setSelectedPageIndex:(NSUInteger)index animated:(BOOL)animated { - if (index < [self.pages count]) { - [self.pageControl setSelectedSegmentIndex:index animated:YES]; - [self.pageViewController setViewControllers:@[self.pages[index]] + if (index < [self.pri_pages count]) { + [self.pri_segmentControl setSelectedSegmentIndex:index animated:YES]; + [self.pri_pageViewController setViewControllers:@[self.pri_pages[index]] direction:UIPageViewControllerNavigationDirectionForward animated:animated completion:NULL]; @@ -130,31 +156,31 @@ - (void)setSelectedPageIndex:(NSUInteger)index animated:(BOOL)animated { #pragma mark - UIPageViewControllerDataSource - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController { - NSUInteger index = [self.pages indexOfObject:viewController]; + NSUInteger index = [self.pri_pages indexOfObject:viewController]; if ((index == NSNotFound) || (index == 0)) { return nil; } - return self.pages[--index]; + return self.pri_pages[--index]; } - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController { - NSUInteger index = [self.pages indexOfObject:viewController]; - if ((index == NSNotFound)||(index+1 >= [self.pages count])) { + NSUInteger index = [self.pri_pages indexOfObject:viewController]; + if ((index == NSNotFound)||(index+1 >= [self.pri_pages count])) { return nil; } - return self.pages[++index]; + return self.pri_pages[++index]; } - (void)pageViewController:(UIPageViewController *)pageViewController willTransitionToViewControllers:(NSArray *)pendingViewControllers{ - self.nextIndex = [self.pages indexOfObject:[pendingViewControllers firstObject]]; + self.nextIndex = [self.pri_pages indexOfObject:[pendingViewControllers firstObject]]; } - (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)previousViewControllers transitionCompleted:(BOOL)completed{ if(completed){ // DIRTY FIX - if (self.nextIndex != [self.pages indexOfObject:[previousViewControllers firstObject]]) { - self.currentIndex = [self.pages indexOfObject:[pageViewController.viewControllers objectAtIndex:0]]; - [self.pageControl setSelectedSegmentIndex:self.currentIndex animated:YES]; + if (self.nextIndex != [self.pri_pages indexOfObject:[previousViewControllers firstObject]]) { + self.currentIndex = [self.pri_pages indexOfObject:[pageViewController.viewControllers objectAtIndex:0]]; + [self.pri_segmentControl setSelectedSegmentIndex:self.currentIndex animated:YES]; } } self.nextIndex = self.currentIndex; @@ -173,19 +199,19 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView /* Scrolling forwards */ if (scrollView.contentOffset.x < (self.lastPosition - (.9 * scrollView.bounds.size.width))) { self.currentIndex = self.nextIndex; - [self.pageControl setSelectedSegmentIndex:self.currentIndex]; + [self.pri_segmentControl setSelectedSegmentIndex:self.currentIndex]; } } else { /* Scrolling backwards */ if (scrollView.contentOffset.x > (self.lastPosition + (.9 * scrollView.bounds.size.width))) { self.currentIndex = self.nextIndex; - [self.pageControl setSelectedSegmentIndex:self.currentIndex]; + [self.pri_segmentControl setSelectedSegmentIndex:self.currentIndex]; } } /* Need to calculate max/min offset for *every* page, not just the first and last. */ CGFloat minXOffset = scrollView.bounds.size.width - (self.currentIndex * scrollView.bounds.size.width); - CGFloat maxXOffset = (([self.pages count] - self.currentIndex) * scrollView.bounds.size.width); + CGFloat maxXOffset = (([self.pri_pages count] - self.currentIndex) * scrollView.bounds.size.width); if (!self.shouldBounce) { CGRect scrollBounds = scrollView.bounds; @@ -205,7 +231,7 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoi { /* Need to calculate max/min offset for *every* page, not just the first and last. */ CGFloat minXOffset = scrollView.bounds.size.width - (self.currentIndex * scrollView.bounds.size.width); - CGFloat maxXOffset = (([self.pages count] - self.currentIndex) * scrollView.bounds.size.width); + CGFloat maxXOffset = (([self.pri_pages count] - self.currentIndex) * scrollView.bounds.size.width); if (!self.shouldBounce) { if (scrollView.contentOffset.x <= minXOffset) { @@ -235,27 +261,113 @@ - (void)pageControlValueChanged:(id)sender { if (!self.userDraggingStartedTransitionInProgress) { // Update NextIndex - self.nextIndex = [self.pageControl selectedSegmentIndex]; - UIPageViewControllerNavigationDirection direction = self.nextIndex > [self.pages indexOfObject:[self.pageViewController.viewControllers lastObject]] ? UIPageViewControllerNavigationDirectionForward : UIPageViewControllerNavigationDirectionReverse; + self.nextIndex = [self.pri_segmentControl selectedSegmentIndex]; + UIPageViewControllerNavigationDirection direction = self.nextIndex > [self.pri_pages indexOfObject:[self.pri_pageViewController.viewControllers lastObject]] ? UIPageViewControllerNavigationDirectionForward : UIPageViewControllerNavigationDirectionReverse; + + if (!self.needPagerAnimateWhenSegmentSelectionChanged && self.pri_segmentControl.selectedSegmentIndex < self.pri_pages.count) { + self.currentIndex = [self.pri_segmentControl selectedSegmentIndex]; + } __weak THSegmentedPager *blocksafeSelf = self; - [self.pageViewController setViewControllers:@[[self selectedController]] - direction:direction - animated:self.needPagerAnimateWhenSegmentSelectionChanged - completion:^(BOOL finished) { - // ref: http://stackoverflow.com/questions/12939280/uipageviewcontroller-navigates-to-wrong-page-with-scroll-transition-style - // workaround for UIPageViewController's bug to avoid transition to wrong page - // (ex: after switching from p1 to p3 using pageControl, you can only swipe back from p3 to p1 instead of p2) - dispatch_async(dispatch_get_main_queue(), ^{ - [blocksafeSelf.pageViewController setViewControllers:@[[blocksafeSelf selectedController]] - direction:direction - animated:NO - completion:nil]; - }); - }]; + void (^completionBlock)(BOOL finished) = ^(BOOL finished) { + // ref: http://stackoverflow.com/questions/12939280/uipageviewcontroller-navigates-to-wrong-page-with-scroll-transition-style + // workaround for UIPageViewController's bug to avoid transition to wrong page + // (ex: after switching from p1 to p3 using pageControl, you can only swipe back from p3 to p1 instead of p2) + dispatch_async(dispatch_get_main_queue(), ^{ + [blocksafeSelf.pri_pageViewController setViewControllers:@[[blocksafeSelf selectedController]] direction:direction animated:NO completion:nil]; + }); + }; + + [self.pri_pageViewController setViewControllers:@[[self selectedController]] direction:direction + animated:self.needPagerAnimateWhenSegmentSelectionChanged completion:completionBlock]; } else { - [self.pageControl setSelectedSegmentIndex:self.currentIndex animated:NO]; + [self.pri_segmentControl setSelectedSegmentIndex:self.currentIndex animated:NO]; + } +} + +#pragma mark - getter + +- (UIView *)pri_contentContainer +{ + if (!_pri_contentContainer) { + _pri_contentContainer = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.pri_segmentControl.frame), CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) - CGRectGetMaxY(self.pri_segmentControl.frame))]; + _pri_contentContainer.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + _pri_contentContainer.backgroundColor = [UIColor clearColor]; + } + + return _pri_contentContainer; +} + +- (UIPageViewController *)pri_pageViewController +{ + if (!_pri_pageViewController) { + _pri_pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil]; + _pri_pageViewController.view.frame = self.pri_contentContainer.bounds; + [_pri_pageViewController setDataSource:self]; + [_pri_pageViewController setDelegate:self]; + [_pri_pageViewController.view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; } + + return _pri_pageViewController; +} + +- (HMSegmentedControl *)pri_segmentControl +{ + if (!_pri_segmentControl) { + _pri_segmentControl = [[HMSegmentedControl alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 40)]; + _pri_segmentControl.autoresizingMask = UIViewAutoresizingFlexibleWidth; + _pri_segmentControl.backgroundColor = [UIColor colorWithRed:69/255.0 green:69/255.0 blue:69/255.0 alpha:1]; + _pri_segmentControl.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor colorWithRed:127/255.0 green:127/255.0 blue:127/255.0 alpha:1]}; + _pri_segmentControl.selectionIndicatorColor = [UIColor colorWithRed:242/255.0 green:121/255.0 blue:53/255.0 alpha:1]; + _pri_segmentControl.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown; + _pri_segmentControl.selectedTitleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]}; + _pri_segmentControl.selectionStyle = HMSegmentedControlSelectionStyleFullWidthStripe; + _pri_segmentControl.verticalDividerEnabled = YES; + _pri_segmentControl.verticalDividerColor = [UIColor colorWithRed:127/255.0 green:127/255.0 blue:127/255.0 alpha:1]; + + [_pri_segmentControl addTarget:self action:@selector(pageControlValueChanged:) forControlEvents:UIControlEventValueChanged]; + } + return _pri_segmentControl; +} + +- (HMSegmentedControl *)pageControl +{ + return self.pri_segmentControl; +} + +- (UIPageViewController *)pageViewController +{ + return self.pri_pageViewController; +} + +- (UIView *)contentContainer +{ + return self.pri_contentContainer; +} + +- (NSMutableArray *)pri_pages +{ + if (!_pri_pages) { + _pri_pages = [[NSMutableArray alloc] init]; + } + return _pri_pages; +} + +- (NSArray *)pages +{ + return self.pri_pages; +} + +- (void)setPages:(NSArray *)pages +{ + if (pages) { + [self.pri_pages removeAllObjects]; + [self.pri_pages addObjectsFromArray:pages]; + } +} + +- (UIViewController *)selectedController { + return self.pri_pages[[self.pri_segmentControl selectedSegmentIndex]]; } @end diff --git a/THSegmentedPagerExample/Podfile b/THSegmentedPagerExample/Podfile deleted file mode 100644 index e77b94f..0000000 --- a/THSegmentedPagerExample/Podfile +++ /dev/null @@ -1,12 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '7.0' - -pod 'HMSegmentedControl', '~> 1.5.2' -pod 'THSegmentedPager', :path=> '../../THSegmentedPager' - -target 'THSegmentedPagerExampleTests', :exclusive => true do - pod 'FBSnapshotTestCase/Core' - pod 'Expecta+Snapshots' - pod 'Specta' - pod 'Expecta' -end diff --git a/THSegmentedPagerExample/Podfile.lock b/THSegmentedPagerExample/Podfile.lock deleted file mode 100644 index 0ac5114..0000000 --- a/THSegmentedPagerExample/Podfile.lock +++ /dev/null @@ -1,32 +0,0 @@ -PODS: - - Expecta (1.0.3) - - Expecta+Snapshots (2.0.0): - - Expecta (~> 1.0) - - FBSnapshotTestCase/Core (~> 2.0.3) - - FBSnapshotTestCase/Core (2.0.4) - - HMSegmentedControl (1.5.2) - - Specta (1.0.4) - - THSegmentedPager (1.1.3): - - HMSegmentedControl (~> 1.5.2) - -DEPENDENCIES: - - Expecta - - Expecta+Snapshots - - FBSnapshotTestCase/Core - - HMSegmentedControl (~> 1.5.2) - - Specta - - THSegmentedPager (from `../../THSegmentedPager`) - -EXTERNAL SOURCES: - THSegmentedPager: - :path: "../../THSegmentedPager" - -SPEC CHECKSUMS: - Expecta: 9d1bff6c8b0eeee73a166a2ee898892478927a15 - Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba - FBSnapshotTestCase: d94cf34841c9e77390e29009e8e2713479d48753 - HMSegmentedControl: 83b9686022d2176fb6457d2bdb61e5d6393fed7d - Specta: 69bb134672aae190a1379ff91df07dad8dd1f869 - THSegmentedPager: 9d4fb2acc78d77246caf1e71d2e878bf5977b904 - -COCOAPODS: 0.38.2 diff --git a/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj b/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj index abe6c67..6811ccd 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj +++ b/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj @@ -7,406 +7,277 @@ objects = { /* Begin PBXBuildFile section */ - 3CCB8815A52E480C87E30210 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B0378D4EB5754459AF84BA34 /* libPods.a */; }; - 502EEB741AE2DBFF000CFA05 /* THSegmentedPagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 502EEB731AE2DBFF000CFA05 /* THSegmentedPagerTests.m */; }; - 502EEB771AE2DCBD000CFA05 /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 502EEB761AE2DCBD000CFA05 /* Storyboard.storyboard */; }; - 6A1FCE59DEC24EB61262FDDC /* libPods-THSegmentedPagerExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 38BB6F8377F5CBD51D308DB8 /* libPods-THSegmentedPagerExampleTests.a */; }; - 9918A27A1BC6AA0C00A15A77 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 99C8C818198281240039193A /* Images.xcassets */; settings = {ASSET_TAGS = (); }; }; - 9918A27C1BC6AA9600A15A77 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9918A27B1BC6AA9600A15A77 /* Launch Screen.storyboard */; settings = {ASSET_TAGS = (); }; }; - 99C8C807198281240039193A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99C8C806198281240039193A /* Foundation.framework */; }; - 99C8C809198281240039193A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99C8C808198281240039193A /* CoreGraphics.framework */; }; - 99C8C80B198281240039193A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99C8C80A198281240039193A /* UIKit.framework */; }; - 99C8C811198281240039193A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 99C8C80F198281240039193A /* InfoPlist.strings */; }; - 99C8C813198281240039193A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 99C8C812198281240039193A /* main.m */; }; - 99C8C817198281240039193A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 99C8C816198281240039193A /* AppDelegate.m */; }; - 99C8C819198281240039193A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 99C8C818198281240039193A /* Images.xcassets */; }; - 99C8C820198281240039193A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99C8C81F198281240039193A /* XCTest.framework */; }; - 99C8C821198281240039193A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99C8C806198281240039193A /* Foundation.framework */; }; - 99C8C822198281240039193A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99C8C80A198281240039193A /* UIKit.framework */; }; - 99C8C82A198281240039193A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 99C8C828198281240039193A /* InfoPlist.strings */; }; - 99C8C836198281580039193A /* iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 99C8C835198281580039193A /* iPhone.storyboard */; }; - 99C8C84719829C650039193A /* SamplePagedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 99C8C84619829C650039193A /* SamplePagedViewController.m */; }; + 1C1AEF891F4EA624005C8FB8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1AEF881F4EA624005C8FB8 /* main.m */; }; + 1C1AEF8C1F4EA624005C8FB8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1AEF8B1F4EA624005C8FB8 /* AppDelegate.m */; }; + 1C1AEF8F1F4EA624005C8FB8 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1AEF8E1F4EA624005C8FB8 /* ViewController.m */; }; + 1C1AEF921F4EA624005C8FB8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1C1AEF901F4EA624005C8FB8 /* Main.storyboard */; }; + 1C1AEF941F4EA624005C8FB8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1C1AEF931F4EA624005C8FB8 /* Assets.xcassets */; }; + 1C1AEF971F4EA624005C8FB8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1C1AEF951F4EA624005C8FB8 /* LaunchScreen.storyboard */; }; + 1C1AEFA01F4EA7FA005C8FB8 /* BaseTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1AEF9F1F4EA7FA005C8FB8 /* BaseTableViewController.m */; }; + 1C1AEFA31F4EAC96005C8FB8 /* PagerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1AEFA21F4EAC96005C8FB8 /* PagerViewController.m */; }; + 1C1AEFA61F4EBA73005C8FB8 /* TestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1AEFA51F4EBA73005C8FB8 /* TestViewController.m */; }; + 32749EFB26E011CEF355C6AA /* Pods_ThSegmentedPagerExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7B5685ACEE81C8F2BC88A0A /* Pods_ThSegmentedPagerExample.framework */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 99C8C823198281240039193A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 99C8C7FB198281240039193A /* Project object */; - proxyType = 1; - remoteGlobalIDString = 99C8C802198281240039193A; - remoteInfo = THSegmentedPagerExample; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ - 38BB6F8377F5CBD51D308DB8 /* libPods-THSegmentedPagerExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-THSegmentedPagerExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 502EEB731AE2DBFF000CFA05 /* THSegmentedPagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = THSegmentedPagerTests.m; sourceTree = ""; }; - 502EEB761AE2DCBD000CFA05 /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Storyboard.storyboard; sourceTree = ""; }; - 57357A84FB65AC89CDE5F74B /* Pods-THSegmentedPagerExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-THSegmentedPagerExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-THSegmentedPagerExampleTests/Pods-THSegmentedPagerExampleTests.debug.xcconfig"; sourceTree = ""; }; - 9918A27B1BC6AA9600A15A77 /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; - 99C8C803198281240039193A /* THSegmentedPagerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = THSegmentedPagerExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 99C8C806198281240039193A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 99C8C808198281240039193A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 99C8C80A198281240039193A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 99C8C80E198281240039193A /* THSegmentedPagerExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "THSegmentedPagerExample-Info.plist"; sourceTree = ""; }; - 99C8C810198281240039193A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 99C8C812198281240039193A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 99C8C814198281240039193A /* THSegmentedPagerExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "THSegmentedPagerExample-Prefix.pch"; sourceTree = ""; }; - 99C8C815198281240039193A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 99C8C816198281240039193A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 99C8C818198281240039193A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 99C8C81E198281240039193A /* THSegmentedPagerExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = THSegmentedPagerExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 99C8C81F198281240039193A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - 99C8C827198281240039193A /* THSegmentedPagerExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "THSegmentedPagerExampleTests-Info.plist"; sourceTree = ""; }; - 99C8C829198281240039193A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 99C8C835198281580039193A /* iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = iPhone.storyboard; sourceTree = ""; }; - 99C8C84519829C650039193A /* SamplePagedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SamplePagedViewController.h; sourceTree = ""; }; - 99C8C84619829C650039193A /* SamplePagedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SamplePagedViewController.m; sourceTree = ""; }; - B0378D4EB5754459AF84BA34 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - B86019CAE24EC80D2397F99D /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - E9CACEA33C0AB51FDF71D7B5 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; - F436489982B76D37541A6DB1 /* Pods-THSegmentedPagerExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-THSegmentedPagerExampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-THSegmentedPagerExampleTests/Pods-THSegmentedPagerExampleTests.release.xcconfig"; sourceTree = ""; }; + 1C1AEF841F4EA624005C8FB8 /* ThSegmentedPagerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ThSegmentedPagerExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1C1AEF881F4EA624005C8FB8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 1C1AEF8A1F4EA624005C8FB8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 1C1AEF8B1F4EA624005C8FB8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 1C1AEF8D1F4EA624005C8FB8 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 1C1AEF8E1F4EA624005C8FB8 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 1C1AEF911F4EA624005C8FB8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 1C1AEF931F4EA624005C8FB8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 1C1AEF961F4EA624005C8FB8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 1C1AEF981F4EA624005C8FB8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1C1AEF9E1F4EA7FA005C8FB8 /* BaseTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseTableViewController.h; sourceTree = ""; }; + 1C1AEF9F1F4EA7FA005C8FB8 /* BaseTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseTableViewController.m; sourceTree = ""; }; + 1C1AEFA11F4EAC96005C8FB8 /* PagerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PagerViewController.h; sourceTree = ""; }; + 1C1AEFA21F4EAC96005C8FB8 /* PagerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PagerViewController.m; sourceTree = ""; }; + 1C1AEFA41F4EBA73005C8FB8 /* TestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestViewController.h; sourceTree = ""; }; + 1C1AEFA51F4EBA73005C8FB8 /* TestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestViewController.m; sourceTree = ""; }; + C8918BF900C98EEF7131C90D /* Pods-ThSegmentedPagerExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ThSegmentedPagerExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-ThSegmentedPagerExample/Pods-ThSegmentedPagerExample.release.xcconfig"; sourceTree = ""; }; + E7B5685ACEE81C8F2BC88A0A /* Pods_ThSegmentedPagerExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ThSegmentedPagerExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FE52F4410F6DFBC3E444EFA1 /* Pods-ThSegmentedPagerExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ThSegmentedPagerExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ThSegmentedPagerExample/Pods-ThSegmentedPagerExample.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 99C8C800198281240039193A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 99C8C809198281240039193A /* CoreGraphics.framework in Frameworks */, - 99C8C80B198281240039193A /* UIKit.framework in Frameworks */, - 99C8C807198281240039193A /* Foundation.framework in Frameworks */, - 3CCB8815A52E480C87E30210 /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 99C8C81B198281240039193A /* Frameworks */ = { + 1C1AEF811F4EA624005C8FB8 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 99C8C820198281240039193A /* XCTest.framework in Frameworks */, - 99C8C822198281240039193A /* UIKit.framework in Frameworks */, - 99C8C821198281240039193A /* Foundation.framework in Frameworks */, - 6A1FCE59DEC24EB61262FDDC /* libPods-THSegmentedPagerExampleTests.a in Frameworks */, + 32749EFB26E011CEF355C6AA /* Pods_ThSegmentedPagerExample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 4ABE35039A712EBCB9D85E14 /* Pods */ = { + 1C1AEF7B1F4EA624005C8FB8 = { isa = PBXGroup; children = ( - E9CACEA33C0AB51FDF71D7B5 /* Pods.debug.xcconfig */, - B86019CAE24EC80D2397F99D /* Pods.release.xcconfig */, - 57357A84FB65AC89CDE5F74B /* Pods-THSegmentedPagerExampleTests.debug.xcconfig */, - F436489982B76D37541A6DB1 /* Pods-THSegmentedPagerExampleTests.release.xcconfig */, + 1C1AEF861F4EA624005C8FB8 /* ThSegmentedPagerExample */, + 1C1AEF851F4EA624005C8FB8 /* Products */, + FA563CC82ABD459C84377457 /* Pods */, + 87591CA62F2EDC4A642B9CC4 /* Frameworks */, ); - name = Pods; sourceTree = ""; }; - 502EEB751AE2DC9F000CFA05 /* Fixtures */ = { + 1C1AEF851F4EA624005C8FB8 /* Products */ = { isa = PBXGroup; children = ( - 502EEB761AE2DCBD000CFA05 /* Storyboard.storyboard */, - ); - name = Fixtures; - sourceTree = ""; - }; - 99C8C7FA198281240039193A = { - isa = PBXGroup; - children = ( - 99C8C80C198281240039193A /* THSegmentedPagerExample */, - 99C8C825198281240039193A /* THSegmentedPagerExampleTests */, - 99C8C805198281240039193A /* Frameworks */, - 99C8C804198281240039193A /* Products */, - 4ABE35039A712EBCB9D85E14 /* Pods */, - ); - indentWidth = 4; - sourceTree = ""; - tabWidth = 4; - }; - 99C8C804198281240039193A /* Products */ = { - isa = PBXGroup; - children = ( - 99C8C803198281240039193A /* THSegmentedPagerExample.app */, - 99C8C81E198281240039193A /* THSegmentedPagerExampleTests.xctest */, + 1C1AEF841F4EA624005C8FB8 /* ThSegmentedPagerExample.app */, ); name = Products; sourceTree = ""; }; - 99C8C805198281240039193A /* Frameworks */ = { + 1C1AEF861F4EA624005C8FB8 /* ThSegmentedPagerExample */ = { isa = PBXGroup; children = ( - 99C8C806198281240039193A /* Foundation.framework */, - 99C8C808198281240039193A /* CoreGraphics.framework */, - 99C8C80A198281240039193A /* UIKit.framework */, - 99C8C81F198281240039193A /* XCTest.framework */, - B0378D4EB5754459AF84BA34 /* libPods.a */, - 38BB6F8377F5CBD51D308DB8 /* libPods-THSegmentedPagerExampleTests.a */, - ); - name = Frameworks; + 1C1AEF8A1F4EA624005C8FB8 /* AppDelegate.h */, + 1C1AEF8B1F4EA624005C8FB8 /* AppDelegate.m */, + 1C1AEF8D1F4EA624005C8FB8 /* ViewController.h */, + 1C1AEF8E1F4EA624005C8FB8 /* ViewController.m */, + 1C1AEF9E1F4EA7FA005C8FB8 /* BaseTableViewController.h */, + 1C1AEF9F1F4EA7FA005C8FB8 /* BaseTableViewController.m */, + 1C1AEFA11F4EAC96005C8FB8 /* PagerViewController.h */, + 1C1AEFA21F4EAC96005C8FB8 /* PagerViewController.m */, + 1C1AEFA41F4EBA73005C8FB8 /* TestViewController.h */, + 1C1AEFA51F4EBA73005C8FB8 /* TestViewController.m */, + 1C1AEF901F4EA624005C8FB8 /* Main.storyboard */, + 1C1AEF931F4EA624005C8FB8 /* Assets.xcassets */, + 1C1AEF951F4EA624005C8FB8 /* LaunchScreen.storyboard */, + 1C1AEF981F4EA624005C8FB8 /* Info.plist */, + 1C1AEF871F4EA624005C8FB8 /* Supporting Files */, + ); + path = ThSegmentedPagerExample; sourceTree = ""; }; - 99C8C80C198281240039193A /* THSegmentedPagerExample */ = { + 1C1AEF871F4EA624005C8FB8 /* Supporting Files */ = { isa = PBXGroup; children = ( - 99C8C84519829C650039193A /* SamplePagedViewController.h */, - 99C8C84619829C650039193A /* SamplePagedViewController.m */, - 99C8C815198281240039193A /* AppDelegate.h */, - 99C8C816198281240039193A /* AppDelegate.m */, - 99C8C818198281240039193A /* Images.xcassets */, - 99C8C80D198281240039193A /* Supporting Files */, - 99C8C835198281580039193A /* iPhone.storyboard */, - 9918A27B1BC6AA9600A15A77 /* Launch Screen.storyboard */, - ); - path = THSegmentedPagerExample; - sourceTree = ""; - }; - 99C8C80D198281240039193A /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 99C8C80E198281240039193A /* THSegmentedPagerExample-Info.plist */, - 99C8C80F198281240039193A /* InfoPlist.strings */, - 99C8C812198281240039193A /* main.m */, - 99C8C814198281240039193A /* THSegmentedPagerExample-Prefix.pch */, + 1C1AEF881F4EA624005C8FB8 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; - 99C8C825198281240039193A /* THSegmentedPagerExampleTests */ = { + 87591CA62F2EDC4A642B9CC4 /* Frameworks */ = { isa = PBXGroup; children = ( - 99C8C826198281240039193A /* Supporting Files */, - 502EEB731AE2DBFF000CFA05 /* THSegmentedPagerTests.m */, + E7B5685ACEE81C8F2BC88A0A /* Pods_ThSegmentedPagerExample.framework */, ); - path = THSegmentedPagerExampleTests; + name = Frameworks; sourceTree = ""; }; - 99C8C826198281240039193A /* Supporting Files */ = { + FA563CC82ABD459C84377457 /* Pods */ = { isa = PBXGroup; children = ( - 502EEB751AE2DC9F000CFA05 /* Fixtures */, - 99C8C827198281240039193A /* THSegmentedPagerExampleTests-Info.plist */, - 99C8C828198281240039193A /* InfoPlist.strings */, + FE52F4410F6DFBC3E444EFA1 /* Pods-ThSegmentedPagerExample.debug.xcconfig */, + C8918BF900C98EEF7131C90D /* Pods-ThSegmentedPagerExample.release.xcconfig */, ); - name = "Supporting Files"; + name = Pods; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 99C8C802198281240039193A /* THSegmentedPagerExample */ = { + 1C1AEF831F4EA624005C8FB8 /* ThSegmentedPagerExample */ = { isa = PBXNativeTarget; - buildConfigurationList = 99C8C82F198281240039193A /* Build configuration list for PBXNativeTarget "THSegmentedPagerExample" */; + buildConfigurationList = 1C1AEF9B1F4EA624005C8FB8 /* Build configuration list for PBXNativeTarget "ThSegmentedPagerExample" */; buildPhases = ( - 2732873956584C6784AB8C11 /* Check Pods Manifest.lock */, - 99C8C7FF198281240039193A /* Sources */, - 99C8C800198281240039193A /* Frameworks */, - 99C8C801198281240039193A /* Resources */, - 49B247F1B39A4B758AF32B62 /* Copy Pods Resources */, + 031A4F227C0F2DE88C26BA03 /* [CP] Check Pods Manifest.lock */, + 1C1AEF801F4EA624005C8FB8 /* Sources */, + 1C1AEF811F4EA624005C8FB8 /* Frameworks */, + 1C1AEF821F4EA624005C8FB8 /* Resources */, + 99318926B5411CB48DAF2087 /* [CP] Embed Pods Frameworks */, + B2AE61DB94D54429ADB2158F /* [CP] Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); - name = THSegmentedPagerExample; - productName = THSegmentedPagerExample; - productReference = 99C8C803198281240039193A /* THSegmentedPagerExample.app */; + name = ThSegmentedPagerExample; + productName = ThSegmentedPagerExample; + productReference = 1C1AEF841F4EA624005C8FB8 /* ThSegmentedPagerExample.app */; productType = "com.apple.product-type.application"; }; - 99C8C81D198281240039193A /* THSegmentedPagerExampleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 99C8C832198281240039193A /* Build configuration list for PBXNativeTarget "THSegmentedPagerExampleTests" */; - buildPhases = ( - 034D194D6DD5C8CB06F7360E /* Check Pods Manifest.lock */, - 99C8C81A198281240039193A /* Sources */, - 99C8C81B198281240039193A /* Frameworks */, - 99C8C81C198281240039193A /* Resources */, - E802B37DE433CB88DDBF430D /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 99C8C824198281240039193A /* PBXTargetDependency */, - ); - name = THSegmentedPagerExampleTests; - productName = THSegmentedPagerExampleTests; - productReference = 99C8C81E198281240039193A /* THSegmentedPagerExampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 99C8C7FB198281240039193A /* Project object */ = { + 1C1AEF7C1F4EA624005C8FB8 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = 3Bus; + LastUpgradeCheck = 0830; + ORGANIZATIONNAME = "胡金友"; TargetAttributes = { - 99C8C81D198281240039193A = { - TestTargetID = 99C8C802198281240039193A; + 1C1AEF831F4EA624005C8FB8 = { + CreatedOnToolsVersion = 8.3.3; + DevelopmentTeam = NFE8L9VTV6; + ProvisioningStyle = Manual; }; }; }; - buildConfigurationList = 99C8C7FE198281240039193A /* Build configuration list for PBXProject "THSegmentedPagerExample" */; + buildConfigurationList = 1C1AEF7F1F4EA624005C8FB8 /* Build configuration list for PBXProject "ThSegmentedPagerExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); - mainGroup = 99C8C7FA198281240039193A; - productRefGroup = 99C8C804198281240039193A /* Products */; + mainGroup = 1C1AEF7B1F4EA624005C8FB8; + productRefGroup = 1C1AEF851F4EA624005C8FB8 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 99C8C802198281240039193A /* THSegmentedPagerExample */, - 99C8C81D198281240039193A /* THSegmentedPagerExampleTests */, + 1C1AEF831F4EA624005C8FB8 /* ThSegmentedPagerExample */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 99C8C801198281240039193A /* Resources */ = { + 1C1AEF821F4EA624005C8FB8 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 99C8C811198281240039193A /* InfoPlist.strings in Resources */, - 99C8C836198281580039193A /* iPhone.storyboard in Resources */, - 9918A27C1BC6AA9600A15A77 /* Launch Screen.storyboard in Resources */, - 99C8C819198281240039193A /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 99C8C81C198281240039193A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9918A27A1BC6AA0C00A15A77 /* Images.xcassets in Resources */, - 99C8C82A198281240039193A /* InfoPlist.strings in Resources */, - 502EEB771AE2DCBD000CFA05 /* Storyboard.storyboard in Resources */, + 1C1AEF971F4EA624005C8FB8 /* LaunchScreen.storyboard in Resources */, + 1C1AEF941F4EA624005C8FB8 /* Assets.xcassets in Resources */, + 1C1AEF921F4EA624005C8FB8 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 034D194D6DD5C8CB06F7360E /* Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 2732873956584C6784AB8C11 /* Check Pods Manifest.lock */ = { + 031A4F227C0F2DE88C26BA03 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - 49B247F1B39A4B758AF32B62 /* Copy Pods Resources */ = { + 99318926B5411CB48DAF2087 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ThSegmentedPagerExample/Pods-ThSegmentedPagerExample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - E802B37DE433CB88DDBF430D /* Copy Pods Resources */ = { + B2AE61DB94D54429ADB2158F /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "[CP] Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-THSegmentedPagerExampleTests/Pods-THSegmentedPagerExampleTests-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ThSegmentedPagerExample/Pods-ThSegmentedPagerExample-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 99C8C7FF198281240039193A /* Sources */ = { + 1C1AEF801F4EA624005C8FB8 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 99C8C817198281240039193A /* AppDelegate.m in Sources */, - 99C8C84719829C650039193A /* SamplePagedViewController.m in Sources */, - 99C8C813198281240039193A /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 99C8C81A198281240039193A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 502EEB741AE2DBFF000CFA05 /* THSegmentedPagerTests.m in Sources */, + 1C1AEFA61F4EBA73005C8FB8 /* TestViewController.m in Sources */, + 1C1AEF8F1F4EA624005C8FB8 /* ViewController.m in Sources */, + 1C1AEFA31F4EAC96005C8FB8 /* PagerViewController.m in Sources */, + 1C1AEF8C1F4EA624005C8FB8 /* AppDelegate.m in Sources */, + 1C1AEFA01F4EA7FA005C8FB8 /* BaseTableViewController.m in Sources */, + 1C1AEF891F4EA624005C8FB8 /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 99C8C824198281240039193A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 99C8C802198281240039193A /* THSegmentedPagerExample */; - targetProxy = 99C8C823198281240039193A /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ - 99C8C80F198281240039193A /* InfoPlist.strings */ = { + 1C1AEF901F4EA624005C8FB8 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( - 99C8C810198281240039193A /* en */, + 1C1AEF911F4EA624005C8FB8 /* Base */, ); - name = InfoPlist.strings; + name = Main.storyboard; sourceTree = ""; }; - 99C8C828198281240039193A /* InfoPlist.strings */ = { + 1C1AEF951F4EA624005C8FB8 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - 99C8C829198281240039193A /* en */, + 1C1AEF961F4EA624005C8FB8 /* Base */, ); - name = InfoPlist.strings; + name = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 99C8C82D198281240039193A /* Debug */ = { + 1C1AEF991F4EA624005C8FB8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -414,40 +285,48 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; - GCC_GENERATE_TEST_COVERAGE_FILES = YES; - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - 99C8C82E198281240039193A /* Release */ = { + 1C1AEF9A1F4EA624005C8FB8 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -455,138 +334,87 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_GENERATE_TEST_COVERAGE_FILES = YES; - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; - 99C8C830198281240039193A /* Debug */ = { + 1C1AEF9C1F4EA624005C8FB8 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E9CACEA33C0AB51FDF71D7B5 /* Pods.debug.xcconfig */; + baseConfigurationReference = FE52F4410F6DFBC3E444EFA1 /* Pods-ThSegmentedPagerExample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = BrandAsset; - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "THSegmentedPagerExample/THSegmentedPagerExample-Prefix.pch"; - INFOPLIST_FILE = "THSegmentedPagerExample/THSegmentedPagerExample-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "it.3bus.${PRODUCT_NAME:rfc1034identifier}"; + DEVELOPMENT_TEAM = NFE8L9VTV6; + INFOPLIST_FILE = ThSegmentedPagerExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.jyhu.ThSegmentedPagerExample; PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; + PROVISIONING_PROFILE = "4586ff62-821a-4e40-99a7-7682f668d1ca"; + PROVISIONING_PROFILE_SPECIFIER = "hujinyou-mbp-dev-all-170329"; }; name = Debug; }; - 99C8C831198281240039193A /* Release */ = { + 1C1AEF9D1F4EA624005C8FB8 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B86019CAE24EC80D2397F99D /* Pods.release.xcconfig */; + baseConfigurationReference = C8918BF900C98EEF7131C90D /* Pods-ThSegmentedPagerExample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = BrandAsset; - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "THSegmentedPagerExample/THSegmentedPagerExample-Prefix.pch"; - INFOPLIST_FILE = "THSegmentedPagerExample/THSegmentedPagerExample-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "it.3bus.${PRODUCT_NAME:rfc1034identifier}"; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = ThSegmentedPagerExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.jyhu.ThSegmentedPagerExample; PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - 99C8C833198281240039193A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 57357A84FB65AC89CDE5F74B /* Pods-THSegmentedPagerExampleTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/THSegmentedPagerExample.app/THSegmentedPagerExample"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "THSegmentedPagerExample/THSegmentedPagerExample-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = "THSegmentedPagerExampleTests/THSegmentedPagerExampleTests-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "it.3bus.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = xctest; - }; - name = Debug; - }; - 99C8C834198281240039193A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F436489982B76D37541A6DB1 /* Pods-THSegmentedPagerExampleTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/THSegmentedPagerExample.app/THSegmentedPagerExample"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "THSegmentedPagerExample/THSegmentedPagerExample-Prefix.pch"; - INFOPLIST_FILE = "THSegmentedPagerExampleTests/THSegmentedPagerExampleTests-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "it.3bus.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = xctest; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 99C8C7FE198281240039193A /* Build configuration list for PBXProject "THSegmentedPagerExample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 99C8C82D198281240039193A /* Debug */, - 99C8C82E198281240039193A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 99C8C82F198281240039193A /* Build configuration list for PBXNativeTarget "THSegmentedPagerExample" */ = { + 1C1AEF7F1F4EA624005C8FB8 /* Build configuration list for PBXProject "ThSegmentedPagerExample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 99C8C830198281240039193A /* Debug */, - 99C8C831198281240039193A /* Release */, + 1C1AEF991F4EA624005C8FB8 /* Debug */, + 1C1AEF9A1F4EA624005C8FB8 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 99C8C832198281240039193A /* Build configuration list for PBXNativeTarget "THSegmentedPagerExampleTests" */ = { + 1C1AEF9B1F4EA624005C8FB8 /* Build configuration list for PBXNativeTarget "ThSegmentedPagerExample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 99C8C833198281240039193A /* Debug */, - 99C8C834198281240039193A /* Release */, + 1C1AEF9C1F4EA624005C8FB8 /* Debug */, + 1C1AEF9D1F4EA624005C8FB8 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 99C8C7FB198281240039193A /* Project object */; + rootObject = 1C1AEF7C1F4EA624005C8FB8 /* Project object */; } diff --git a/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1318ca7..898c493 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:ThSegmentedPagerExample.xcodeproj"> diff --git a/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/xcshareddata/xcschemes/THSegmentedPagerExample.xcscheme b/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/xcshareddata/xcschemes/THSegmentedPagerExample.xcscheme deleted file mode 100644 index 5f022ae..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/xcshareddata/xcschemes/THSegmentedPagerExample.xcscheme +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/THSegmentedPagerExample/THSegmentedPagerExample.xcworkspace/contents.xcworkspacedata b/THSegmentedPagerExample/THSegmentedPagerExample.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index ebc18af..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/THSegmentedPagerExample/THSegmentedPagerExample.xcworkspace/xcshareddata/THSegmentedPagerExample.xccheckout b/THSegmentedPagerExample/THSegmentedPagerExample.xcworkspace/xcshareddata/THSegmentedPagerExample.xccheckout deleted file mode 100644 index debb9d2..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample.xcworkspace/xcshareddata/THSegmentedPagerExample.xccheckout +++ /dev/null @@ -1,41 +0,0 @@ - - - - - IDESourceControlProjectFavoriteDictionaryKey - - IDESourceControlProjectIdentifier - FEDAB18C-D2CA-4BE0-B96A-C3B4C7824FBD - IDESourceControlProjectName - THSegmentedPagerExample - IDESourceControlProjectOriginsDictionary - - 28D1BF7DB311DBDC3521C5ECE4B3F708CC3BC6C2 - https://github.com/hons82/THSegmentedPager.git - - IDESourceControlProjectPath - THSegmentedPagerExample/THSegmentedPagerExample.xcworkspace - IDESourceControlProjectRelativeInstallPathDictionary - - 28D1BF7DB311DBDC3521C5ECE4B3F708CC3BC6C2 - ../.. - - IDESourceControlProjectURL - https://github.com/hons82/THSegmentedPager.git - IDESourceControlProjectVersion - 111 - IDESourceControlProjectWCCIdentifier - 28D1BF7DB311DBDC3521C5ECE4B3F708CC3BC6C2 - IDESourceControlProjectWCConfigurations - - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - 28D1BF7DB311DBDC3521C5ECE4B3F708CC3BC6C2 - IDESourceControlWCCName - THSegmentedPager - - - - diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/AppDelegate.h b/THSegmentedPagerExample/THSegmentedPagerExample/AppDelegate.h index ca2b9f0..0462f7a 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/AppDelegate.h +++ b/THSegmentedPagerExample/THSegmentedPagerExample/AppDelegate.h @@ -1,9 +1,9 @@ // // AppDelegate.h -// THSegmentedPagerExample +// ThSegmentedPagerExample // -// Created by Hannes Tribus on 25/07/14. -// Copyright (c) 2014 3Bus. All rights reserved. +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. // #import @@ -12,4 +12,6 @@ @property (strong, nonatomic) UIWindow *window; + @end + diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/AppDelegate.m b/THSegmentedPagerExample/THSegmentedPagerExample/AppDelegate.m index 69264c2..b42ce8d 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/AppDelegate.m +++ b/THSegmentedPagerExample/THSegmentedPagerExample/AppDelegate.m @@ -1,36 +1,51 @@ // // AppDelegate.m -// THSegmentedPagerExample +// ThSegmentedPagerExample // -// Created by Hannes Tribus on 25/07/14. -// Copyright (c) 2014 3Bus. All rights reserved. +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. // #import "AppDelegate.h" -#import "THSegmentedPager.h" -#import "SamplePagedViewController.h" -//#define LOAD_WITH_IDENTIFIERS = 0; +@interface AppDelegate () + +@end @implementation AppDelegate -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - THSegmentedPager *pager = (THSegmentedPager *)((UINavigationController *)self.window.rootViewController).topViewController; -#ifndef LOAD_WITH_IDENTIFIERS - NSMutableArray *pages = [NSMutableArray new]; - for (int i = 1; i < 4; i++) { - // Create a new view controller and pass suitable data. - SamplePagedViewController *pagedViewController = [pager.storyboard instantiateViewControllerWithIdentifier:@"SamplePagedViewController"]; - [pagedViewController setViewTitle:[NSString stringWithFormat:@"Page %d",i]]; - [pagedViewController.view setBackgroundColor:[UIColor colorWithHue:((i/8)%20)/20.0+0.02 saturation:(i%8+3)/10.0 brightness:91/100.0 alpha:1]]; - [pages addObject:pagedViewController]; - } - [pager setPages:pages]; -#else - [pager setupPagesFromStoryboardWithIdentifiers:@[@"SamplePagedViewController",@"SamplePagedViewController",@"SamplePagedViewController"]]; -#endif + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. return YES; } + +- (void)applicationWillResignActive:(UIApplication *)application { + // 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. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // 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. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // 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. +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + + @end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/AppIcon.appiconset/Contents.json b/THSegmentedPagerExample/THSegmentedPagerExample/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 54% rename from THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/AppIcon.appiconset/Contents.json rename to THSegmentedPagerExample/THSegmentedPagerExample/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..36d2c80 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/THSegmentedPagerExample/THSegmentedPagerExample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -29,6 +29,36 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" } ], "info" : { diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/Base.lproj/LaunchScreen.storyboard b/THSegmentedPagerExample/THSegmentedPagerExample/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..fdf3f97 --- /dev/null +++ b/THSegmentedPagerExample/THSegmentedPagerExample/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/Base.lproj/Main.storyboard b/THSegmentedPagerExample/THSegmentedPagerExample/Base.lproj/Main.storyboard new file mode 100644 index 0000000..d8ee995 --- /dev/null +++ b/THSegmentedPagerExample/THSegmentedPagerExample/Base.lproj/Main.storyboard @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.h b/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.h new file mode 100644 index 0000000..d0d9125 --- /dev/null +++ b/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.h @@ -0,0 +1,15 @@ +// +// BaseTableViewController.h +// ThSegmentedPagerExample +// +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. +// + +#import + +@interface BaseTableViewController : UITableViewController + +- (instancetype)initWithTitle:(NSString *)title; + +@end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m b/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m new file mode 100644 index 0000000..accc276 --- /dev/null +++ b/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m @@ -0,0 +1,66 @@ +// +// BaseTableViewController.m +// ThSegmentedPagerExample +// +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. +// + +#import "BaseTableViewController.h" + +@interface BaseTableViewController () + +@end + +@implementation BaseTableViewController + +- (instancetype)initWithTitle:(NSString *)title +{ + if (self = [super initWithStyle:UITableViewStyleGrouped]) { + self.title = title; + } + + return self; +} + +- (instancetype)initWithStyle:(UITableViewStyle)style +{ + return [super initWithStyle:UITableViewStyleGrouped]; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.tableView.tableFooterView = [UIView new]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return arc4random_uniform(10) + 2; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return arc4random_uniform(20) + 5; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *reusefulIdentifier = @"reusefulIdentifier"; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reusefulIdentifier]; + + if (!cell) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reusefulIdentifier]; + } + + cell.textLabel.text = [NSString stringWithFormat:@"%ld - %ld", indexPath.section, indexPath.row]; + + return cell; +} + + +@end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/BrandAsset.launchimage/Contents.json b/THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/BrandAsset.launchimage/Contents.json deleted file mode 100644 index e6c8ec6..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/BrandAsset.launchimage/Contents.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "8.0", - "subtype" : "736h", - "scale" : "3x" - }, - { - "orientation" : "landscape", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "8.0", - "subtype" : "736h", - "scale" : "3x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "8.0", - "subtype" : "667h", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "subtype" : "retina4", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/Contents.json b/THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/Contents.json deleted file mode 100644 index da4a164..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample/Images.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/THSegmentedPagerExample-Info.plist b/THSegmentedPagerExample/THSegmentedPagerExample/Info.plist similarity index 68% rename from THSegmentedPagerExample/THSegmentedPagerExample/THSegmentedPagerExample-Info.plist rename to THSegmentedPagerExample/THSegmentedPagerExample/Info.plist index 92083c6..d052473 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/THSegmentedPagerExample-Info.plist +++ b/THSegmentedPagerExample/THSegmentedPagerExample/Info.plist @@ -4,30 +4,26 @@ CFBundleDevelopmentRegion en - CFBundleDisplayName - ${PRODUCT_NAME} CFBundleExecutable - ${EXECUTABLE_NAME} + $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName - ${PRODUCT_NAME} + $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString - 1.1.0 - CFBundleSignature - ???? + 1.0 CFBundleVersion - 6 + 1 LSRequiresIPhoneOS UILaunchStoryboardName - Launch Screen + LaunchScreen UIMainStoryboardFile - iPhone + Main UIRequiredDeviceCapabilities armv7 @@ -38,5 +34,12 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/Launch Screen.storyboard b/THSegmentedPagerExample/THSegmentedPagerExample/Launch Screen.storyboard deleted file mode 100644 index 8b5865c..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample/Launch Screen.storyboard +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.h b/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.h new file mode 100644 index 0000000..9f60b76 --- /dev/null +++ b/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.h @@ -0,0 +1,13 @@ +// +// PagerViewController.h +// ThSegmentedPagerExample +// +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. +// + +#import + +@interface PagerViewController : THSegmentedPager + +@end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m b/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m new file mode 100644 index 0000000..a35adf1 --- /dev/null +++ b/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m @@ -0,0 +1,55 @@ +// +// PagerViewController.m +// ThSegmentedPagerExample +// +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. +// + +#import "PagerViewController.h" +#import "BaseTableViewController.h" + +@interface PagerViewController () + +@end + +@implementation PagerViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.navigationController.navigationBar.translucent = NO; + + self.shouldBounce = NO; + + BaseTableViewController *b1 = [[BaseTableViewController alloc] initWithTitle:@"B1"]; + BaseTableViewController *b2 = [[BaseTableViewController alloc] initWithTitle:@"B2"]; + BaseTableViewController *b3 = [[BaseTableViewController alloc] initWithTitle:@"B3"]; + BaseTableViewController *b4 = [[BaseTableViewController alloc] initWithTitle:@"B4"]; + + [self setPages:@[b1, b2, b3, b4]]; + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self setPageControlHidden:YES animated:YES]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self setPageControlHidden:NO animated:YES]; + }); + }); +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/SamplePagedViewController.h b/THSegmentedPagerExample/THSegmentedPagerExample/SamplePagedViewController.h deleted file mode 100644 index 9369151..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample/SamplePagedViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// SamplePagedViewController.h -// THSegmentedPagerExample -// -// Created by Hannes Tribus on 25/07/14. -// Copyright (c) 2014 3Bus. All rights reserved. -// - -#import -#import "THSegmentedPageViewControllerDelegate.h" - -@interface SamplePagedViewController : UIViewController - -@property(nonatomic,strong)NSString *viewTitle; - -@end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/SamplePagedViewController.m b/THSegmentedPagerExample/THSegmentedPagerExample/SamplePagedViewController.m deleted file mode 100644 index 6a013b0..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample/SamplePagedViewController.m +++ /dev/null @@ -1,29 +0,0 @@ -// -// SamplePagedViewController.m -// THSegmentedPagerExample -// -// Created by Hannes Tribus on 25/07/14. -// Copyright (c) 2014 3Bus. All rights reserved. -// - -#import "SamplePagedViewController.h" - -@interface SamplePagedViewController () - -@property (weak, nonatomic) IBOutlet UILabel *sampleLabel; - -@end - -@implementation SamplePagedViewController - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - [self.sampleLabel setText:self.viewControllerTitle]; -} - -- (NSString *)viewControllerTitle { - return self.viewTitle ? self.viewTitle : self.title; -} - -@end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/THSegmentedPagerExample-Prefix.pch b/THSegmentedPagerExample/THSegmentedPagerExample/THSegmentedPagerExample-Prefix.pch deleted file mode 100644 index 743435c..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample/THSegmentedPagerExample-Prefix.pch +++ /dev/null @@ -1,16 +0,0 @@ -// -// Prefix header -// -// The contents of this file are implicitly included at the beginning of every source file. -// - -#import - -#ifndef __IPHONE_3_0 -#warning "This project uses features only available in iOS SDK 3.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.h b/THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.h new file mode 100644 index 0000000..1f9b26e --- /dev/null +++ b/THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.h @@ -0,0 +1,13 @@ +// +// TestViewController.h +// ThSegmentedPagerExample +// +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. +// + +#import + +@interface TestViewController : THSegmentedPager + +@end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.m b/THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.m new file mode 100644 index 0000000..cba9a34 --- /dev/null +++ b/THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.m @@ -0,0 +1,52 @@ +// +// TestViewController.m +// ThSegmentedPagerExample +// +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. +// + +#import "TestViewController.h" +#import "PagerViewController.h" + +@interface TestViewController () + +@end + +@implementation TestViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.navigationController.navigationBar.translucent = NO; + + self.pageControl.backgroundColor = [UIColor blackColor]; + + PagerViewController *p1 = [[PagerViewController alloc] init]; + p1.title = @"P1"; + PagerViewController *p2 = [[PagerViewController alloc] init]; + p2.title = @"P2"; + PagerViewController *p3 = [[PagerViewController alloc] init]; + p3.title = @"P3"; + PagerViewController *p4 = [[PagerViewController alloc] init]; + p4.title = @"P4"; + + [self setPages:@[p1, p2, p3, p4]]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/ViewController.h b/THSegmentedPagerExample/THSegmentedPagerExample/ViewController.h new file mode 100644 index 0000000..9067ac6 --- /dev/null +++ b/THSegmentedPagerExample/THSegmentedPagerExample/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// ThSegmentedPagerExample +// +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/ViewController.m b/THSegmentedPagerExample/THSegmentedPagerExample/ViewController.m new file mode 100644 index 0000000..0f818e5 --- /dev/null +++ b/THSegmentedPagerExample/THSegmentedPagerExample/ViewController.m @@ -0,0 +1,49 @@ +// +// ViewController.m +// ThSegmentedPagerExample +// +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. +// + +#import "ViewController.h" +#import "PagerViewController.h" +#import "TestViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} +- (IBAction)example01:(id)sender { + [self.navigationController pushViewController:[[PagerViewController alloc] init] animated:YES]; +} +- (IBAction)example02:(id)sender { + [self.navigationController pushViewController:[[TestViewController alloc] init] animated:YES]; +} +- (IBAction)example03:(id)sender { + THSegmentedPager *pager = [[THSegmentedPager alloc] init]; + pager.needPagerAnimateWhenSegmentSelectionChanged = YES; + [pager setupPagesFromStoryboardWithIdentifier:@"Main" pageIdentifiers:@[@"T01", @"T02", @"T03"]]; + [self.navigationController pushViewController:pager animated:YES]; + + pager.navigationController.navigationBar.translucent = NO; +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + [self.navigationController pushViewController:[[TestViewController alloc] init] animated:YES]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +@end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/en.lproj/InfoPlist.strings b/THSegmentedPagerExample/THSegmentedPagerExample/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/iPhone.storyboard b/THSegmentedPagerExample/THSegmentedPagerExample/iPhone.storyboard deleted file mode 100644 index f666263..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExample/iPhone.storyboard +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/main.m b/THSegmentedPagerExample/THSegmentedPagerExample/main.m index 46ba8ee..1e49baf 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/main.m +++ b/THSegmentedPagerExample/THSegmentedPagerExample/main.m @@ -1,17 +1,15 @@ // // main.m -// THSegmentedPagerExample +// ThSegmentedPagerExample // -// Created by Hannes Tribus on 25/07/14. -// Copyright (c) 2014 3Bus. All rights reserved. +// Created by 胡金友 on 2017/8/24. +// Copyright © 2017年 胡金友. All rights reserved. // #import - #import "AppDelegate.h" -int main(int argc, char * argv[]) -{ +int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } diff --git a/THSegmentedPagerExample/THSegmentedPagerExampleTests/ReferenceImages/THSegmentedPagerSpec/with_Foo_Bar_Baz_pages_looks_good@2x.png b/THSegmentedPagerExample/THSegmentedPagerExampleTests/ReferenceImages/THSegmentedPagerSpec/with_Foo_Bar_Baz_pages_looks_good@2x.png deleted file mode 100644 index 9076fc8b602b8585ee691a6d08859077d7973eef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33698 zcmeHvX;f2J`>#j=TR^l}KoL^wE7&R`Dntbmts+{5v`*jvK~a%G0wQBbBBD@5Of9V_ z2ytjd5Q&J4AqmK&Wr&IpAQKQtfIvbBNk~qH{|TaXt@d5(ez+g*|E_$fAsY>|6<7(bLPx3-?el5-Z^vT3g^r*a+_xiUipi@UiV=Tv)B9kIVBxSN5CJS zN9{ZmGiQ#~3f;?K*WUk3fESmBZb$3~Kj(rk-A69?w(|X_?)&z|(F{YgIditm*|mM^ z{se*3{ddy7|nqs5ZU?-wnFZ)~(!XtHRj}IWWbvm*Fr1@`?y4lonM67h%8q(O) zOYwLEL$kGYbKbvIn|o|eIcvQW^ETbU*e2+_?(J){c|uK7J+I zuktSB6iW&m>k1%14w9wvf$k&VF!LJSph4T}-1%&|S@ z_R`9`>x1luQCkRdVkzt(cV;Yf`!(0dYyJK}}9Vz8^sNgKA%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ar_is_selected_looks_good@2x.png b/THSegmentedPagerExample/THSegmentedPagerExampleTests/ReferenceImages/THSegmentedPagerSpec/with_Foo_Bar_Baz_pages_when_Bar_is_selected_looks_good@2x.png deleted file mode 100644 index 418684fa494bb66b5eb1dcbee3714e6db91cd6d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 35882 zcmeHwd0f)z_itrtWo1o^Whpf?Ei?J&S80Ey?)m-aVW4q&z)ttW!22}dNBf2aUetq-gO~OQ}t$V zsG9QSrEHGVzJv=VyOAG~ry49d8Lxd=F?)u9+}Go1`S-{4fhPTHXWrVLwf=e~(2_`+ ziT!p}R{YfJ%B_Fy>sTH1^+rI8cc|T|zb{$1VMVFQ+FLUj7aJ#^KO1N<5`1?_!Zd^F z(rLRkox&C_{n8zvPt&8SncrPkHPod0`%5M# z=aubuBb}HWQdxqOEUnCohF3>b`)3iRB3Z-|`B4}L7-Ii@m`@OzlF=Bljgk>T7pCP2 zr9OoMJdIK(KXy}J+MnQ-8aTS)*=(I#rd}ln}V>TYK_UN5LzSnN-^`%dy4E zZ;xKwjWx7&E2yuD*U!|WCw^<6s~6dQDaujMIOkZi_mIW7YR-U2ZPQLYzrNJYIOv{N zYVuSg2g3sWZ|%zshDwcuk=@v3g;}Hy&tb)~W{xWG8K&(RFzk-aWvh*WzRvYBl7DUA zGP@(pgvBqlvpcyh>N&ATYL`V*(2s%gp7*ev3Ii^|@RLp%w#Q+xs@0qlQ+{5V{>Pxl{fh-x2OVbl^t+%6(Q) z)_-pS#aSbxnUGUIZ0ftzmWbn>*1Yu~Ux*Mj+F2n;+#Kvtka{@TgAmggc+|r?;x?Gh z@dUKuawJO9=3(X203Cm2Qh<}a^Dn@Szg|;dK61q+C?8fAQHw0!5)#?HVEuHf=xU>* zt-GW@3)$m!cIU^ZN4!I<#O^y=iB99AkOMnFCo(_Lpz6`IHVGX{L5Q3d zOF$_8mD*X_U4&5ffheMnJ}Rd&jl$bRB13U_6>*uHOWh^0A}qT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DI_(x{P!zM$c0dQVO7sZnkNLdn8PiNO!TF#UK*L`f16CCf`oUU-2M$?bBX$2gYVyWaBuPMfTaHe DN3^n{ diff --git a/THSegmentedPagerExample/THSegmentedPagerExampleTests/Storyboard.storyboard b/THSegmentedPagerExample/THSegmentedPagerExampleTests/Storyboard.storyboard deleted file mode 100644 index 2758d34..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExampleTests/Storyboard.storyboard +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/THSegmentedPagerExample/THSegmentedPagerExampleTests/THSegmentedPagerExampleTests-Info.plist b/THSegmentedPagerExample/THSegmentedPagerExampleTests/THSegmentedPagerExampleTests-Info.plist deleted file mode 100644 index 169b6f7..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExampleTests/THSegmentedPagerExampleTests-Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/THSegmentedPagerExample/THSegmentedPagerExampleTests/THSegmentedPagerTests.m b/THSegmentedPagerExample/THSegmentedPagerExampleTests/THSegmentedPagerTests.m deleted file mode 100644 index dc6d43e..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExampleTests/THSegmentedPagerTests.m +++ /dev/null @@ -1,89 +0,0 @@ -// -// THSegmentedPagerTests.m -// THSegmentedPagerExample -// -// Created by Victor Ilyukevich on 4/18/15. -// Copyright (c) 2015 3Bus. All rights reserved. -// - -#import -#import -#import -#import -#import "THSegmentedPager.h" - -void TriggerViewAppearing(UIViewController *controller); - -SpecBegin(THSegmentedPager) - -__block THSegmentedPager *subject; - -beforeEach(^{ - UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:[NSBundle bundleForClass:self.class]]; - subject = [storyboard instantiateInitialViewController]; -}); - -it(@"can load and then add pages from Storyboard", ^{ - expect(subject.pages.count).to.equal(0); - [subject setupPagesFromStoryboardWithIdentifiers:@[@"Foo", @"Bar"]]; - expect(subject.pages.count).to.equal(2); - [subject setupPagesFromStoryboardWithIdentifiers:@[@"Baz"]]; - expect(subject.pages.count).to.equal(3); - - TriggerViewAppearing(subject); - expect(subject.pageControl.sectionTitles).to.equal(@[@"Foo", @"Bar", @"Baz"]); -}); - -context(@"with one page", ^{ - beforeEach(^{ - [subject setupPagesFromStoryboardWithIdentifiers:@[@"Baz"]]; - TriggerViewAppearing(subject); - }); - it(@"is selected by default", ^{ - expect(subject.selectedController.title).to.equal(@"Baz"); - }); - it(@"looks good", ^{ - //expect(subject).to.recordSnapshot(); - expect(subject).to.haveValidSnapshot(); - }); -}); - -context(@"with Foo, Bar, Baz pages", ^{ - beforeEach(^{ - [subject setupPagesFromStoryboardWithIdentifiers:@[@"Foo", @"Bar", @"Baz"]]; - TriggerViewAppearing(subject); - }); - - it(@"has Foo selected by default as the first page", ^{ - expect(subject.selectedController.title).to.equal(@"Foo"); - }); - - it(@"looks good", ^{ - //expect(subject).to.recordSnapshot(); - expect(subject).to.haveValidSnapshot(); - }); - - context(@"when Bar is selected", ^{ - beforeEach(^{ - [subject setSelectedPageIndex:1 animated:NO]; - }); - - it(@"has Bar selected", ^{ - expect(subject.selectedController.title).to.equal(@"Bar"); - }); - - it(@"looks good", ^{ - //expect(subject).to.recordSnapshot(); - expect(subject).to.haveValidSnapshot(); - }); - }); -}); - -SpecEnd - -void TriggerViewAppearing(UIViewController *controller) -{ - [controller beginAppearanceTransition:YES animated:NO]; - [controller.view setNeedsUpdateConstraints]; - [controller endAppearanceTransition]; -} diff --git a/THSegmentedPagerExample/THSegmentedPagerExampleTests/en.lproj/InfoPlist.strings b/THSegmentedPagerExample/THSegmentedPagerExampleTests/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/THSegmentedPagerExample/THSegmentedPagerExampleTests/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/ThSegmentedPagerExample/Podfile b/ThSegmentedPagerExample/Podfile new file mode 100644 index 0000000..53aa050 --- /dev/null +++ b/ThSegmentedPagerExample/Podfile @@ -0,0 +1,8 @@ +use_frameworks! +platform:'ios', '8.0' + +target 'ThSegmentedPagerExample' do + +pod 'THSegmentedPager', :path => '../../THSegmentedPager' + +end diff --git a/ThSegmentedPagerExample/Podfile.lock b/ThSegmentedPagerExample/Podfile.lock new file mode 100644 index 0000000..4cc0f78 --- /dev/null +++ b/ThSegmentedPagerExample/Podfile.lock @@ -0,0 +1,19 @@ +PODS: + - HMSegmentedControl (1.5.4) + - THSegmentedPager (1.1.3): + - HMSegmentedControl (~> 1.5.2) + +DEPENDENCIES: + - THSegmentedPager (from `../../THSegmentedPager`) + +EXTERNAL SOURCES: + THSegmentedPager: + :path: ../../THSegmentedPager + +SPEC CHECKSUMS: + HMSegmentedControl: b25bc4ec44766e073d62c473188fb354ee244b76 + THSegmentedPager: 9d4fb2acc78d77246caf1e71d2e878bf5977b904 + +PODFILE CHECKSUM: 4c62b73aa77c867cac98f2dddce0bf6dc9b16228 + +COCOAPODS: 1.2.1 diff --git a/ThSegmentedPagerExample/ThSegmentedPagerExample.xcworkspace/contents.xcworkspacedata b/ThSegmentedPagerExample/ThSegmentedPagerExample.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..41fea34 --- /dev/null +++ b/ThSegmentedPagerExample/ThSegmentedPagerExample.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + From d4e9683c472b7e62c2ebceec44a1e480f8360311 Mon Sep 17 00:00:00 2001 From: JyHu Date: Fri, 25 Aug 2017 01:45:18 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=96=B9=E6=B3=95=E5=92=8C=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 0 -> 6148 bytes THSegmentedPager/THSegmentedPager.h | 16 ++- THSegmentedPager/THSegmentedPager.m | 95 +++++++++++++++++- THSegmentedPagerExample/.gitignore | 28 ++++++ .../project.pbxproj | 16 +-- .../BaseTableViewController.m | 83 ++++++++++++++- .../THSegmentedPagerExample/Info.plist | 2 + .../PagerViewController.m | 7 -- ThSegmentedPagerExample/Podfile.lock | 6 +- .../contents.xcworkspacedata | 3 + 10 files changed, 229 insertions(+), 27 deletions(-) create mode 100644 .DS_Store create mode 100644 THSegmentedPagerExample/.gitignore diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..cef93007b3923f584a57d6eba42dcd2ca6545d03 GIT binary patch literal 6148 zcmeHK%Wl&^6ur|1>hKU*RBD&ADXWO43bbsHtTYuMp{kM#EC97OHjTmYM1It5Ly&(1 z{-|Hj-{H(7s8y&UHVDzV(%f@Bb03}~&y0tNSg#B>h+0JCph;}pf%=WeaoJ{M!SpnM zOy!6vp@<$qiy3d*VHvOt{A&!zwR?}AW7Q7n6J1`vAL+}e2ws(Wk-_I7y`~&q8T2}R zrc)YF39FBlUQw!6yicJT-KQ7i!S@I`Ba9W$A?=Zm9+_c%PR(6Y^V;`9{0hyhvO_1R zIHZx>lY%NA1&Ig{c^-_CI4?S#3%0P>xOIEUX*QkaedmKW5S3T>MVa^f?45dw!zeKJ zz7WYT+YjEvQFYK--WF-$$7z&Za)19ePD4@kM45)U%CqMe1H`IA2d&ldxZ8c&=1)4C zlQti3ZFSoGad&evah#R4jb|?pho@)buaj@z@v;zxtyRebgH!kc;}2;#_Odh)=@BBQ zS*O`7-Z%!#C*a(@aWl6QwhUMX<}o1m2aYDuHCSs@TL+Z70s!T2gc8{DE+J#MLDyid z5hD<$LxDP!nJWg<;ppea&ox+U)ZxU;<%5~Z%-m3zs*e0zxf63WT5TDy3|wVkQ9rii z`M-1h{r_r^eX *pages; @property (assign, nonatomic) BOOL shouldBounce; /*! Instead of setting the pages manually you can give to the controller an array of identifiers which will be loaded from the storyboard at runtime * \param pageIdentifiers Array of identifiers to load */ -- (void)setupPagesFromStoryboardWithIdentifier:(NSString *)storybardIdentifier pageIdentifiers:(NSArray *)pageIdentifiers; -- (void)setupPagesFromStoryboard:(UIStoryboard *)storyboard pageIdentifiers:(NSArray *)pageIdentifiers; -- (void)setupPagesFromStoryboardWithPageIdentifiers:(NSArray *)pageIdentifiers; +- (void)setupPagesFromStoryboardWithIdentifier:(NSString *)storybardIdentifier pageIdentifiers:(NSArray *)pageIdentifiers; +- (void)setupPagesFromStoryboard:(UIStoryboard *)storyboard pageIdentifiers:(NSArray *)pageIdentifiers; +- (void)setupPagesFromStoryboardWithPageIdentifiers:(NSArray *)pageIdentifiers; - (void)setPageControlHidden:(BOOL)hidden animated:(BOOL)animated; - (void)setSelectedPageIndex:(NSUInteger)index animated:(BOOL)animated; +- (void)setPageControlHeight:(CGFloat)pageControlHeight; +- (void)setPageControlHeight:(CGFloat)pageControlHeight animated:(BOOL)animated; /*! Get the selected viewcontroller @@ -41,3 +43,9 @@ - (void)updateTitleLabels; @end + +@interface UIViewController (THSegmentedPager) + +@property (weak, nonatomic) THSegmentedPager *segmentedPager; + +@end diff --git a/THSegmentedPager/THSegmentedPager.m b/THSegmentedPager/THSegmentedPager.m index e02f9b3..723d59b 100644 --- a/THSegmentedPager/THSegmentedPager.m +++ b/THSegmentedPager/THSegmentedPager.m @@ -8,6 +8,7 @@ #import "THSegmentedPager.h" #import "THSegmentedPageViewControllerDelegate.h" +#import @interface THSegmentedPager () @property (nonatomic,assign) CGFloat lastPosition; @@ -98,6 +99,7 @@ - (void)setupPagesFromStoryboard:(UIStoryboard *)storyboard pageIdentifiers:(NSA for (NSString *identifier in pageIdentifiers) { UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:identifier]; if (viewController) { + viewController.segmentedPager = self; [self.pri_pages addObject:viewController]; } } @@ -134,6 +136,7 @@ - (void)setPageControlHidden:(BOOL)hidden animated:(BOOL)animated { } else if (!hidden && self.pri_segmentControl.hidden) { self.pri_segmentControl.hidden = NO; [UIView animateWithDuration:duration animations:^{ +#warning - 需要在动画结束以后再改变container的高度,否则会在动画的过程中导致底部出现一部分的空白 CGRect remainder; CGRect slice; CGRectDivide(self.pri_contentContainer.frame, &slice, &remainder, CGRectGetHeight(self.pri_segmentControl.frame), CGRectMinYEdge); @@ -358,11 +361,44 @@ - (NSArray *)pages return self.pri_pages; } -- (void)setPages:(NSArray *)pages +- (void)setPages:(NSArray *)pages { if (pages) { - [self.pri_pages removeAllObjects]; - [self.pri_pages addObjectsFromArray:pages]; + self.pri_pages = [pages mutableCopy]; + for (UIViewController *viewController in pages) { + viewController.segmentedPager = self; + } + } +} + +- (void)setPageControlHeight:(CGFloat)pageControlHeight +{ + [self setPageControlHeight:pageControlHeight animated:NO]; +} + +- (void)setPageControlHeight:(CGFloat)pageControlHeight animated:(BOOL)animated +{ + if (pageControlHeight > 0) { + if (self.pageControl.hidden) { + self.pageControl.frame = (CGRect){self.pageControl.frame.origin, (CGSize){self.pageControl.frame.size.width, pageControlHeight}}; + } else { + NSTimeInterval duration = animated ? 0.25f : 0.0f; + [UIView animateWithDuration:duration animations:^{ + + CGRect pageControlFrame = self.pageControl.frame; + CGRect contentContainerFrame = self.contentContainer.frame; + + CGFloat increaseHeight = pageControlHeight - CGRectGetHeight(pageControlFrame); + + pageControlFrame.size.height = pageControlHeight; + + contentContainerFrame.origin.y = CGRectGetMaxY(pageControlFrame); + contentContainerFrame.size.height -= increaseHeight; + + self.pageControl.frame = pageControlFrame; + self.contentContainer.frame = contentContainerFrame; + }]; + } } } @@ -371,3 +407,56 @@ - (UIViewController *)selectedController { } @end + + + + + + + + + +@interface _THWeakContainer : NSObject + +@property (weak, nonatomic) THSegmentedPager *segmentedPager; + +@end + +@implementation _THWeakContainer + +@end + +@interface UIViewController (_THSegmentedPager) + +@property (retain, nonatomic) _THWeakContainer *weakContainer; + +@end + +@implementation UIViewController (THSegmentedPager) + +- (void)setSegmentedPager:(THSegmentedPager *)segmentedPager { + if ([segmentedPager isKindOfClass:[THSegmentedPager class]]) { + self.weakContainer.segmentedPager = segmentedPager; + } +} + +- (THSegmentedPager *)segmentedPager { + return self.weakContainer.segmentedPager; +} + +- (void)setWeakContainer:(_THWeakContainer *)weakContainer { + objc_setAssociatedObject(self, @selector(weakContainer), weakContainer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (_THWeakContainer *)weakContainer { + _THWeakContainer *weakContainer = objc_getAssociatedObject(self, @selector(weakContainer)); + if (!weakContainer) { + weakContainer = [[_THWeakContainer alloc] init]; + self.weakContainer = weakContainer; + } + return weakContainer; +} + +@end + + diff --git a/THSegmentedPagerExample/.gitignore b/THSegmentedPagerExample/.gitignore new file mode 100644 index 0000000..3766327 --- /dev/null +++ b/THSegmentedPagerExample/.gitignore @@ -0,0 +1,28 @@ + + + +# Xcode +.DS_Store +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +*.xcworkspace +!default.xcworkspace +xcuserdata +profile +*.moved-aside +DerivedData +.idea/ +# Pods - for those of you who use CocoaPods +Pods +Podfile.lock +*.xcuserstate + + + diff --git a/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj b/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj index 6811ccd..ae86d73 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj +++ b/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj @@ -152,8 +152,8 @@ TargetAttributes = { 1C1AEF831F4EA624005C8FB8 = { CreatedOnToolsVersion = 8.3.3; - DevelopmentTeam = NFE8L9VTV6; - ProvisioningStyle = Manual; + DevelopmentTeam = EHNB49T236; + ProvisioningStyle = Automatic; }; }; }; @@ -201,7 +201,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; 99318926B5411CB48DAF2087 /* [CP] Embed Pods Frameworks */ = { @@ -369,13 +369,14 @@ baseConfigurationReference = FE52F4410F6DFBC3E444EFA1 /* Pods-ThSegmentedPagerExample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = NFE8L9VTV6; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = EHNB49T236; INFOPLIST_FILE = ThSegmentedPagerExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.jyhu.ThSegmentedPagerExample; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "4586ff62-821a-4e40-99a7-7682f668d1ca"; - PROVISIONING_PROFILE_SPECIFIER = "hujinyou-mbp-dev-all-170329"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; }; @@ -384,7 +385,8 @@ baseConfigurationReference = C8918BF900C98EEF7131C90D /* Pods-ThSegmentedPagerExample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = EHNB49T236; INFOPLIST_FILE = ThSegmentedPagerExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.jyhu.ThSegmentedPagerExample; diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m b/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m index accc276..387765e 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m +++ b/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m @@ -7,6 +7,7 @@ // #import "BaseTableViewController.h" +#import @interface BaseTableViewController () @@ -28,6 +29,16 @@ - (instancetype)initWithStyle:(UITableViewStyle)style return [super initWithStyle:UITableViewStyleGrouped]; } +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + if (self.segmentedPager) { + self.segmentedPager.title = self.title; + if (self.segmentedPager.segmentedPager) { + self.segmentedPager.segmentedPager.title = self.title; + } + } +} + - (void)viewDidLoad { [super viewDidLoad]; @@ -42,11 +53,11 @@ - (void)didReceiveMemoryWarning { #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return arc4random_uniform(10) + 2; + return 3; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return arc4random_uniform(20) + 5; + return 12; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { @@ -57,10 +68,76 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reusefulIdentifier]; } - cell.textLabel.text = [NSString stringWithFormat:@"%ld - %ld", indexPath.section, indexPath.row]; + cell.textLabel.font = [UIFont systemFontOfSize:13]; + cell.backgroundColor = indexPath.row % 2 == 0 ? [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1] : [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1]; + + cell.textLabel.text = @[@"隐藏page control,需要动画", + @"显示page control,需要动画", + @"隐藏page control,不需要动画", + @"显示page control,不需要动画", + @"隐藏父pager的page control,需要动画", + @"显示父pager的page control,需要动画", + @"隐藏父pager的page control,不需要动画", + @"显示父pager的page control,不需要动画", + @"随机设置page control高度,需要动画", + @"随机设置page control高度,不需要动画", + @"随机设置父pager的page control高度,需要动画", + @"随机设置父pager的page control高度,不需要动画"][indexPath.row]; return cell; } +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + switch (indexPath.row) { + case 0: [self hideSelfPageControl:YES animate:YES]; break; + case 1: [self hideSelfPageControl:NO animate:YES]; break; + case 2: [self hideSelfPageControl:YES animate:NO]; break; + case 3: [self hideSelfPageControl:NO animate:NO]; break; + + case 4: [self hidePageControlOfSelfPageControl:YES animate:YES]; break; + case 5: [self hidePageControlOfSelfPageControl:NO animate:YES]; break; + case 6: [self hidePageControlOfSelfPageControl:YES animate:NO]; break; + case 7: [self hidePageControlOfSelfPageControl:NO animate:NO]; break; + + case 8: [self randomPageControlHeightWithAnimated:YES]; break; + case 9: [self randomPageControlHeightWithAnimated:NO]; break; + case 10: [self randomSuperPageControlHeightWithAnimated:YES]; break; + case 11: [self randomSuperPageControlHeightWithAnimated:NO]; break; + + default: + break; + } + + [tableView deselectRowAtIndexPath:indexPath animated:YES]; +} + +- (void)hideSelfPageControl:(BOOL)hide animate:(BOOL)animate +{ + if (self.segmentedPager) { + [self.segmentedPager setPageControlHidden:hide animated:animate]; + } +} + +- (void)hidePageControlOfSelfPageControl:(BOOL)hide animate:(BOOL)animate +{ + if (self.segmentedPager && self.segmentedPager.segmentedPager) { + [self.segmentedPager.segmentedPager setPageControlHidden:hide animated:animate]; + } +} + +- (void)randomPageControlHeightWithAnimated:(BOOL)animated +{ + if (self.segmentedPager) { + [self.segmentedPager setPageControlHeight:arc4random_uniform(50) + 20 animated:animated]; + } +} + +- (void)randomSuperPageControlHeightWithAnimated:(BOOL)animated +{ + if (self.segmentedPager && self.segmentedPager.segmentedPager) { + [self.segmentedPager.segmentedPager setPageControlHeight:arc4random_uniform(50) + 20 animated:animated]; + } +} @end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/Info.plist b/THSegmentedPagerExample/THSegmentedPagerExample/Info.plist index d052473..db03c64 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/Info.plist +++ b/THSegmentedPagerExample/THSegmentedPagerExample/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion en + CFBundleDisplayName + Pager CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m b/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m index a35adf1..1960720 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m +++ b/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m @@ -28,13 +28,6 @@ - (void)viewDidLoad { BaseTableViewController *b4 = [[BaseTableViewController alloc] initWithTitle:@"B4"]; [self setPages:@[b1, b2, b3, b4]]; - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self setPageControlHidden:YES animated:YES]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self setPageControlHidden:NO animated:YES]; - }); - }); } - (void)didReceiveMemoryWarning { diff --git a/ThSegmentedPagerExample/Podfile.lock b/ThSegmentedPagerExample/Podfile.lock index 4cc0f78..dbbbb75 100644 --- a/ThSegmentedPagerExample/Podfile.lock +++ b/ThSegmentedPagerExample/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - HMSegmentedControl (1.5.4) + - HMSegmentedControl (1.5.3) - THSegmentedPager (1.1.3): - HMSegmentedControl (~> 1.5.2) @@ -11,9 +11,9 @@ EXTERNAL SOURCES: :path: ../../THSegmentedPager SPEC CHECKSUMS: - HMSegmentedControl: b25bc4ec44766e073d62c473188fb354ee244b76 + HMSegmentedControl: 7c6145afb50f26cec5f3243082f6f12b9f41318f THSegmentedPager: 9d4fb2acc78d77246caf1e71d2e878bf5977b904 PODFILE CHECKSUM: 4c62b73aa77c867cac98f2dddce0bf6dc9b16228 -COCOAPODS: 1.2.1 +COCOAPODS: 1.1.1 diff --git a/ThSegmentedPagerExample/ThSegmentedPagerExample.xcworkspace/contents.xcworkspacedata b/ThSegmentedPagerExample/ThSegmentedPagerExample.xcworkspace/contents.xcworkspacedata index 41fea34..3f7af3b 100644 --- a/ThSegmentedPagerExample/ThSegmentedPagerExample.xcworkspace/contents.xcworkspacedata +++ b/ThSegmentedPagerExample/ThSegmentedPagerExample.xcworkspace/contents.xcworkspacedata @@ -7,4 +7,7 @@ + + From 8696287ad2a1076fcf0b36fd1fe1d4116adb6409 Mon Sep 17 00:00:00 2001 From: JyHu Date: Sun, 27 Aug 2017 00:22:26 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../THSegmentedPageViewControllerDelegate.h | 11 +++++++ THSegmentedPager/THSegmentedPager.h | 7 ++++- THSegmentedPager/THSegmentedPager.m | 25 ++++++++++++---- .../project.pbxproj | 14 ++++----- .../BaseTableViewController.m | 29 +++++++++++++++++++ .../TestViewController.m | 3 +- ThSegmentedPagerExample/Podfile.lock | 2 +- 7 files changed, 76 insertions(+), 15 deletions(-) diff --git a/THSegmentedPager/THSegmentedPageViewControllerDelegate.h b/THSegmentedPager/THSegmentedPageViewControllerDelegate.h index b0bb526..fe22aa2 100644 --- a/THSegmentedPager/THSegmentedPageViewControllerDelegate.h +++ b/THSegmentedPager/THSegmentedPageViewControllerDelegate.h @@ -8,10 +8,21 @@ #import +@class THSegmentedPager; + @protocol THSegmentedPageViewControllerDelegate @optional + +/** + 当前类需要实现的方法,用于返回当前选择的页面索引 + + @param controller self + @param index 页面索引 + */ +- (void)pageViewController:(THSegmentedPager *)controller changeToSelectedIndex:(NSUInteger)index; + - (NSString *)viewControllerTitle; @end diff --git a/THSegmentedPager/THSegmentedPager.h b/THSegmentedPager/THSegmentedPager.h index c933879..099a3de 100644 --- a/THSegmentedPager/THSegmentedPager.h +++ b/THSegmentedPager/THSegmentedPager.h @@ -8,8 +8,11 @@ #import #import +#import "THSegmentedPageViewControllerDelegate.h" -@interface THSegmentedPager : UIViewController +@interface THSegmentedPager : UIViewController + +- (instancetype)initWithContentEdgeInsets:(UIEdgeInsets)edgeInsets; @property (strong, nonatomic, readonly) HMSegmentedControl *pageControl; @property (strong, nonatomic, readonly) UIPageViewController *pageViewController; @@ -28,7 +31,9 @@ - (void)setupPagesFromStoryboardWithPageIdentifiers:(NSArray *)pageIdentifiers; - (void)setPageControlHidden:(BOOL)hidden animated:(BOOL)animated; + - (void)setSelectedPageIndex:(NSUInteger)index animated:(BOOL)animated; + - (void)setPageControlHeight:(CGFloat)pageControlHeight; - (void)setPageControlHeight:(CGFloat)pageControlHeight animated:(BOOL)animated; diff --git a/THSegmentedPager/THSegmentedPager.m b/THSegmentedPager/THSegmentedPager.m index 723d59b..a12240a 100644 --- a/THSegmentedPager/THSegmentedPager.m +++ b/THSegmentedPager/THSegmentedPager.m @@ -20,6 +20,7 @@ @interface THSegmentedPager () @property (strong, nonatomic) UIPageViewController *pri_pageViewController; @property (strong, nonatomic) UIView *pri_contentContainer; @property (strong, nonatomic) NSMutableArray *pri_pages; +@property (assign, nonatomic) UIEdgeInsets edgeInsets; @end @@ -27,6 +28,13 @@ @implementation THSegmentedPager @synthesize pri_pages = _pri_pages; +- (instancetype)initWithContentEdgeInsets:(UIEdgeInsets)edgeInsets { + if (self = [self init]) { + self.edgeInsets = edgeInsets; + } + return self; +} + - (instancetype)init { if (self = [super init]) { self.needPagerAnimateWhenSegmentSelectionChanged = NO; @@ -136,9 +144,7 @@ - (void)setPageControlHidden:(BOOL)hidden animated:(BOOL)animated { } else if (!hidden && self.pri_segmentControl.hidden) { self.pri_segmentControl.hidden = NO; [UIView animateWithDuration:duration animations:^{ -#warning - 需要在动画结束以后再改变container的高度,否则会在动画的过程中导致底部出现一部分的空白 - CGRect remainder; - CGRect slice; + CGRect remainder, slice; CGRectDivide(self.pri_contentContainer.frame, &slice, &remainder, CGRectGetHeight(self.pri_segmentControl.frame), CGRectMinYEdge); self.pri_contentContainer.frame = remainder; self.pri_segmentControl.alpha = 1.0f; @@ -293,7 +299,7 @@ - (void)pageControlValueChanged:(id)sender { - (UIView *)pri_contentContainer { if (!_pri_contentContainer) { - _pri_contentContainer = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.pri_segmentControl.frame), CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) - CGRectGetMaxY(self.pri_segmentControl.frame))]; + _pri_contentContainer = [[UIView alloc] initWithFrame:CGRectMake(self.edgeInsets.left, CGRectGetMaxY(self.pri_segmentControl.frame), CGRectGetWidth(self.view.frame) - self.edgeInsets.left - self.edgeInsets.right, CGRectGetHeight(self.view.frame) - CGRectGetMaxY(self.pri_segmentControl.frame) - self.edgeInsets.bottom)]; _pri_contentContainer.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; _pri_contentContainer.backgroundColor = [UIColor clearColor]; } @@ -317,7 +323,7 @@ - (UIPageViewController *)pri_pageViewController - (HMSegmentedControl *)pri_segmentControl { if (!_pri_segmentControl) { - _pri_segmentControl = [[HMSegmentedControl alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 40)]; + _pri_segmentControl = [[HMSegmentedControl alloc] initWithFrame:CGRectMake(self.edgeInsets.left, self.edgeInsets.top, CGRectGetWidth(self.view.bounds) - self.edgeInsets.left - self.edgeInsets.right, 40)]; _pri_segmentControl.autoresizingMask = UIViewAutoresizingFlexibleWidth; _pri_segmentControl.backgroundColor = [UIColor colorWithRed:69/255.0 green:69/255.0 blue:69/255.0 alpha:1]; _pri_segmentControl.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor colorWithRed:127/255.0 green:127/255.0 blue:127/255.0 alpha:1]}; @@ -406,6 +412,15 @@ - (UIViewController *)selectedController { return self.pri_pages[[self.pri_segmentControl selectedSegmentIndex]]; } +- (void)setCurrentIndex:(NSUInteger)currentIndex +{ + _currentIndex = currentIndex; + + if ([self respondsToSelector:@selector(pageViewController:changeToSelectedIndex:)]) { + [self pageViewController:self changeToSelectedIndex:currentIndex]; + } +} + @end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj b/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj index ae86d73..6d1c80f 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj +++ b/THSegmentedPagerExample/THSegmentedPagerExample.xcodeproj/project.pbxproj @@ -152,8 +152,8 @@ TargetAttributes = { 1C1AEF831F4EA624005C8FB8 = { CreatedOnToolsVersion = 8.3.3; - DevelopmentTeam = EHNB49T236; - ProvisioningStyle = Automatic; + DevelopmentTeam = NFE8L9VTV6; + ProvisioningStyle = Manual; }; }; }; @@ -201,7 +201,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; 99318926B5411CB48DAF2087 /* [CP] Embed Pods Frameworks */ = { @@ -370,13 +370,13 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = EHNB49T236; + DEVELOPMENT_TEAM = NFE8L9VTV6; INFOPLIST_FILE = ThSegmentedPagerExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.jyhu.ThSegmentedPagerExample; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE = "4586ff62-821a-4e40-99a7-7682f668d1ca"; + PROVISIONING_PROFILE_SPECIFIER = "hujinyou-mbp-dev-all-170329"; }; name = Debug; }; @@ -386,7 +386,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = EHNB49T236; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = ThSegmentedPagerExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.jyhu.ThSegmentedPagerExample; diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m b/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m index 387765e..65fbd32 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m +++ b/THSegmentedPagerExample/THSegmentedPagerExample/BaseTableViewController.m @@ -11,6 +11,8 @@ @interface BaseTableViewController () +@property (retain, nonatomic) UIBarButtonItem *barButtonItem; + @end @implementation BaseTableViewController @@ -37,6 +39,16 @@ - (void)viewWillAppear:(BOOL)animated { self.segmentedPager.segmentedPager.title = self.title; } } + + self.barButtonItem.title = self.title; + self.segmentedPager.navigationItem.rightBarButtonItem = self.barButtonItem; +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + + self.segmentedPager.navigationItem.rightBarButtonItem = nil; } - (void)viewDidLoad { @@ -50,6 +62,23 @@ - (void)didReceiveMemoryWarning { // Dispose of any resources that can be recreated. } +#pragma mark - action + +- (void)barbuttonAction +{ + +} + +#pragma mark - getter + +- (UIBarButtonItem *)barButtonItem +{ + if (!_barButtonItem) { + _barButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStyleDone target:self action:@selector(barbuttonAction)]; + } + return _barButtonItem; +} + #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.m b/THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.m index cba9a34..9750119 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.m +++ b/THSegmentedPagerExample/THSegmentedPagerExample/TestViewController.m @@ -24,7 +24,8 @@ - (void)viewDidLoad { PagerViewController *p1 = [[PagerViewController alloc] init]; p1.title = @"P1"; - PagerViewController *p2 = [[PagerViewController alloc] init]; + PagerViewController *p2 = [[PagerViewController alloc] initWithContentEdgeInsets:UIEdgeInsetsMake(20, 30, 40, 50)]; + p2.view.backgroundColor = [UIColor redColor]; p2.title = @"P2"; PagerViewController *p3 = [[PagerViewController alloc] init]; p3.title = @"P3"; diff --git a/ThSegmentedPagerExample/Podfile.lock b/ThSegmentedPagerExample/Podfile.lock index dbbbb75..a95780e 100644 --- a/ThSegmentedPagerExample/Podfile.lock +++ b/ThSegmentedPagerExample/Podfile.lock @@ -16,4 +16,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 4c62b73aa77c867cac98f2dddce0bf6dc9b16228 -COCOAPODS: 1.1.1 +COCOAPODS: 1.2.1 From 2c6e0cf22d81fe891305dd4cdf46b22602cc9632 Mon Sep 17 00:00:00 2001 From: JyHu Date: Sun, 27 Aug 2017 00:59:38 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9navigation?= =?UTF-8?q?=E4=BE=A7=E6=BB=91=E6=89=8B=E5=8A=BF=E7=9A=84=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- THSegmentedPager/THSegmentedPager.m | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/THSegmentedPager/THSegmentedPager.m b/THSegmentedPager/THSegmentedPager.m index a12240a..bdbb4e0 100644 --- a/THSegmentedPager/THSegmentedPager.m +++ b/THSegmentedPager/THSegmentedPager.m @@ -69,9 +69,28 @@ - (void)viewDidLoad { // Obtain the ScrollViewDelegate self.shouldBounce = YES; + + // 遍历获取navigation的侧滑手势 + UIScreenEdgePanGestureRecognizer *screenEdgePanGestureRecognizer; + + if (self.navigationController) { + if (self.navigationController.view.gestureRecognizers.count > 0) { + for (UIGestureRecognizer *recognizer in self.navigationController.view.gestureRecognizers) { + if ([recognizer isKindOfClass:[UIScreenEdgePanGestureRecognizer class]]) { + screenEdgePanGestureRecognizer = (UIScreenEdgePanGestureRecognizer *)recognizer; + break; + } + } + } + } + for (UIView *view in self.pri_pageViewController.view.subviews ) { if ([view isKindOfClass:[UIScrollView class]]) { ((UIScrollView *)view).delegate = self; + if (screenEdgePanGestureRecognizer) { + // 当时侧滑返回的时候,禁掉scrollview的滑动响应 + [((UIScrollView *)view).panGestureRecognizer requireGestureRecognizerToFail:screenEdgePanGestureRecognizer]; + } } } } From d120bfc08661c0592574ccc68f2c3fdbb7769e5e Mon Sep 17 00:00:00 2001 From: JyHu Date: Sun, 27 Aug 2017 16:44:49 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=8E=A7=E5=88=B6scroll=E6=98=AF=E5=90=A6=E5=8F=AF=E6=BB=91?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- THSegmentedPager/THSegmentedPager.h | 3 ++- THSegmentedPager/THSegmentedPager.m | 11 +++++++++++ .../THSegmentedPagerExample/PagerViewController.m | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/THSegmentedPager/THSegmentedPager.h b/THSegmentedPager/THSegmentedPager.h index 099a3de..ff370a6 100644 --- a/THSegmentedPager/THSegmentedPager.h +++ b/THSegmentedPager/THSegmentedPager.h @@ -18,9 +18,10 @@ @property (strong, nonatomic, readonly) UIPageViewController *pageViewController; @property (strong, nonatomic, readonly) UIView *contentContainer; -@property (assign, nonatomic) BOOL needPagerAnimateWhenSegmentSelectionChanged; +@property (assign, nonatomic) BOOL needPagerAnimateWhenSegmentSelectionChanged; // default is no @property (strong, nonatomic) NSArray *pages; +@property (assign, nonatomic) BOOL scrollEnable; @property (assign, nonatomic) BOOL shouldBounce; /*! Instead of setting the pages manually you can give to the controller an array of identifiers which will be loaded from the storyboard at runtime diff --git a/THSegmentedPager/THSegmentedPager.m b/THSegmentedPager/THSegmentedPager.m index bdbb4e0..30d6677 100644 --- a/THSegmentedPager/THSegmentedPager.m +++ b/THSegmentedPager/THSegmentedPager.m @@ -440,6 +440,17 @@ - (void)setCurrentIndex:(NSUInteger)currentIndex } } +- (void)setScrollEnable:(BOOL)scrollEnable +{ + _scrollEnable = scrollEnable; + + for (UIView *view in self.pri_pageViewController.view.subviews ) { + if ([view isKindOfClass:[UIScrollView class]]) { + ((UIScrollView *)view).scrollEnabled = scrollEnable; + } + } +} + @end diff --git a/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m b/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m index 1960720..ef899df 100644 --- a/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m +++ b/THSegmentedPagerExample/THSegmentedPagerExample/PagerViewController.m @@ -28,6 +28,10 @@ - (void)viewDidLoad { BaseTableViewController *b4 = [[BaseTableViewController alloc] initWithTitle:@"B4"]; [self setPages:@[b1, b2, b3, b4]]; + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + self.scrollEnable = NO; + }); } - (void)didReceiveMemoryWarning { From d30d58e4901f0d136d1a27c650407bf9074b839d Mon Sep 17 00:00:00 2001 From: JyHu Date: Sun, 27 Aug 2017 17:15:17 +0800 Subject: [PATCH 7/8] Modify some initialize methods --- .../THSegmentedPageViewControllerDelegate.h | 11 ----- THSegmentedPager/THSegmentedPager.h | 14 ++++++- THSegmentedPager/THSegmentedPager.m | 41 ++++--------------- 3 files changed, 21 insertions(+), 45 deletions(-) diff --git a/THSegmentedPager/THSegmentedPageViewControllerDelegate.h b/THSegmentedPager/THSegmentedPageViewControllerDelegate.h index fe22aa2..b0bb526 100644 --- a/THSegmentedPager/THSegmentedPageViewControllerDelegate.h +++ b/THSegmentedPager/THSegmentedPageViewControllerDelegate.h @@ -8,21 +8,10 @@ #import -@class THSegmentedPager; - @protocol THSegmentedPageViewControllerDelegate @optional - -/** - 当前类需要实现的方法,用于返回当前选择的页面索引 - - @param controller self - @param index 页面索引 - */ -- (void)pageViewController:(THSegmentedPager *)controller changeToSelectedIndex:(NSUInteger)index; - - (NSString *)viewControllerTitle; @end diff --git a/THSegmentedPager/THSegmentedPager.h b/THSegmentedPager/THSegmentedPager.h index ff370a6..884bd18 100644 --- a/THSegmentedPager/THSegmentedPager.h +++ b/THSegmentedPager/THSegmentedPager.h @@ -10,7 +10,7 @@ #import #import "THSegmentedPageViewControllerDelegate.h" -@interface THSegmentedPager : UIViewController +@interface THSegmentedPager : UIViewController - (instancetype)initWithContentEdgeInsets:(UIEdgeInsets)edgeInsets; @@ -18,7 +18,7 @@ @property (strong, nonatomic, readonly) UIPageViewController *pageViewController; @property (strong, nonatomic, readonly) UIView *contentContainer; -@property (assign, nonatomic) BOOL needPagerAnimateWhenSegmentSelectionChanged; // default is no +@property (assign, nonatomic) BOOL needPagerAnimateWhenSegmentSelectionChanged; // default is YES @property (strong, nonatomic) NSArray *pages; @property (assign, nonatomic) BOOL scrollEnable; @@ -48,6 +48,16 @@ */ - (void)updateTitleLabels; + + +/** + 当前类需要实现的方法,用于返回当前选择的页面索引 + + @param controller self + @param index 页面索引 + */ +- (void)pageViewController:(THSegmentedPager *)controller changeToSelectedIndex:(NSUInteger)index; + @end @interface UIViewController (THSegmentedPager) diff --git a/THSegmentedPager/THSegmentedPager.m b/THSegmentedPager/THSegmentedPager.m index 30d6677..1264198 100644 --- a/THSegmentedPager/THSegmentedPager.m +++ b/THSegmentedPager/THSegmentedPager.m @@ -29,29 +29,8 @@ @implementation THSegmentedPager @synthesize pri_pages = _pri_pages; - (instancetype)initWithContentEdgeInsets:(UIEdgeInsets)edgeInsets { - if (self = [self init]) { - self.edgeInsets = edgeInsets; - } - return self; -} - -- (instancetype)init { if (self = [super init]) { - self.needPagerAnimateWhenSegmentSelectionChanged = NO; - } - return self; -} - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - if (self = [super initWithCoder:aDecoder]) { - self.needPagerAnimateWhenSegmentSelectionChanged = NO; - } - return self; -} - -- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { - self.needPagerAnimateWhenSegmentSelectionChanged = NO; + self.edgeInsets = edgeInsets; } return self; } @@ -73,13 +52,11 @@ - (void)viewDidLoad { // 遍历获取navigation的侧滑手势 UIScreenEdgePanGestureRecognizer *screenEdgePanGestureRecognizer; - if (self.navigationController) { - if (self.navigationController.view.gestureRecognizers.count > 0) { - for (UIGestureRecognizer *recognizer in self.navigationController.view.gestureRecognizers) { - if ([recognizer isKindOfClass:[UIScreenEdgePanGestureRecognizer class]]) { - screenEdgePanGestureRecognizer = (UIScreenEdgePanGestureRecognizer *)recognizer; - break; - } + if (self.navigationController && self.navigationController.view.gestureRecognizers.count > 0) { + for (UIGestureRecognizer *recognizer in self.navigationController.view.gestureRecognizers) { + if ([recognizer isKindOfClass:[UIScreenEdgePanGestureRecognizer class]]) { + screenEdgePanGestureRecognizer = (UIScreenEdgePanGestureRecognizer *)recognizer; + break; } } } @@ -435,9 +412,7 @@ - (void)setCurrentIndex:(NSUInteger)currentIndex { _currentIndex = currentIndex; - if ([self respondsToSelector:@selector(pageViewController:changeToSelectedIndex:)]) { - [self pageViewController:self changeToSelectedIndex:currentIndex]; - } + [self pageViewController:self changeToSelectedIndex:currentIndex]; } - (void)setScrollEnable:(BOOL)scrollEnable @@ -451,6 +426,8 @@ - (void)setScrollEnable:(BOOL)scrollEnable } } +- (void)pageViewController:(THSegmentedPager *)controller changeToSelectedIndex:(NSUInteger)index {} + @end From e4c02e873dc40be8f747e4a6d9ff32c64c7600b5 Mon Sep 17 00:00:00 2001 From: JyHu Date: Tue, 23 Jan 2018 19:20:31 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=BB=91=E5=8A=A8=E6=97=B6=E9=80=89=E6=8B=A9?= =?UTF-8?q?segment=E5=AF=BC=E8=87=B4=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- THSegmentedPager/THSegmentedPager.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/THSegmentedPager/THSegmentedPager.m b/THSegmentedPager/THSegmentedPager.m index 1264198..fe6f2ff 100644 --- a/THSegmentedPager/THSegmentedPager.m +++ b/THSegmentedPager/THSegmentedPager.m @@ -287,6 +287,11 @@ - (void)pageControlValueChanged:(id)sender { animated:self.needPagerAnimateWhenSegmentSelectionChanged completion:completionBlock]; } else { [self.pri_segmentControl setSelectedSegmentIndex:self.currentIndex animated:NO]; + + if (self.nextIndex == self.currentIndex) { + self.userDraggingStartedTransitionInProgress = NO; + [self setSelectedPageIndex:self.currentIndex animated:NO]; + } } }