From 8c9e799972354e3579f769602909c7e8a49d8e53 Mon Sep 17 00:00:00 2001 From: pastorin Date: Wed, 1 Apr 2015 15:22:17 -0300 Subject: [PATCH 1/8] Add XLTwitterPagerTabStrip --- .DS_Store | Bin 0 -> 6148 bytes XLPagerTabStrip.xcodeproj/project.pbxproj | 20 + XLPagerTabStrip/.DS_Store | Bin 0 -> 6148 bytes XLPagerTabStrip/Demo/Storyboard.storyboard | 51 ++- XLPagerTabStrip/FXPageControl/FXPageControl.h | 106 +++++ XLPagerTabStrip/FXPageControl/FXPageControl.m | 433 ++++++++++++++++++ XLPagerTabStrip/XL/.DS_Store | Bin 0 -> 6148 bytes .../XLPagerTabStripViewController.m | 6 +- .../XLTwitterPagerTabStripViewController.h | 15 + .../XLTwitterPagerTabStripViewController.m | 224 +++++++++ 10 files changed, 846 insertions(+), 9 deletions(-) create mode 100644 .DS_Store create mode 100644 XLPagerTabStrip/.DS_Store create mode 100755 XLPagerTabStrip/FXPageControl/FXPageControl.h create mode 100755 XLPagerTabStrip/FXPageControl/FXPageControl.m create mode 100644 XLPagerTabStrip/XL/.DS_Store create mode 100644 XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.h create mode 100644 XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e703d26a9b60ed7606a47e32d3d1497016f1c7fa GIT binary patch literal 6148 zcmeHKO>fgc5S?uUP16HL1X0ArN02Ji3ZigK(*&s!MNwU~Ac}$=Ta7Cxwql2XqDVP& z<3!JV{{_wnPF%RbjlaPuy!~k9G(gn~A%u3U**6~V%-YZ1SuYW>a@SoVGKeS(<(SE# z`HArBTqk5odFFsj$Y8Ti*2;B$9|ZqX{OP?b{iH*|1?mxY_q z%OfGMh-PUWJ(sCMYrw12B3I7%gNRRuBF@kqj8G$+cF3a+ZNPF+DH7N|MdQ(I{dmz% zFOHl*jQ!n-0zXa`7r(Np>CCCqGuheP96yY+x%*Z#>{*GObmOw!xhKwi*K?FzvyQPb-afNt=VmF z(~o_}5B%hDc9tJ?W4_-n6blRH^&5r3g4r(?7hzv34hF`%Z1&QX!t&bPXz=9ui6d)*$ZU_OA@X_1*MYS= zo>6=@d&tU0BXOH2$QbM_S>2iFo!b4?IDZR#>UH-K0VEdFmT}BS8lXippc&8%q#5A#!Gv-wDI7`^r2~!F z0su2`3xO?aEYRc*U`gRnB0LZ#LxD1ssVxSR;qaTPUrFImq6{Y{Mn)brGE+MgCM!HK zQ*;3-s>NC+t<<^BSHunK`1iH4F#fF|N39{p8(7oW!X(VPyt&_rX&JG)+w zPdCN+48Yc(+jC$AU`cnxmoIbkd-s_gRm6yN)_B1aE->H~AG7S=1I|6g6>f2j`w9Pz zb#~9&_s54}*m;^v3P=GdAO)m=6xf3T)l`=!d#I%nQa}nEmID5LXmrP3I3~uYgG-D6 z#0A4)+{Y|IY#t!?!ZDE%nkAK(RI3rglFoRmyk0maCLLD8ht-p - + - + @@ -14,10 +14,10 @@ - + - + @@ -56,7 +56,7 @@ - + @@ -87,7 +87,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XLPagerTabStrip/FXPageControl/FXPageControl.h b/XLPagerTabStrip/FXPageControl/FXPageControl.h new file mode 100755 index 0000000..37a0438 --- /dev/null +++ b/XLPagerTabStrip/FXPageControl/FXPageControl.h @@ -0,0 +1,106 @@ +// +// FXPageControl.h +// +// Version 1.4 +// +// Created by Nick Lockwood on 07/01/2010. +// Copyright 2010 Charcoal Design +// +// Distributed under the permissive zlib License +// Get the latest version of FXPageControl from here: +// +// https://github.com/nicklockwood/FXPageControl +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// + + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wobjc-missing-property-synthesis" +#import + + +#import +#undef weak_delegate +#if __has_feature(objc_arc_weak) +#define weak_delegate weak +#else +#define weak_delegate unsafe_unretained +#endif + + +extern const CGPathRef FXPageControlDotShapeCircle; +extern const CGPathRef FXPageControlDotShapeSquare; +extern const CGPathRef FXPageControlDotShapeTriangle; + + +@protocol FXPageControlDelegate; + + +IB_DESIGNABLE @interface FXPageControl : UIControl + +- (void)setUp; +- (CGSize)sizeForNumberOfPages:(NSInteger)pageCount; +- (void)updateCurrentPageDisplay; + +@property (nonatomic, weak_delegate) IBOutlet id delegate; + +@property (nonatomic, assign) IBInspectable NSInteger currentPage; +@property (nonatomic, assign) IBInspectable NSInteger numberOfPages; +@property (nonatomic, assign) IBInspectable BOOL defersCurrentPageDisplay; +@property (nonatomic, assign) IBInspectable BOOL hidesForSinglePage; +@property (nonatomic, assign, getter = isWrapEnabled) IBInspectable BOOL wrapEnabled; +@property (nonatomic, assign, getter = isVertical) IBInspectable BOOL vertical; + +@property (nonatomic, strong) IBInspectable UIImage *dotImage; +@property (nonatomic, assign) IBInspectable CGPathRef dotShape; +@property (nonatomic, assign) IBInspectable CGFloat dotSize; +@property (nonatomic, strong) IBInspectable UIColor *dotColor; +@property (nonatomic, strong) IBInspectable UIColor *dotShadowColor; +@property (nonatomic, assign) IBInspectable CGFloat dotShadowBlur; +@property (nonatomic, assign) IBInspectable CGSize dotShadowOffset; + +@property (nonatomic, strong) IBInspectable UIImage *selectedDotImage; +@property (nonatomic, assign) IBInspectable CGPathRef selectedDotShape; +@property (nonatomic, assign) IBInspectable CGFloat selectedDotSize; +@property (nonatomic, strong) IBInspectable UIColor *selectedDotColor; +@property (nonatomic, strong) IBInspectable UIColor *selectedDotShadowColor; +@property (nonatomic, assign) IBInspectable CGFloat selectedDotShadowBlur; +@property (nonatomic, assign) IBInspectable CGSize selectedDotShadowOffset; + +@property (nonatomic, assign) IBInspectable CGFloat dotSpacing; + +@end + + +@protocol FXPageControlDelegate +@optional + +- (UIImage *)pageControl:(FXPageControl *)pageControl imageForDotAtIndex:(NSInteger)index; +- (CGPathRef)pageControl:(FXPageControl *)pageControl shapeForDotAtIndex:(NSInteger)index; +- (UIColor *)pageControl:(FXPageControl *)pageControl colorForDotAtIndex:(NSInteger)index; + +- (UIImage *)pageControl:(FXPageControl *)pageControl selectedImageForDotAtIndex:(NSInteger)index; +- (CGPathRef)pageControl:(FXPageControl *)pageControl selectedShapeForDotAtIndex:(NSInteger)index; +- (UIColor *)pageControl:(FXPageControl *)pageControl selectedColorForDotAtIndex:(NSInteger)index; + +@end + + +#pragma GCC diagnostic pop diff --git a/XLPagerTabStrip/FXPageControl/FXPageControl.m b/XLPagerTabStrip/FXPageControl/FXPageControl.m new file mode 100755 index 0000000..338eb19 --- /dev/null +++ b/XLPagerTabStrip/FXPageControl/FXPageControl.m @@ -0,0 +1,433 @@ +// +// FXPageControl.m +// +// Version 1.4 +// +// Created by Nick Lockwood on 07/01/2010. +// Copyright 2010 Charcoal Design +// +// Distributed under the permissive zlib License +// Get the latest version of FXPageControl from here: +// +// https://github.com/nicklockwood/FXPageControl +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// + +#import "FXPageControl.h" + + +#pragma GCC diagnostic ignored "-Wgnu" +#pragma GCC diagnostic ignored "-Wreceiver-is-weak" +#pragma GCC diagnostic ignored "-Warc-repeated-use-of-weak" +#pragma GCC diagnostic ignored "-Wdirect-ivar-access" + + +#import +#if !__has_feature(objc_arc) +#error This class requires automatic reference counting +#endif + + +const CGPathRef FXPageControlDotShapeCircle = (const CGPathRef)1; +const CGPathRef FXPageControlDotShapeSquare = (const CGPathRef)2; +const CGPathRef FXPageControlDotShapeTriangle = (const CGPathRef)3; +#define LAST_SHAPE FXPageControlDotShapeTriangle + + +@implementation NSObject (FXPageControl) + +- (UIImage *)pageControl:(__unused FXPageControl *)pageControl imageForDotAtIndex:(__unused NSInteger)index { return nil; } +- (CGPathRef)pageControl:(__unused FXPageControl *)pageControl shapeForDotAtIndex:(__unused NSInteger)index { return NULL; } +- (UIColor *)pageControl:(__unused FXPageControl *)pageControl colorForDotAtIndex:(__unused NSInteger)index { return nil; } + +- (UIImage *)pageControl:(__unused FXPageControl *)pageControl selectedImageForDotAtIndex:(__unused NSInteger)index { return nil; } +- (CGPathRef)pageControl:(__unused FXPageControl *)pageControl selectedShapeForDotAtIndex:(__unused NSInteger)index { return NULL; } +- (UIColor *)pageControl:(__unused FXPageControl *)pageControl selectedColorForDotAtIndex:(__unused NSInteger)index { return nil; } + +@end + + +@implementation FXPageControl + +- (void)setUp +{ + //needs redrawing if bounds change + self.contentMode = UIViewContentModeRedraw; + + //set defaults + _dotSpacing = 10.0f; + _dotSize = 6.0f; + _dotShadowOffset = CGSizeMake(0, 1); + _selectedDotShadowOffset = CGSizeMake(0, 1); +} + +- (id)initWithFrame:(CGRect)frame +{ + if ((self = [super initWithFrame:frame])) + { + [self setUp]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)aDecoder +{ + if ((self = [super initWithCoder:aDecoder])) + { + [self setUp]; + } + return self; +} + +- (void)dealloc +{ + if (_dotShape > LAST_SHAPE) CGPathRelease(_dotShape); + if (_selectedDotShape > LAST_SHAPE) CGPathRelease(_selectedDotShape); +} + +- (CGSize)sizeForNumberOfPages:(__unused NSInteger)pageCount +{ + CGFloat width = _dotSize + (_dotSize + _dotSpacing) * (_numberOfPages - 1); + return _vertical? CGSizeMake(_dotSize, width): CGSizeMake(width, _dotSize); +} + +- (void)updateCurrentPageDisplay +{ + [self setNeedsDisplay]; +} + +- (void)drawRect:(__unused CGRect)rect +{ + if (_numberOfPages > 1 || !_hidesForSinglePage) + { + CGContextRef context = UIGraphicsGetCurrentContext(); + CGSize size = [self sizeForNumberOfPages:_numberOfPages]; + if (_vertical) + { + CGContextTranslateCTM(context, self.frame.size.width / 2, (self.frame.size.height - size.height) / 2); + } + else + { + CGContextTranslateCTM(context, (self.frame.size.width - size.width) / 2, self.frame.size.height / 2); + } + + for (int i = 0; i < _numberOfPages; i++) + { + UIImage *dotImage = nil; + UIColor *dotColor = nil; + CGPathRef dotShape = NULL; + CGFloat dotSize = 0; + UIColor *dotShadowColor = nil; + CGSize dotShadowOffset = CGSizeZero; + CGFloat dotShadowBlur = 0; + + if (i == _currentPage) + { + [_selectedDotColor setFill]; + dotImage = [_delegate pageControl:self selectedImageForDotAtIndex:i] ?: _selectedDotImage; + dotShape = [_delegate pageControl:self selectedShapeForDotAtIndex:i] ?: _selectedDotShape ?: _dotShape; + dotColor = [_delegate pageControl:self selectedColorForDotAtIndex:i] ?: _selectedDotColor ?: [UIColor blackColor]; + dotShadowBlur = _selectedDotShadowBlur; + dotShadowColor = _selectedDotShadowColor; + dotShadowOffset = _selectedDotShadowOffset; + dotSize = _selectedDotSize ?: _dotSize; + } + else + { + [_dotColor setFill]; + dotImage = [_delegate pageControl:self imageForDotAtIndex:i] ?: _dotImage; + dotShape = [_delegate pageControl:self shapeForDotAtIndex:i] ?: _dotShape; + dotColor = [_delegate pageControl:self colorForDotAtIndex:i] ?: _dotColor; + if (!dotColor) + { + //fall back to selected dot color with reduced alpha + dotColor = [_delegate pageControl:self selectedColorForDotAtIndex:i] ?: _selectedDotColor ?: [UIColor blackColor]; + dotColor = [dotColor colorWithAlphaComponent:0.25f]; + } + dotShadowBlur = _dotShadowBlur; + dotShadowColor = _dotShadowColor; + dotShadowOffset = _dotShadowOffset; + dotSize = _dotSize; + } + + CGContextSaveGState(context); + CGFloat offset = (_dotSize + _dotSpacing) * i + _dotSize / 2; + CGContextTranslateCTM(context, _vertical? 0: offset, _vertical? offset: 0); + + if (dotShadowColor && ![dotShadowColor isEqual:[UIColor clearColor]]) + { + CGContextSetShadowWithColor(context, dotShadowOffset, dotShadowBlur, dotShadowColor.CGColor); + } + if (dotImage) + { + [dotImage drawInRect:CGRectMake(-dotImage.size.width / 2, -dotImage.size.height / 2, dotImage.size.width, dotImage.size.height)]; + } + else + { + [dotColor setFill]; + if (!dotShape || dotShape == FXPageControlDotShapeCircle) + { + CGContextFillEllipseInRect(context, CGRectMake(-dotSize / 2, -dotSize / 2, dotSize, dotSize)); + } + else if (dotShape == FXPageControlDotShapeSquare) + { + CGContextFillRect(context, CGRectMake(-dotSize / 2, -dotSize / 2, dotSize, dotSize)); + } + else if (dotShape == FXPageControlDotShapeTriangle) + { + CGContextBeginPath(context); + CGContextMoveToPoint(context, 0, -dotSize / 2); + CGContextAddLineToPoint(context, dotSize / 2, dotSize / 2); + CGContextAddLineToPoint(context, -dotSize / 2, dotSize / 2); + CGContextAddLineToPoint(context, 0, -dotSize / 2); + CGContextFillPath(context); + } + else + { + CGContextBeginPath(context); + CGContextAddPath(context, dotShape); + CGContextFillPath(context); + } + } + CGContextRestoreGState(context); + } + } +} + +- (NSInteger)clampedPageValue:(NSInteger)page +{ + if (_wrapEnabled) + { + return _numberOfPages? (page + _numberOfPages) % _numberOfPages: 0; + } + else + { + return MIN(MAX(0, page), _numberOfPages - 1); + } +} + +- (void)setDotImage:(UIImage *)dotImage +{ + if (_dotImage != dotImage) + { + _dotImage = dotImage; + [self setNeedsDisplay]; + } +} + +- (void)setDotShape:(CGPathRef)dotShape +{ + if (_dotShape != dotShape) + { + if (_dotShape > LAST_SHAPE) CGPathRelease(_dotShape); + _dotShape = dotShape; + if (_dotShape > LAST_SHAPE) CGPathRetain(_dotShape); + [self setNeedsDisplay]; + } +} + +- (void)setDotSize:(CGFloat)dotSize +{ + if (ABS(_dotSize - dotSize) > 0.001) + { + _dotSize = dotSize; + [self setNeedsDisplay]; + } +} + +- (void)setDotColor:(UIColor *)dotColor +{ + if (_dotColor != dotColor) + { + _dotColor = dotColor; + [self setNeedsDisplay]; + } +} + +- (void)setDotShadowColor:(UIColor *)dotColor +{ + if (_dotShadowColor != dotColor) + { + _dotShadowColor = dotColor; + [self setNeedsDisplay]; + } +} + +- (void)setDotShadowBlur:(CGFloat)dotShadowBlur +{ + if (ABS(_dotShadowBlur - dotShadowBlur) > 0.001) + { + _dotShadowBlur = dotShadowBlur; + [self setNeedsDisplay]; + } +} + +- (void)setDotShadowOffset:(CGSize)dotShadowOffset +{ + if (!CGSizeEqualToSize(_dotShadowOffset, dotShadowOffset)) + { + _dotShadowOffset = dotShadowOffset; + [self setNeedsDisplay]; + } +} + +- (void)setSelectedDotImage:(UIImage *)dotImage +{ + if (_selectedDotImage != dotImage) + { + _selectedDotImage = dotImage; + [self setNeedsDisplay]; + } +} + +- (void)setSelectedDotColor:(UIColor *)dotColor +{ + if (_selectedDotColor != dotColor) + { + _selectedDotColor = dotColor; + [self setNeedsDisplay]; + } +} + +- (void)setSelectedDotShape:(CGPathRef)dotShape +{ + if (_selectedDotShape != dotShape) + { + if (_selectedDotShape > LAST_SHAPE) CGPathRelease(_selectedDotShape); + _selectedDotShape = dotShape; + if (_selectedDotShape > LAST_SHAPE) CGPathRetain(_selectedDotShape); + [self setNeedsDisplay]; + } +} + +- (void)setSelectedDotSize:(CGFloat)dotSize +{ + if (ABS(_selectedDotSize - dotSize) > 0.001) + { + _selectedDotSize = dotSize; + [self setNeedsDisplay]; + } +} + +- (void)setSelectedDotShadowColor:(UIColor *)dotColor +{ + if (_selectedDotShadowColor != dotColor) + { + _selectedDotShadowColor = dotColor; + [self setNeedsDisplay]; + } +} + +- (void)setSelectedDotShadowBlur:(CGFloat)dotShadowBlur +{ + if (ABS(_selectedDotShadowBlur - dotShadowBlur) > 0.001) + { + _selectedDotShadowBlur = dotShadowBlur; + [self setNeedsDisplay]; + } +} + +- (void)setSelectedDotShadowOffset:(CGSize)dotShadowOffset +{ + if (!CGSizeEqualToSize(_selectedDotShadowOffset, dotShadowOffset)) + { + _selectedDotShadowOffset = dotShadowOffset; + [self setNeedsDisplay]; + } +} + +- (void)setDotSpacing:(CGFloat)dotSpacing +{ + if (ABS(_dotSpacing - dotSpacing) > 0.001) + { + _dotSpacing = dotSpacing; + [self setNeedsDisplay]; + } +} + +- (void)setDelegate:(id)delegate +{ + if (_delegate != delegate) + { + _delegate = delegate; + [self setNeedsDisplay]; + } +} + +- (void)setCurrentPage:(NSInteger)page +{ + _currentPage = [self clampedPageValue:page]; + [self setNeedsDisplay]; +} + +- (void)setNumberOfPages:(NSInteger)pages +{ + if (_numberOfPages != pages) + { + _numberOfPages = pages; + if (_currentPage >= pages) + { + _currentPage = pages - 1; + } + [self setNeedsDisplay]; + } +} + +- (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event +{ + CGPoint point = [touch locationInView:self]; + BOOL forward = _vertical? (point.y > self.frame.size.height / 2): (point.x > self.frame.size.width / 2); + _currentPage = [self clampedPageValue:_currentPage + (forward? 1: -1)]; + if (!_defersCurrentPageDisplay) + { + [self setNeedsDisplay]; + } + [self sendActionsForControlEvents:UIControlEventValueChanged]; + [super endTrackingWithTouch:touch withEvent:event]; +} + +- (CGSize)sizeThatFits:(__unused CGSize)size +{ + CGSize dotSize = [self sizeForNumberOfPages:_numberOfPages]; + if (_selectedDotSize) + { + CGFloat width = (_selectedDotSize - _dotSize); + CGFloat height = MAX(36, MAX(_dotSize, _selectedDotSize)); + dotSize.width = _vertical? height: dotSize.width + width; + dotSize.height = _vertical? dotSize.height + width: height; + + } + if ((_dotShadowColor && ![_dotShadowColor isEqual:[UIColor clearColor]]) || + (_selectedDotShadowColor && ![_selectedDotShadowColor isEqual:[UIColor clearColor]])) + { + dotSize.width += MAX(_dotShadowOffset.width, _selectedDotShadowOffset.width) * 2; + dotSize.height += MAX(_dotShadowOffset.height, _selectedDotShadowOffset.height) * 2; + dotSize.width += MAX(_dotShadowBlur, _selectedDotShadowBlur) * 2; + dotSize.height += MAX(_dotShadowBlur, _selectedDotShadowBlur) * 2; + } + return dotSize; +} + +- (CGSize)intrinsicContentSize +{ + return [self sizeThatFits:self.bounds.size]; +} + +@end diff --git a/XLPagerTabStrip/XL/.DS_Store b/XLPagerTabStrip/XL/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5f0b3b9cf11037edbda3cd30ba0d6a61e82d4096 GIT binary patch literal 6148 zcmeHKJFdb&477m)i6$lGUV$5|fOmp-fhT?yA`+iI73bn;Z~SSZ2#Eq3G>*Kp>v(px zQ^c`|=<>E(h%_QHg&WGrqChzII7=%>JbTPuGvm%=1>Q-nJ^tmeyKFaY zd$bf96`%rCfC^9nD)1%+van8PZ`zOBPys6NJqpa0lP&Hc&4Laf_^J-!j7`>HC$Nt6BMQb2ODnJGL3XEgf zSpENjKk5JbB(A6c75FLzbh7?kFL9-;t%J*1tu63BxaBiGvE;K6eX$AfP9s3py literal 0 HcmV?d00001 diff --git a/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.m index d9c89d1..3816a6e 100644 --- a/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.m @@ -155,13 +155,15 @@ -(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController updateIndicatorToViewController:(UIViewController *)toViewController - fromViewController:(UIViewController *)fromViewController{ + fromViewController:(UIViewController *)fromViewController +{ } -(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController updateIndicatorFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex - withProgressPercentage:(CGFloat)progressPercentage{ + withProgressPercentage:(CGFloat)progressPercentage +{ } diff --git a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.h b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.h new file mode 100644 index 0000000..8409c2a --- /dev/null +++ b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.h @@ -0,0 +1,15 @@ +// +// XLTwitterPagerTabStripViewController.h +// XLPagerTabStrip +// +// Created by Martin Pastorin on 2/12/15. +// Copyright (c) 2015 Xmartlabs. All rights reserved. +// + +#import "XLPagerTabStripViewController.h" + +@interface XLTwitterPagerTabStripViewController : XLPagerTabStripViewController + +@property (nonatomic, readonly) UIView * navigationView; + +@end diff --git a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m new file mode 100644 index 0000000..b317ae4 --- /dev/null +++ b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m @@ -0,0 +1,224 @@ +// +// XLTwitterPagerTabStripViewController.m +// XLPagerTabStrip +// +// Created by Martin Pastorin on 2/12/15. +// Copyright (c) 2015 Xmartlabs. All rights reserved. +// + +#import "XLTwitterPagerTabStripViewController.h" +#import "TableChildExampleViewController.h" +#import "ChildExampleViewController.h" +#import "FXPageControl.h" + +@interface XLTwitterPagerTabStripViewController () +{ + BOOL _isReload; +} +@property (nonatomic) IBOutlet UIView * navigationView; +@property (nonatomic) UIScrollView * navigationScrollView; +@property (nonatomic) FXPageControl * navigationPageControl; +@property (nonatomic, strong) NSMutableArray * navigationItemsViews; + +@end + +@implementation XLTwitterPagerTabStripViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. + if (!self.navigationView.superview) { + [self.navigationController.navigationBar addSubview:self.navigationView]; + } + if (!self.navigationScrollView.superview) { + [self.navigationView addSubview:self.navigationScrollView]; + } + + if (!self.navigationPageControl.superview) { + [self.navigationView addSubview:self.navigationPageControl]; + } + + self.isProgressiveIndicator = YES; + + _navigationScrollView.bounces = YES; + _navigationScrollView.scrollsToTop = NO; + _navigationScrollView.delegate = self; + _navigationScrollView.showsVerticalScrollIndicator = NO; + _navigationScrollView.showsHorizontalScrollIndicator = NO; + _navigationScrollView.pagingEnabled = YES; + _navigationScrollView.userInteractionEnabled = NO; + [_navigationScrollView setAlwaysBounceHorizontal:YES]; + [_navigationScrollView setAlwaysBounceVertical:NO]; + + [self reloadNavigatorContainerView]; +} + +-(void)reloadNavigatorContainerView +{ + __block NSMutableArray *items = [[NSMutableArray alloc] init]; + [self.pagerTabStripChildViewControllers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + NSAssert([obj conformsToProtocol:@protocol(XLPagerTabStripChildItem)], @"child view controller must conform to XLPagerTabStripChildItem"); + UIViewController * childViewController = (UIViewController *)obj; + if ([childViewController respondsToSelector:@selector(titleForPagerTabStripViewController:)]){ + UILabel *navTitleLabel = [self createNewLabelWithText:[childViewController titleForPagerTabStripViewController:self]]; + [navTitleLabel setAlpha: self.currentIndex == idx ? 1 : 0]; + [items addObject:navTitleLabel]; + } + }]; + + [items enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + if([obj isKindOfClass:UIView.class]) + [self addNavigationViewItem:obj index:idx]; + }]; + + // Update Navigation Page Control + [self.navigationPageControl setNumberOfPages:[self.navigationItemsViews count]]; + [self.navigationPageControl setCurrentPage:self.currentIndex]; + CGSize viewSize = [self.navigationPageControl sizeForNumberOfPages:[self.navigationItemsViews count]]; + CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; + CGFloat originX = (distance - viewSize.width/2); + [self.navigationPageControl setFrame:(CGRect){originX, 34, viewSize.width, viewSize.height}]; +} + +-(UIView *)navigationView +{ + if (_navigationView) return _navigationView; + _navigationView = [[UIView alloc] init]; + _navigationView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + return _navigationView; +} + +- (UIScrollView *)navigationScrollView +{ + if (_navigationScrollView) return _navigationScrollView; + _navigationScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 44)]; + _navigationScrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + return _navigationScrollView; +} + +-(NSMutableArray *)navigationItemsViews +{ + if (_navigationItemsViews) return _navigationItemsViews; + _navigationItemsViews = [[NSMutableArray alloc] init]; + return _navigationItemsViews; +} + +-(FXPageControl *)navigationPageControl +{ + if (_navigationPageControl) return _navigationPageControl; + _navigationPageControl = [[FXPageControl alloc] init]; + [_navigationPageControl setBackgroundColor:[UIColor clearColor]]; + [_navigationPageControl setDotSize:3.8f]; + [_navigationPageControl setDotSpacing:4.0f]; + [_navigationPageControl setDotColor:[UIColor colorWithWhite:1 alpha:0.4]]; + [_navigationPageControl setSelectedDotColor:[UIColor whiteColor]]; + return _navigationPageControl; +} + + +#pragma mark - XLPagerTabStripViewControllerDataSource + +-(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController + updateIndicatorFromIndex:(NSInteger)fromIndex + toIndex:(NSInteger)toIndex + withProgressPercentage:(CGFloat)progressPercentage +{ + CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; + UIAccelerationValue xOffset = fromIndex < toIndex ? distance * fromIndex + distance * progressPercentage : distance * fromIndex - distance * progressPercentage; + [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; + + [self setAlphaToItemAtIndex:fromIndex withOffset:xOffset]; + [self setAlphaToItemAtIndex:toIndex withOffset:xOffset]; + + [_navigationPageControl setCurrentPage:self.currentIndex]; +} + + +#pragma mark - Helpers + +- (void)addNavigationViewItem:(UIView*)view index:(NSInteger)index +{ + CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; + CGSize viewSize = [view isKindOfClass:[UILabel class]] ? [self getLabelSize:(UILabel*)view] : view.frame.size; + CGFloat originX = (distance - viewSize.width/2) + self.navigationItemsViews.count * distance; + view.frame = (CGRect){originX, 8, viewSize.width, viewSize.height}; + view.tag = index; + + [_navigationScrollView addSubview:view]; + [_navigationItemsViews addObject:view]; +} + +-(CGSize) getLabelSize:(UILabel *)label +{ + return [[label text] sizeWithAttributes:@{NSFontAttributeName:[label font]}];; +} + +-(UILabel *)createNewLabelWithText:(NSString *)text +{ + UILabel *navTitleLabel = [UILabel new]; + navTitleLabel.text = text; + navTitleLabel.font = [UIFont fontWithName:@"Helvetica" size:18]; + navTitleLabel.textColor = [UIColor whiteColor]; + return navTitleLabel; +} + +-(void)setAlphaToItemAtIndex:(NSInteger)index withOffset:(UIAccelerationValue)xOffset +{ + if (index<0 || index>=[self.navigationItemsViews count]) { + return; + } + + CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; + CGFloat alpha; + + if(xOffset < distance * index) { + alpha = (xOffset - distance * (index - 1)) / distance; + }else{ + alpha = 1 - ((xOffset - distance * index) / distance); + } + + UILabel *label = (UILabel*)[self.navigationItemsViews objectAtIndex:index]; + [label setAlpha:alpha]; +} + + +#pragma mark - XLPagerTabStripViewControllerDataSource + +-(NSArray *)childViewControllersForPagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController +{ + // create child view controllers that will be managed by XLPagerTabStripViewController + TableChildExampleViewController * child_1 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStylePlain]; + ChildExampleViewController * child_2 = [[ChildExampleViewController alloc] init]; + TableChildExampleViewController * child_3 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStyleGrouped]; + ChildExampleViewController * child_4 = [[ChildExampleViewController alloc] init]; + TableChildExampleViewController * child_5 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStylePlain]; + ChildExampleViewController * child_6 = [[ChildExampleViewController alloc] init]; + TableChildExampleViewController * child_7 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStyleGrouped]; + ChildExampleViewController * child_8 = [[ChildExampleViewController alloc] init]; + if (!_isReload){ + return @[child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8]; + } + + NSMutableArray * childViewControllers = [NSMutableArray arrayWithObjects:child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8, nil]; + NSUInteger count = [childViewControllers count]; + for (NSUInteger i = 0; i < count; ++i) { + // Select a random element between i and end of array to swap with. + NSUInteger nElements = count - i; + NSUInteger n = (arc4random() % nElements) + i; + [childViewControllers exchangeObjectAtIndex:i withObjectAtIndex:n]; + } + NSUInteger nItems = 1 + (rand() % 8); + return [childViewControllers subarrayWithRange:NSMakeRange(0, nItems)]; +} + +-(void)reloadPagerTabStripView +{ + _isReload = YES; + self.isProgressiveIndicator = (rand() % 2 == 0); + self.isElasticIndicatorLimit = (rand() % 2 == 0); + [super reloadPagerTabStripView]; +} + + +@end From 50d36d42a5d74337057408dead897537122381cf Mon Sep 17 00:00:00 2001 From: Martin Pastorin Date: Tue, 7 Apr 2015 16:33:16 -0300 Subject: [PATCH 2/8] finish with XLTwitterPagerTabStrip --- XLPagerTabStrip.xcodeproj/project.pbxproj | 14 +- XLPagerTabStrip/Demo/Storyboard.storyboard | 76 +++++++--- .../Demo/TwitterExampleViewController.h | 13 ++ .../Demo/TwitterExampleViewController.m | 56 +++++++ .../logoCircle.imageset/Contents.json | 22 +++ .../logoCircle.imageset/xmartlabsLogo.png | Bin 0 -> 3052 bytes .../logoCircle.imageset/xmartlabsLogo1.png | Bin 0 -> 1972 bytes .../XLTwitterPagerTabStripViewController.m | 141 ++++++++---------- 8 files changed, 220 insertions(+), 102 deletions(-) create mode 100644 XLPagerTabStrip/Demo/TwitterExampleViewController.h create mode 100644 XLPagerTabStrip/Demo/TwitterExampleViewController.m create mode 100644 XLPagerTabStrip/Images.xcassets/logoCircle.imageset/Contents.json create mode 100644 XLPagerTabStrip/Images.xcassets/logoCircle.imageset/xmartlabsLogo.png create mode 100644 XLPagerTabStrip/Images.xcassets/logoCircle.imageset/xmartlabsLogo1.png diff --git a/XLPagerTabStrip.xcodeproj/project.pbxproj b/XLPagerTabStrip.xcodeproj/project.pbxproj index ec0497b..b7c850e 100644 --- a/XLPagerTabStrip.xcodeproj/project.pbxproj +++ b/XLPagerTabStrip.xcodeproj/project.pbxproj @@ -31,6 +31,7 @@ 28B63AF51A465E5E00225C66 /* ReloadExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28B63AF41A465E5E00225C66 /* ReloadExampleViewController.m */; }; 66C6E4B41AB9D538005361FB /* FXPageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 66C6E4B11AB9D538005361FB /* FXPageControl.m */; }; 66CA35B41A8D174900564221 /* XLTwitterPagerTabStripViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 66CA35B31A8D174900564221 /* XLTwitterPagerTabStripViewController.m */; }; + C262204E1AD44A4D002E5226 /* TwitterExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C262204D1AD44A4D002E5226 /* TwitterExampleViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -90,6 +91,8 @@ 66C6E4B11AB9D538005361FB /* FXPageControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FXPageControl.m; sourceTree = ""; }; 66CA35B21A8D174900564221 /* XLTwitterPagerTabStripViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XLTwitterPagerTabStripViewController.h; path = Controllers/XLTwitterPagerTabStripViewController.h; sourceTree = ""; }; 66CA35B31A8D174900564221 /* XLTwitterPagerTabStripViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLTwitterPagerTabStripViewController.m; path = Controllers/XLTwitterPagerTabStripViewController.m; sourceTree = ""; }; + C262204C1AD44A4D002E5226 /* TwitterExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TwitterExampleViewController.h; sourceTree = ""; }; + C262204D1AD44A4D002E5226 /* TwitterExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TwitterExampleViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -171,16 +174,18 @@ 28B63AAF1A45A4C500225C66 /* Demo */ = { isa = PBXGroup; children = ( - 28B63AE31A45A8EE00225C66 /* LaunchScreen.xib */, + 28B63AB41A45A4C500225C66 /* ChildViewController */, + 28B63ABC1A45A4C500225C66 /* Helpers */, 28B63AB01A45A4C500225C66 /* BarExampleViewController.h */, 28B63AB11A45A4C500225C66 /* BarExampleViewController.m */, 28B63AB21A45A4C500225C66 /* ButtonBarExampleViewController.h */, 28B63AB31A45A4C500225C66 /* ButtonBarExampleViewController.m */, - 28B63AB41A45A4C500225C66 /* ChildViewController */, - 28B63ABC1A45A4C500225C66 /* Helpers */, - 28B63ABF1A45A4C500225C66 /* PagerSlidingTabStrip.gif */, 28B63AC01A45A4C500225C66 /* SegmentedExampleViewController.h */, 28B63AC11A45A4C500225C66 /* SegmentedExampleViewController.m */, + C262204C1AD44A4D002E5226 /* TwitterExampleViewController.h */, + C262204D1AD44A4D002E5226 /* TwitterExampleViewController.m */, + 28B63ABF1A45A4C500225C66 /* PagerSlidingTabStrip.gif */, + 28B63AE31A45A8EE00225C66 /* LaunchScreen.xib */, 28B63AC21A45A4C500225C66 /* Storyboard.storyboard */, ); path = Demo; @@ -370,6 +375,7 @@ 28B63AC51A45A4C500225C66 /* ChildExampleViewController.m in Sources */, 28B63AF11A45B26600225C66 /* XLPagerTabStripViewController.m in Sources */, 28B63AC41A45A4C500225C66 /* ButtonBarExampleViewController.m in Sources */, + C262204E1AD44A4D002E5226 /* TwitterExampleViewController.m in Sources */, 66CA35B41A8D174900564221 /* XLTwitterPagerTabStripViewController.m in Sources */, 28B63ADC1A45A4CD00225C66 /* XLBarView.m in Sources */, 28B63AC81A45A4C500225C66 /* XLJSONSerialization.m in Sources */, diff --git a/XLPagerTabStrip/Demo/Storyboard.storyboard b/XLPagerTabStrip/Demo/Storyboard.storyboard index 195a23a..b75b7a4 100644 --- a/XLPagerTabStrip/Demo/Storyboard.storyboard +++ b/XLPagerTabStrip/Demo/Storyboard.storyboard @@ -1,5 +1,5 @@ - + @@ -14,10 +14,10 @@ - + - + @@ -56,9 +56,9 @@ - + - + @@ -119,7 +119,9 @@ - + + + @@ -127,7 +129,7 @@ - + @@ -167,7 +169,7 @@ - + @@ -212,7 +214,7 @@ - + @@ -228,17 +230,20 @@ + - + - + - + + + @@ -247,18 +252,20 @@ - + - + - + - + + + @@ -275,7 +282,7 @@ - + @@ -352,18 +359,18 @@ - + - + - + - + @@ -389,7 +396,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XLPagerTabStrip/Demo/TwitterExampleViewController.h b/XLPagerTabStrip/Demo/TwitterExampleViewController.h new file mode 100644 index 0000000..aef93b3 --- /dev/null +++ b/XLPagerTabStrip/Demo/TwitterExampleViewController.h @@ -0,0 +1,13 @@ +// +// TwitterExampleViewController.h +// XLPagerTabStrip +// +// Created by Archibald on 4/7/15. +// Copyright (c) 2015 Xmartlabs. All rights reserved. +// + +#import "XLTwitterPagerTabStripViewController.h" + +@interface TwitterExampleViewController : XLTwitterPagerTabStripViewController + +@end diff --git a/XLPagerTabStrip/Demo/TwitterExampleViewController.m b/XLPagerTabStrip/Demo/TwitterExampleViewController.m new file mode 100644 index 0000000..922c8cf --- /dev/null +++ b/XLPagerTabStrip/Demo/TwitterExampleViewController.m @@ -0,0 +1,56 @@ +// +// TwitterExampleViewController.m +// XLPagerTabStrip +// +// Created by Archibald on 4/7/15. +// Copyright (c) 2015 Xmartlabs. All rights reserved. +// + +#import "TableChildExampleViewController.h" +#import "ChildExampleViewController.h" +#import "TwitterExampleViewController.h" + +@implementation TwitterExampleViewController +{ + BOOL _isReload; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + _isReload = NO; + self.isProgressiveIndicator = YES; + self.isElasticIndicatorLimit = YES; + // Do any additional setup after loading the view. +} + + +#pragma mark - XLPagerTabStripViewControllerDataSource + +-(NSArray *)childViewControllersForPagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController +{ + // create child view controllers that will be managed by XLPagerTabStripViewController + TableChildExampleViewController * child_1 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStylePlain]; + ChildExampleViewController * child_2 = [[ChildExampleViewController alloc] init]; + TableChildExampleViewController * child_3 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStyleGrouped]; + ChildExampleViewController * child_4 = [[ChildExampleViewController alloc] init]; + TableChildExampleViewController * child_5 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStylePlain]; + ChildExampleViewController * child_6 = [[ChildExampleViewController alloc] init]; + TableChildExampleViewController * child_7 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStyleGrouped]; + ChildExampleViewController * child_8 = [[ChildExampleViewController alloc] init]; + if (!_isReload){ + return @[child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8]; + } + + NSMutableArray * childViewControllers = [NSMutableArray arrayWithObjects:child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8, nil]; + NSUInteger count = [childViewControllers count]; + for (NSUInteger i = 0; i < count; ++i) { + // Select a random element between i and end of array to swap with. + NSUInteger nElements = count - i; + NSUInteger n = (arc4random() % nElements) + i; + [childViewControllers exchangeObjectAtIndex:i withObjectAtIndex:n]; + } + NSUInteger nItems = 1 + (rand() % 8); + return [childViewControllers subarrayWithRange:NSMakeRange(0, nItems)]; +} + +@end diff --git a/XLPagerTabStrip/Images.xcassets/logoCircle.imageset/Contents.json b/XLPagerTabStrip/Images.xcassets/logoCircle.imageset/Contents.json new file mode 100644 index 0000000..bed9e55 --- /dev/null +++ b/XLPagerTabStrip/Images.xcassets/logoCircle.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "xmartlabsLogo1.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "xmartlabsLogo.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/XLPagerTabStrip/Images.xcassets/logoCircle.imageset/xmartlabsLogo.png b/XLPagerTabStrip/Images.xcassets/logoCircle.imageset/xmartlabsLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..a41e63ceb960c50bbbe71fab9a0f6f8508724d19 GIT binary patch literal 3052 zcmaJ@dpwi-A73ftv`|ta&9vpd4Ks$Y&B|e#OD96i3}d%unEN&Bau6a!Nh$YSq8yG( zN_2E_X-ICXM1?~_lzxv+b$);R`h8!o=lNb5fi3 zCz1`8%4X_N)?{?}Ob&nsflSQ!917K+#)Ej$eCRAw=uCYR6hikhg&skZkR%SC=1V^q z%B4Ak+B#B0{i#M?P_z9I6FwFoVA6OL2%pJd1z`E6(678$V7+#XfI_~C@cd1o{}|;& zB178!QA`d0vngtcM?@F*-Q&5B?O1t@grbT2F(gT~;{L;?YgA)ru}`WARy6aj}b z)W>6VEiovA?^ptx8px!vc;B&J|6(nFie0M(CI`?=pmFIzG%q5T&4hgQ8B71UEx4cZ zeZzYF+!p*#u?WBz#9C(mE7RYPfbv;e{-|4E^P}=jGY2pez^+)(x5S(v4W=X;Z1xZSXX@FPqJ7_N?4FKTup; zeE#Xvr)9f$?@nAA8WswPOX2&wghKc>xD8~pIDTxk^8zLrSzT3iki$XRB`ECL^`^|J zGPasAPz6)UJawu=$=r5hsWK>wPl($uF%j7?aw^6bg+`ZYYHMphdie0+UmYFlYMPoQ z4n+5ch6YKa$WOO%iBI;gEG;#h&&v8ZbY=&_Z-Z2SbF=x%P<^o8oz~Wf(y}tJ++?4y z%;lAUT0O8=OY2?F>C>lOVo^wb4O~SUd|?6~y*Ot*tM1A34(Jkxxue@IEmaLWU}7aNAN;4hIT^a7`@+qGE#{v3<;&+?l z{U|`Lt&Sf*?jIHwW)|_dyW75RU|?YTi8+0vY_Fx|AWN}(f70pYcduLF60L?C0*-DqC#*`FU7unl?ok#2|b8osxMw4tW znkc~UXMpxt*4(PVgVH4pl{$q&;nljjI`UG8t*vcp)o4YAbzE%hP4Pb0W5?iV6>_{?GX=KyKFT}>x!hmPx$^5WuUw-`}QQ`jQwPzo;k+_`g~ z3^p^0B{RD?NLs5MKH3#uRaNC}8nxPBXYpYcVXmAUoYHto<`UJ%XWtu?Saf3Hcsf{M z@xiA%!ty2Cbfbg39vnWdC1`a%xabTyZ!$g7bg3r%W*JH5>@`Nd0n5C)LF2%N54smi(O$lu=USFJHdYn9sa;QF-M-x~5qR)%vh& zBFRJY*6s9-aP0OJ<$et7`R(}A6a|f>*BS|LX&z%A=0AMcB*&a=iIeEFY&k36k6{lt z+~m)Sq}PjynGx5=<<`cHX=hGpUO4_I@Ns7^+SUR>(9dHk2r*fe}eJyqY7KKN-N+0 zow;%_L?(`(#EN^dD6N*+=)xsM$*m-eih9ZI5ebvgL zV57zS)F!Eu+^VQAk)cZyF#6twcLVQ>&b`orn`G#owwS_mW|ii)RA0V)*=eaIOV0;t zncW*L?0MSV-M#HI3We$t6h`josXx|zUQS-#n=x3Mcor|%BCDyX8Bpwb*Yw@%*SBny z`ri#ygVzN)Cph;AK)l*(*T#hv^sKqXu@YWMX=!K1{6>NFp5eD55iS#p#a;#a;kDY@ zS`T5V^GtGYf7g`*)bYoczKCD*sBUjO19G^_ebJUUyu7>|Ky!MVeMVmUneHc&kB`q| zfaQ%?s`cU9nMM1MdU`Itbb1{Dw-O;E)+EY`dL)(C9xSygA-->R;#u4LXP-q)pl5>X zE~gaM#k?>Mt&U~Q{uvv0%^xW1@K|h|O14?sR#DPzbwycO*+iwT(sE8$SC_kLYEYu2 z#0(k+hZ74`odN>`*EM8l%|iC7sj10Ru77w-EQ40$TtKPkWWPA(E2>3LFo5Y!hEtE=Xv`VNm%;AQ9 ziUtfr$>z*i$pq0#%7qJq`wm?+k=5+md&lCnU9&kT()eO?c6Ro3evoT=Zm#xh!lhnt zzDhF!XsPSzj-f*yFc@qS2xf`O$pUw`bFZfRGPGTC@}^e9Ni-@#qmW!YN$fdN$C`3> zaZ$X?P5$lGD+9?s*Uj&?IxiPJiLiDYnlYc^PR2amiTiwfv^nN6q|B=^I#1^LXeK|x_J3}$&bp)fN4R(Fccro#*5`Df%i^5mJ{ z3=9m$;{;oyMpSwVj9Ylp66D0->E}gaPDXNknE2I=Rv~0T7Zus1xnnN#$`#d**3s)g XIUKqo9`L*<10)C#pu4q^Z9tAf1~gHW9SxwBuSC2a28^b8zBr&3GamP zLakf{i6ObtW@v@tFqmcG8i^EiqyJ&ML);u5TSxgrNb@H-)uM#m+L zH(Vv)HA*gF8&gCT>G_aalbmaWw&tct6uCJHwvvz#kB_r*Py#K4$njR~E}e;E76#jS!wmW|9D4am1kDbu85464VHy=TImXi-l~VlVPKZ0NNFwQsylh#2}=?^}sY5}O{Ph#?bfHY(7@Wrce}={bBOBu8MQ1crAlRxwo#Bd|#g z>+yU(K1w84XmlQX-2y-);s|vnM6OdnLXb;9Daaa)l0%DOfNT(q0hufT03Q~I zCdM-OELsu^h*`vfu)?f`bjTuB`7@UFi&)PrX!U4h5Hf0h4=DvkSc_lCnWK4&7Cwu~ zN@NNIC?EKCEw8Z3w`f_w#!#uhh^3%nD4x##Pp22J(DCsc-^?v)yqSDRhmN}uook8D zv;l)z{-F@$NvyrK={d=ns^EDe)-hV!S7=GPEO-|6b;duWnf^CQmt{t}(_?t$-n>r( z?XmsN&+5ZmUbr$>&==>EU0KU0J-UZ~lrouvf#=i*M>|PCPmh(Q`eECa%=YgyCL3oA zS0+!7vmeh4Oxt8BJl>MDsK8;o^ms&HU!QW%o^PyHtKZ>dpYcTdh`G_4?E+RaI37%SRFP%utFCHCL?|g4}{L7=IrKOi|-@ZNH zjmh!G;c%HlLqlKOym_-^!mxeh#k*K6kr)%xHQdzS-w&@23X)ZYedcnx>}_pr_L_?q z>Am#0xc-yHZI5WazP{Z(f4JV**cdi8Hdc~BbSk-A?)yCo_wcY2yUMORUR7N^!O3e6 z#^Lhzhdl`O&r+#mJGA+|y}h#gs{{f;$1X%%A)#oK>KYmvmelwi3y{}lko*g7oLIh; zhhZ;GC7qj@u{}b?)qESQTwhsR`@Cj*<%h)h_|yAt@&9sVOZlDix7yna9l3vVxyo8m ziB*>_l|OEZ-LRn~I3#4|PQNUh5o*rJaNyRhTgN`=zQ_2W^WHsDnXIS3fA zDaM}kZQCray1Kd@31i12G&$MXG@(jW-t$T0$jAr>JGi1gBzuxo@7=KVz*`~Z^Yt`Cwpol`5SX`etg#C zm)KgaRH+`{meWM%)1x0W$kMj1UAuOEZccS5V)<}wB)f}dFq@|mTC8d06VVQbgSdC^ zUjJeBAa(QR&6R&Go;!+i=VNydbai$86frn76b|l}*rRZroks=+2HGNPn++PK$z-zg zn~yT;%E}&f?fo<~VwLkUe_Zn~X@@C0`zg8N>{-8kw(hD}0GMcRZEXz^Phw@>HD9j? zc*l9a%;^L>a8~`VzMPz%et+Z9_)V2=w|l(0a%}E|-*ot;t5;vzva&`B1_uXO_J?R` zzA7oPFNv54b^cUXSP0AClZC|<%+AgVVhFr42B1HVw>Jg z6|L}^C!9HR#(D1C)1a>A(Wg(3crS0{9$t3+?%lfq7Ymw?=cfvXpFI-=BP$cXyi{L5 zyRzE9x36zpv9y>sVwv+Ry49krc`-Ck=LCh+UrGCJQ^71&ajnI0_>7sV3apMxH(pszPg$UsP1IwD*yw z`_SCq^D7eg-%S0fpuM#5o%*Y-X<_3>UU~&%))X^-=f06Y?|DasNh#ok#2x$p3#Ifj A9RL6T literal 0 HcmV?d00001 diff --git a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m index b317ae4..5c6d648 100644 --- a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m @@ -12,9 +12,7 @@ #import "FXPageControl.h" @interface XLTwitterPagerTabStripViewController () -{ - BOOL _isReload; -} + @property (nonatomic) IBOutlet UIView * navigationView; @property (nonatomic) UIScrollView * navigationScrollView; @property (nonatomic) FXPageControl * navigationPageControl; @@ -22,6 +20,7 @@ @end + @implementation XLTwitterPagerTabStripViewController - (void)viewDidLoad @@ -39,8 +38,6 @@ [self.navigationView addSubview:self.navigationPageControl]; } - self.isProgressiveIndicator = YES; - _navigationScrollView.bounces = YES; _navigationScrollView.scrollsToTop = NO; _navigationScrollView.delegate = self; @@ -54,33 +51,25 @@ [self reloadNavigatorContainerView]; } --(void)reloadNavigatorContainerView +-(void)viewWillAppear:(BOOL)animated { - __block NSMutableArray *items = [[NSMutableArray alloc] init]; - [self.pagerTabStripChildViewControllers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - NSAssert([obj conformsToProtocol:@protocol(XLPagerTabStripChildItem)], @"child view controller must conform to XLPagerTabStripChildItem"); - UIViewController * childViewController = (UIViewController *)obj; - if ([childViewController respondsToSelector:@selector(titleForPagerTabStripViewController:)]){ - UILabel *navTitleLabel = [self createNewLabelWithText:[childViewController titleForPagerTabStripViewController:self]]; - [navTitleLabel setAlpha: self.currentIndex == idx ? 1 : 0]; - [items addObject:navTitleLabel]; - } - }]; - - [items enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - if([obj isKindOfClass:UIView.class]) - [self addNavigationViewItem:obj index:idx]; - }]; - - // Update Navigation Page Control - [self.navigationPageControl setNumberOfPages:[self.navigationItemsViews count]]; - [self.navigationPageControl setCurrentPage:self.currentIndex]; - CGSize viewSize = [self.navigationPageControl sizeForNumberOfPages:[self.navigationItemsViews count]]; - CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; - CGFloat originX = (distance - viewSize.width/2); - [self.navigationPageControl setFrame:(CGRect){originX, 34, viewSize.width, viewSize.height}]; + [super viewWillAppear:animated]; + [self setCurrentNavigationScrollViewOffset]; } +-(void)reloadPagerTabStripView +{ + [super reloadPagerTabStripView]; + if ([self isViewLoaded]) + { + [self reloadNavigatorContainerView]; + [self setCurrentNavigationScrollViewOffset]; + } +} + + +#pragma mark - Properties + -(UIView *)navigationView { if (_navigationView) return _navigationView; @@ -127,7 +116,6 @@ CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; UIAccelerationValue xOffset = fromIndex < toIndex ? distance * fromIndex + distance * progressPercentage : distance * fromIndex - distance * progressPercentage; [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; - [self setAlphaToItemAtIndex:fromIndex withOffset:xOffset]; [self setAlphaToItemAtIndex:toIndex withOffset:xOffset]; @@ -137,6 +125,38 @@ #pragma mark - Helpers +-(void)reloadNavigatorContainerView +{ + [self.navigationItemsViews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [obj removeFromSuperview]; + }]; + [self.navigationItemsViews removeAllObjects]; + + __block NSMutableArray *items = [[NSMutableArray alloc] init]; + [self.pagerTabStripChildViewControllers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + NSAssert([obj conformsToProtocol:@protocol(XLPagerTabStripChildItem)], @"child view controller must conform to XLPagerTabStripChildItem"); + UIViewController * childViewController = (UIViewController *)obj; + if ([childViewController respondsToSelector:@selector(titleForPagerTabStripViewController:)]){ + UILabel *navTitleLabel = [self createNewLabelWithText:[childViewController titleForPagerTabStripViewController:self]]; + [navTitleLabel setAlpha: self.currentIndex == idx ? 1 : 0]; + [items addObject:navTitleLabel]; + } + }]; + + [items enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + if([obj isKindOfClass:UIView.class]) + [self addNavigationViewItem:obj index:idx]; + }]; + + // Update Navigation Page Control + [self.navigationPageControl setNumberOfPages:[self.navigationItemsViews count]]; + [self.navigationPageControl setCurrentPage:self.currentIndex]; + CGSize viewSize = [self.navigationPageControl sizeForNumberOfPages:[self.navigationItemsViews count]]; + CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; + CGFloat originX = (distance - viewSize.width/2); + [self.navigationPageControl setFrame:(CGRect){originX, 34, viewSize.width, viewSize.height}]; +} + - (void)addNavigationViewItem:(UIView*)view index:(NSInteger)index { CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; @@ -149,20 +169,6 @@ [_navigationItemsViews addObject:view]; } --(CGSize) getLabelSize:(UILabel *)label -{ - return [[label text] sizeWithAttributes:@{NSFontAttributeName:[label font]}];; -} - --(UILabel *)createNewLabelWithText:(NSString *)text -{ - UILabel *navTitleLabel = [UILabel new]; - navTitleLabel.text = text; - navTitleLabel.font = [UIFont fontWithName:@"Helvetica" size:18]; - navTitleLabel.textColor = [UIColor whiteColor]; - return navTitleLabel; -} - -(void)setAlphaToItemAtIndex:(NSInteger)index withOffset:(UIAccelerationValue)xOffset { if (index<0 || index>=[self.navigationItemsViews count]) { @@ -182,43 +188,26 @@ [label setAlpha:alpha]; } - -#pragma mark - XLPagerTabStripViewControllerDataSource - --(NSArray *)childViewControllersForPagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController +-(CGSize) getLabelSize:(UILabel *)label { - // create child view controllers that will be managed by XLPagerTabStripViewController - TableChildExampleViewController * child_1 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStylePlain]; - ChildExampleViewController * child_2 = [[ChildExampleViewController alloc] init]; - TableChildExampleViewController * child_3 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStyleGrouped]; - ChildExampleViewController * child_4 = [[ChildExampleViewController alloc] init]; - TableChildExampleViewController * child_5 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStylePlain]; - ChildExampleViewController * child_6 = [[ChildExampleViewController alloc] init]; - TableChildExampleViewController * child_7 = [[TableChildExampleViewController alloc] initWithStyle:UITableViewStyleGrouped]; - ChildExampleViewController * child_8 = [[ChildExampleViewController alloc] init]; - if (!_isReload){ - return @[child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8]; - } - - NSMutableArray * childViewControllers = [NSMutableArray arrayWithObjects:child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8, nil]; - NSUInteger count = [childViewControllers count]; - for (NSUInteger i = 0; i < count; ++i) { - // Select a random element between i and end of array to swap with. - NSUInteger nElements = count - i; - NSUInteger n = (arc4random() % nElements) + i; - [childViewControllers exchangeObjectAtIndex:i withObjectAtIndex:n]; - } - NSUInteger nItems = 1 + (rand() % 8); - return [childViewControllers subarrayWithRange:NSMakeRange(0, nItems)]; + return [[label text] sizeWithAttributes:@{NSFontAttributeName:[label font]}];; } --(void)reloadPagerTabStripView +-(UILabel *)createNewLabelWithText:(NSString *)text { - _isReload = YES; - self.isProgressiveIndicator = (rand() % 2 == 0); - self.isElasticIndicatorLimit = (rand() % 2 == 0); - [super reloadPagerTabStripView]; + UILabel *navTitleLabel = [UILabel new]; + navTitleLabel.text = text; + navTitleLabel.font = [UIFont fontWithName:@"Helvetica" size:18]; + navTitleLabel.textColor = [UIColor whiteColor]; + navTitleLabel.alpha = 0; + return navTitleLabel; } +-(void)setCurrentNavigationScrollViewOffset +{ + CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; + UIAccelerationValue xOffset = distance * self.currentIndex; + [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; +} @end From 1fcf200a6ea0aedae08d44421145a47c2d6d5ee3 Mon Sep 17 00:00:00 2001 From: pastorin Date: Wed, 8 Apr 2015 14:59:16 -0300 Subject: [PATCH 3/8] various changes --- XLPagerTabStrip.xcodeproj/project.pbxproj | 3 + XLPagerTabStrip/Demo/Storyboard.storyboard | 2 +- .../XLTwitterPagerTabStripViewController.m | 109 +++++++++++------- 3 files changed, 70 insertions(+), 44 deletions(-) diff --git a/XLPagerTabStrip.xcodeproj/project.pbxproj b/XLPagerTabStrip.xcodeproj/project.pbxproj index b7c850e..7782342 100644 --- a/XLPagerTabStrip.xcodeproj/project.pbxproj +++ b/XLPagerTabStrip.xcodeproj/project.pbxproj @@ -320,6 +320,7 @@ TargetAttributes = { 28B63A851A459F5900225C66 = { CreatedOnToolsVersion = 6.1.1; + DevelopmentTeam = 6F2G55XL63; }; 28B63A9E1A459F5900225C66 = { CreatedOnToolsVersion = 6.1.1; @@ -505,6 +506,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; INFOPLIST_FILE = XLPagerTabStrip/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -515,6 +517,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; INFOPLIST_FILE = XLPagerTabStrip/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/XLPagerTabStrip/Demo/Storyboard.storyboard b/XLPagerTabStrip/Demo/Storyboard.storyboard index b75b7a4..bfba753 100644 --- a/XLPagerTabStrip/Demo/Storyboard.storyboard +++ b/XLPagerTabStrip/Demo/Storyboard.storyboard @@ -1,5 +1,5 @@ - + diff --git a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m index 5c6d648..432db33 100644 --- a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m @@ -13,7 +13,7 @@ @interface XLTwitterPagerTabStripViewController () -@property (nonatomic) IBOutlet UIView * navigationView; +@property (nonatomic) UIView * navigationView; @property (nonatomic) UIScrollView * navigationScrollView; @property (nonatomic) FXPageControl * navigationPageControl; @property (nonatomic, strong) NSMutableArray * navigationItemsViews; @@ -26,9 +26,8 @@ - (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view. if (!self.navigationView.superview) { - [self.navigationController.navigationBar addSubview:self.navigationView]; + self.navigationItem.titleView = self.navigationView; } if (!self.navigationScrollView.superview) { [self.navigationView addSubview:self.navigationScrollView]; @@ -38,15 +37,18 @@ [self.navigationView addSubview:self.navigationPageControl]; } - _navigationScrollView.bounces = YES; - _navigationScrollView.scrollsToTop = NO; - _navigationScrollView.delegate = self; - _navigationScrollView.showsVerticalScrollIndicator = NO; - _navigationScrollView.showsHorizontalScrollIndicator = NO; - _navigationScrollView.pagingEnabled = YES; - _navigationScrollView.userInteractionEnabled = NO; - [_navigationScrollView setAlwaysBounceHorizontal:YES]; - [_navigationScrollView setAlwaysBounceVertical:NO]; + + UIBarButtonItem *flipButton = [[UIBarButtonItem alloc] + initWithTitle:@"Flip" + style:UIBarButtonItemStyleDone + target:self + action:nil]; + UIBarButtonItem *searchButton = [[UIBarButtonItem alloc] + initWithTitle:@"Flip" + style:UIBarButtonItemStyleDone + target:self + action:nil]; + self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:flipButton, searchButton, nil]; [self reloadNavigatorContainerView]; } @@ -54,6 +56,7 @@ -(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; + [self.navigationView setFrame:CGRectMake(0, 0, CGRectGetWidth(self.navigationController.navigationBar.frame) , CGRectGetHeight(self.navigationController.navigationBar.frame))]; [self setCurrentNavigationScrollViewOffset]; } @@ -75,6 +78,8 @@ if (_navigationView) return _navigationView; _navigationView = [[UIView alloc] init]; _navigationView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + _navigationView.frame = CGRectMake(0, 0, CGRectGetWidth(self.navigationController.navigationBar.frame) - 16, CGRectGetHeight(self.navigationController.navigationBar.frame)); + [_navigationView setBackgroundColor:[UIColor redColor]]; return _navigationView; } @@ -83,6 +88,15 @@ if (_navigationScrollView) return _navigationScrollView; _navigationScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 44)]; _navigationScrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + _navigationScrollView.bounces = YES; + _navigationScrollView.scrollsToTop = NO; + _navigationScrollView.delegate = self; + _navigationScrollView.showsVerticalScrollIndicator = NO; + _navigationScrollView.showsHorizontalScrollIndicator = NO; + _navigationScrollView.pagingEnabled = YES; + _navigationScrollView.userInteractionEnabled = NO; + [_navigationScrollView setAlwaysBounceHorizontal:YES]; + [_navigationScrollView setAlwaysBounceVertical:NO]; return _navigationScrollView; } @@ -108,18 +122,28 @@ #pragma mark - XLPagerTabStripViewControllerDataSource +-(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController updateIndicatorToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController +{ +// if (self.shouldUpdateButtonBarView){ +// NSUInteger newIndex = [self.pagerTabStripChildViewControllers indexOfObject:toViewController]; +// XLPagerTabStripDirection direction = XLPagerTabStripDirectionLeft; +// if (newIndex < [self.pagerTabStripChildViewControllers indexOfObject:fromViewController]){ +// direction = XLPagerTabStripDirectionRight; +// } +// [self.buttonBarView moveToIndex:newIndex animated:YES swipeDirection:direction]; +// } +} + -(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController updateIndicatorFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex withProgressPercentage:(CGFloat)progressPercentage { - CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; - UIAccelerationValue xOffset = fromIndex < toIndex ? distance * fromIndex + distance * progressPercentage : distance * fromIndex - distance * progressPercentage; - [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; - [self setAlphaToItemAtIndex:fromIndex withOffset:xOffset]; - [self setAlphaToItemAtIndex:toIndex withOffset:xOffset]; - - [_navigationPageControl setCurrentPage:self.currentIndex]; + CGFloat distance = [self getDistanceValue]; + UIAccelerationValue xOffset = fromIndex < toIndex ? distance * fromIndex + distance * progressPercentage : distance * fromIndex - distance * progressPercentage; + [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; + [self setAlphaWithOffset:xOffset]; + [_navigationPageControl setCurrentPage:self.currentIndex]; } @@ -152,14 +176,14 @@ [self.navigationPageControl setNumberOfPages:[self.navigationItemsViews count]]; [self.navigationPageControl setCurrentPage:self.currentIndex]; CGSize viewSize = [self.navigationPageControl sizeForNumberOfPages:[self.navigationItemsViews count]]; - CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; + CGFloat distance = [self getDistanceValue]; CGFloat originX = (distance - viewSize.width/2); [self.navigationPageControl setFrame:(CGRect){originX, 34, viewSize.width, viewSize.height}]; } - (void)addNavigationViewItem:(UIView*)view index:(NSInteger)index { - CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; + CGFloat distance = [self getDistanceValue]; CGSize viewSize = [view isKindOfClass:[UILabel class]] ? [self getLabelSize:(UILabel*)view] : view.frame.size; CGFloat originX = (distance - viewSize.width/2) + self.navigationItemsViews.count * distance; view.frame = (CGRect){originX, 8, viewSize.width, viewSize.height}; @@ -169,28 +193,14 @@ [_navigationItemsViews addObject:view]; } --(void)setAlphaToItemAtIndex:(NSInteger)index withOffset:(UIAccelerationValue)xOffset +-(void)setAlphaWithOffset:(UIAccelerationValue)xOffset { - if (index<0 || index>=[self.navigationItemsViews count]) { - return; - } - - CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; - CGFloat alpha; - - if(xOffset < distance * index) { - alpha = (xOffset - distance * (index - 1)) / distance; - }else{ - alpha = 1 - ((xOffset - distance * index) / distance); - } - - UILabel *label = (UILabel*)[self.navigationItemsViews objectAtIndex:index]; - [label setAlpha:alpha]; -} - --(CGSize) getLabelSize:(UILabel *)label -{ - return [[label text] sizeWithAttributes:@{NSFontAttributeName:[label font]}];; + CGFloat distance = [self getDistanceValue]; + [self.navigationItemsViews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + int index = (int)idx; + CGFloat alpha = xOffset < distance * index ? (xOffset - distance * (index - 1)) / distance : 1 - ((xOffset - distance * index) / distance); + [obj setAlpha:alpha]; + }]; } -(UILabel *)createNewLabelWithText:(NSString *)text @@ -203,9 +213,22 @@ return navTitleLabel; } +-(CGSize)getLabelSize:(UILabel *)label +{ + return [[label text] sizeWithAttributes:@{NSFontAttributeName:[label font]}];; +} + +-(CGFloat)getDistanceValue +{ +// CGPoint middle = [self.navigationController.navigationBar convertPoint:self.navigationController.navigationBar.center toView:self.navigationView]; +// CGFloat width = middle.x - self.navigationView.frame.origin.x; + CGFloat width = CGRectGetWidth(self.navigationView.frame); + return width / 2; +} + -(void)setCurrentNavigationScrollViewOffset { - CGFloat distance = CGRectGetWidth(self.navigationScrollView.frame) / 2; + CGFloat distance = [self getDistanceValue]; UIAccelerationValue xOffset = distance * self.currentIndex; [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; } From da0877816ee211635a0ee4efb4155f6906d3347c Mon Sep 17 00:00:00 2001 From: pastorin Date: Wed, 8 Apr 2015 16:05:14 -0300 Subject: [PATCH 4/8] UIBarButtonItem supported --- .../XLTwitterPagerTabStripViewController.m | 89 +++++++++++-------- 1 file changed, 54 insertions(+), 35 deletions(-) diff --git a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m index 432db33..bbdba4b 100644 --- a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m @@ -44,29 +44,31 @@ target:self action:nil]; UIBarButtonItem *searchButton = [[UIBarButtonItem alloc] - initWithTitle:@"Flip" + initWithTitle:@"Search" style:UIBarButtonItemStyleDone target:self action:nil]; self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:flipButton, searchButton, nil]; + self.navigationItem.leftBarButtonItem = flipButton; - [self reloadNavigatorContainerView]; + [self reloadNavigationViewItems]; } -(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.navigationView setFrame:CGRectMake(0, 0, CGRectGetWidth(self.navigationController.navigationBar.frame) , CGRectGetHeight(self.navigationController.navigationBar.frame))]; - [self setCurrentNavigationScrollViewOffset]; + [self.navigationView addObserver:self forKeyPath:@"frame" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:0]; } + -(void)reloadPagerTabStripView { [super reloadPagerTabStripView]; if ([self isViewLoaded]) { - [self reloadNavigatorContainerView]; - [self setCurrentNavigationScrollViewOffset]; + [self reloadNavigationViewItems]; + [self setNavigationViewItemsPosition]; } } @@ -78,8 +80,6 @@ if (_navigationView) return _navigationView; _navigationView = [[UIView alloc] init]; _navigationView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - _navigationView.frame = CGRectMake(0, 0, CGRectGetWidth(self.navigationController.navigationBar.frame) - 16, CGRectGetHeight(self.navigationController.navigationBar.frame)); - [_navigationView setBackgroundColor:[UIColor redColor]]; return _navigationView; } @@ -147,51 +147,77 @@ } +#pragma mark - KVO + +-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ((object == self.navigationItem.titleView && [keyPath isEqualToString:@"frame"])){ + if ([[change objectForKey:NSKeyValueChangeKindKey] isEqualToNumber:@(NSKeyValueChangeSetting)]){ + CGRect oldRect = [change[NSKeyValueChangeOldKey] CGRectValue]; + CGRect newRect = [change[NSKeyValueChangeNewKey] CGRectValue]; + if (!CGRectEqualToRect(newRect,oldRect)) { + [self.navigationScrollView setFrame:CGRectMake(0, 0, CGRectGetWidth(self.navigationView.frame) , CGRectGetHeight(self.navigationScrollView.frame))]; + [self setNavigationViewItemsPosition]; + } + } + } +} + +-(void)dealloc +{ + [self.navigationView removeObserver:self forKeyPath:@"frame"]; +} + + #pragma mark - Helpers --(void)reloadNavigatorContainerView +-(void)reloadNavigationViewItems { [self.navigationItemsViews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { [obj removeFromSuperview]; }]; [self.navigationItemsViews removeAllObjects]; - __block NSMutableArray *items = [[NSMutableArray alloc] init]; + [self.pagerTabStripChildViewControllers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { NSAssert([obj conformsToProtocol:@protocol(XLPagerTabStripChildItem)], @"child view controller must conform to XLPagerTabStripChildItem"); UIViewController * childViewController = (UIViewController *)obj; if ([childViewController respondsToSelector:@selector(titleForPagerTabStripViewController:)]){ UILabel *navTitleLabel = [self createNewLabelWithText:[childViewController titleForPagerTabStripViewController:self]]; [navTitleLabel setAlpha: self.currentIndex == idx ? 1 : 0]; - [items addObject:navTitleLabel]; + [_navigationScrollView addSubview:navTitleLabel]; + [_navigationItemsViews addObject:navTitleLabel]; } }]; +} + +-(void)setNavigationViewItemsPosition +{ + CGFloat distance = [self getDistanceValue]; - [items enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - if([obj isKindOfClass:UIView.class]) - [self addNavigationViewItem:obj index:idx]; + [self.navigationItemsViews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + int index = (int)idx; + UIView *view = (UIView *)obj; + CGSize viewSize = [view isKindOfClass:[UILabel class]] ? [self getLabelSize:(UILabel*)view] : view.frame.size; + CGFloat originX = (distance - viewSize.width/2) + index * distance; + view.frame = (CGRect){originX, 8, viewSize.width, viewSize.height}; + view.tag = index; }]; + + UIAccelerationValue xOffset = distance * self.currentIndex; + [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; + // Update Navigation Page Control [self.navigationPageControl setNumberOfPages:[self.navigationItemsViews count]]; [self.navigationPageControl setCurrentPage:self.currentIndex]; CGSize viewSize = [self.navigationPageControl sizeForNumberOfPages:[self.navigationItemsViews count]]; - CGFloat distance = [self getDistanceValue]; CGFloat originX = (distance - viewSize.width/2); [self.navigationPageControl setFrame:(CGRect){originX, 34, viewSize.width, viewSize.height}]; } -- (void)addNavigationViewItem:(UIView*)view index:(NSInteger)index -{ - CGFloat distance = [self getDistanceValue]; - CGSize viewSize = [view isKindOfClass:[UILabel class]] ? [self getLabelSize:(UILabel*)view] : view.frame.size; - CGFloat originX = (distance - viewSize.width/2) + self.navigationItemsViews.count * distance; - view.frame = (CGRect){originX, 8, viewSize.width, viewSize.height}; - view.tag = index; - - [_navigationScrollView addSubview:view]; - [_navigationItemsViews addObject:view]; -} + + -(void)setAlphaWithOffset:(UIAccelerationValue)xOffset { @@ -220,17 +246,10 @@ -(CGFloat)getDistanceValue { -// CGPoint middle = [self.navigationController.navigationBar convertPoint:self.navigationController.navigationBar.center toView:self.navigationView]; -// CGFloat width = middle.x - self.navigationView.frame.origin.x; - CGFloat width = CGRectGetWidth(self.navigationView.frame); - return width / 2; + CGPoint middle = [self.navigationController.navigationBar convertPoint:self.navigationController.navigationBar.center toView:self.navigationView]; + return middle.x ; } --(void)setCurrentNavigationScrollViewOffset -{ - CGFloat distance = [self getDistanceValue]; - UIAccelerationValue xOffset = distance * self.currentIndex; - [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; -} + @end From 4b2aab374947527590eece1513f3e2496b1f040a Mon Sep 17 00:00:00 2001 From: pastorin Date: Thu, 9 Apr 2015 10:13:00 -0300 Subject: [PATCH 5/8] reload twitterPager --- XLPagerTabStrip/Demo/Storyboard.storyboard | 15 +++++--- .../Demo/TwitterExampleViewController.m | 6 ++++ .../XLTwitterPagerTabStripViewController.m | 35 ++++--------------- 3 files changed, 24 insertions(+), 32 deletions(-) diff --git a/XLPagerTabStrip/Demo/Storyboard.storyboard b/XLPagerTabStrip/Demo/Storyboard.storyboard index bfba753..968ba49 100644 --- a/XLPagerTabStrip/Demo/Storyboard.storyboard +++ b/XLPagerTabStrip/Demo/Storyboard.storyboard @@ -1,6 +1,7 @@ + @@ -19,7 +20,7 @@ - + @@ -192,7 +193,7 @@ - + @@ -337,7 +338,7 @@ - + @@ -375,7 +376,7 @@ - + @@ -389,6 +390,12 @@ + + + + + + diff --git a/XLPagerTabStrip/Demo/TwitterExampleViewController.m b/XLPagerTabStrip/Demo/TwitterExampleViewController.m index 922c8cf..756537e 100644 --- a/XLPagerTabStrip/Demo/TwitterExampleViewController.m +++ b/XLPagerTabStrip/Demo/TwitterExampleViewController.m @@ -53,4 +53,10 @@ return [childViewControllers subarrayWithRange:NSMakeRange(0, nItems)]; } +- (IBAction)reloadTapped:(id)sender { + _isReload = YES; + self.isElasticIndicatorLimit = (rand() % 2 == 0); + [self reloadPagerTabStripView]; +} + @end diff --git a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m index bbdba4b..f78ccbb 100644 --- a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m @@ -37,20 +37,6 @@ [self.navigationView addSubview:self.navigationPageControl]; } - - UIBarButtonItem *flipButton = [[UIBarButtonItem alloc] - initWithTitle:@"Flip" - style:UIBarButtonItemStyleDone - target:self - action:nil]; - UIBarButtonItem *searchButton = [[UIBarButtonItem alloc] - initWithTitle:@"Search" - style:UIBarButtonItemStyleDone - target:self - action:nil]; - self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:flipButton, searchButton, nil]; - self.navigationItem.leftBarButtonItem = flipButton; - [self reloadNavigationViewItems]; } @@ -122,16 +108,9 @@ #pragma mark - XLPagerTabStripViewControllerDataSource --(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController updateIndicatorToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController +-(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController updateIndicatorFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex { -// if (self.shouldUpdateButtonBarView){ -// NSUInteger newIndex = [self.pagerTabStripChildViewControllers indexOfObject:toViewController]; -// XLPagerTabStripDirection direction = XLPagerTabStripDirectionLeft; -// if (newIndex < [self.pagerTabStripChildViewControllers indexOfObject:fromViewController]){ -// direction = XLPagerTabStripDirectionRight; -// } -// [self.buttonBarView moveToIndex:newIndex animated:YES swipeDirection:direction]; -// } + } -(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController @@ -139,11 +118,11 @@ toIndex:(NSInteger)toIndex withProgressPercentage:(CGFloat)progressPercentage { - CGFloat distance = [self getDistanceValue]; - UIAccelerationValue xOffset = fromIndex < toIndex ? distance * fromIndex + distance * progressPercentage : distance * fromIndex - distance * progressPercentage; - [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; - [self setAlphaWithOffset:xOffset]; - [_navigationPageControl setCurrentPage:self.currentIndex]; + CGFloat distance = [self getDistanceValue]; + UIAccelerationValue xOffset = fromIndex < toIndex ? distance * fromIndex + distance * progressPercentage : distance * fromIndex - distance * progressPercentage; + [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; + [self setAlphaWithOffset:xOffset]; + [_navigationPageControl setCurrentPage:self.currentIndex]; } From 43f868c02620699009755150d619aad0628444f5 Mon Sep 17 00:00:00 2001 From: pastorin Date: Thu, 9 Apr 2015 10:27:25 -0300 Subject: [PATCH 6/8] minor changes --- .../Demo/Helpers/ReloadExampleViewController.m | 16 ++++++---------- XLPagerTabStrip/Demo/Storyboard.storyboard | 5 +++-- .../Demo/TwitterExampleViewController.m | 1 - .../XLTwitterPagerTabStripViewController.m | 16 ++++++++++------ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.m b/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.m index 8765bf5..6a5436c 100644 --- a/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.m +++ b/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.m @@ -51,19 +51,15 @@ -(void)updateTitle:(XLPagerTabStripViewController *)pagerController { - NSString * title = @"isProgressiveIndicator = NO"; - if (pagerController.isProgressiveIndicator){ - if (pagerController.isElasticIndicatorLimit){ - title = @"isProgressiveIndicator = YES, isElasticIndicatorLimit = YES"; - } - else{ - title = @"isProgressiveIndicator = YES, isElasticIndicatorLimit = NO"; - } - } - + NSString * title = [NSString stringWithFormat:@"Progressive = %@ ElasticLimit = %@",[self stringFromBool:pagerController.isProgressiveIndicator] ,[self stringFromBool:pagerController.isElasticIndicatorLimit]]; self.titleLabel.text = title; ((UILabel *)self.navigationItem.titleView).text = title; [((UILabel *)self.navigationItem.titleView) sizeToFit]; } +-(NSString *)stringFromBool:(BOOL)value +{ + return value ? @"YES" : @"NO"; +} + @end diff --git a/XLPagerTabStrip/Demo/Storyboard.storyboard b/XLPagerTabStrip/Demo/Storyboard.storyboard index 968ba49..3025f98 100644 --- a/XLPagerTabStrip/Demo/Storyboard.storyboard +++ b/XLPagerTabStrip/Demo/Storyboard.storyboard @@ -88,8 +88,8 @@ @@ -273,6 +273,7 @@ + diff --git a/XLPagerTabStrip/Demo/TwitterExampleViewController.m b/XLPagerTabStrip/Demo/TwitterExampleViewController.m index 756537e..a0f00d5 100644 --- a/XLPagerTabStrip/Demo/TwitterExampleViewController.m +++ b/XLPagerTabStrip/Demo/TwitterExampleViewController.m @@ -55,7 +55,6 @@ - (IBAction)reloadTapped:(id)sender { _isReload = YES; - self.isElasticIndicatorLimit = (rand() % 2 == 0); [self reloadPagerTabStripView]; } diff --git a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m index f78ccbb..15da0ed 100644 --- a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m @@ -58,6 +58,11 @@ } } +-(void)setIsProgressiveIndicator:(BOOL)isProgressiveIndicator +{ + [super setIsProgressiveIndicator:YES]; +} + #pragma mark - Properties @@ -108,9 +113,11 @@ #pragma mark - XLPagerTabStripViewControllerDataSource --(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController updateIndicatorFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex +-(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController + updateIndicatorFromIndex:(NSInteger)fromIndex + toIndex:(NSInteger)toIndex { - + // not accept no progressive indicator } -(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController @@ -177,13 +184,13 @@ [self.navigationItemsViews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { int index = (int)idx; UIView *view = (UIView *)obj; + [view setAlpha: self.currentIndex == idx ? 1 : 0]; CGSize viewSize = [view isKindOfClass:[UILabel class]] ? [self getLabelSize:(UILabel*)view] : view.frame.size; CGFloat originX = (distance - viewSize.width/2) + index * distance; view.frame = (CGRect){originX, 8, viewSize.width, viewSize.height}; view.tag = index; }]; - UIAccelerationValue xOffset = distance * self.currentIndex; [self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)]; @@ -195,9 +202,6 @@ [self.navigationPageControl setFrame:(CGRect){originX, 34, viewSize.width, viewSize.height}]; } - - - -(void)setAlphaWithOffset:(UIAccelerationValue)xOffset { CGFloat distance = [self getDistanceValue]; From ac0e4edb48bdf001d86dd555000c1b1e9223cf27 Mon Sep 17 00:00:00 2001 From: Martin Barreto Date: Thu, 9 Apr 2015 18:12:31 -0300 Subject: [PATCH 7/8] gitignore update --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a3cd143..06870cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Xcode -# +.DS_Store build/ *.pbxuser !default.pbxuser From e53e88cba97712b919d0e80927a1cd6031d1d8be Mon Sep 17 00:00:00 2001 From: Martin Barreto Date: Thu, 9 Apr 2015 18:16:28 -0300 Subject: [PATCH 8/8] merge --- XLPagerTabStrip.xcodeproj/project.pbxproj | 2 -- XLPagerTabStrip/AppDelegate.h | 2 +- XLPagerTabStrip/AppDelegate.m | 2 +- .../Demo/BarExampleViewController.h | 2 +- .../Demo/BarExampleViewController.m | 2 +- .../Demo/ButtonBarExampleViewController.h | 2 +- .../Demo/ButtonBarExampleViewController.m | 2 +- .../ChildExampleViewController.h | 2 +- .../ChildExampleViewController.m | 2 +- .../TableChildExampleViewController.h | 2 +- .../TableChildExampleViewController.m | 2 +- .../Demo/ChildViewController/Views/PostCell.h | 2 +- .../Demo/ChildViewController/Views/PostCell.m | 2 +- .../Helpers/ReloadExampleViewController.h | 2 +- .../Helpers/ReloadExampleViewController.m | 2 +- .../Demo/Helpers/XLJSONSerialization.h | 2 +- .../Demo/Helpers/XLJSONSerialization.m | 2 +- .../Demo/SegmentedExampleViewController.h | 2 +- .../Demo/SegmentedExampleViewController.m | 2 +- .../XLBarPagerTabStripViewController.h | 2 +- .../XLBarPagerTabStripViewController.m | 2 +- .../XLButtonBarPagerTabStripViewController.h | 2 +- .../XLButtonBarPagerTabStripViewController.m | 2 +- .../XLPagerTabStripViewController.h | 2 +- .../XLPagerTabStripViewController.m | 2 +- .../XLSegmentedPagerTabStripViewController.h | 2 +- .../XLSegmentedPagerTabStripViewController.m | 2 +- .../XLTwitterPagerTabStripViewController.h | 23 ++++++++++++++++--- .../XLTwitterPagerTabStripViewController.m | 23 ++++++++++++++++--- XLPagerTabStrip/XL/Views/XLBarView.h | 2 +- XLPagerTabStrip/XL/Views/XLBarView.m | 2 +- XLPagerTabStrip/XL/Views/XLButtonBarView.h | 2 +- XLPagerTabStrip/XL/Views/XLButtonBarView.m | 2 +- .../XL/Views/XLButtonBarViewCell.h | 2 +- .../XL/Views/XLButtonBarViewCell.m | 2 +- XLPagerTabStrip/main.m | 2 +- XLPagerTabStripTests/XLPagerTabStripTests.m | 2 +- 37 files changed, 74 insertions(+), 42 deletions(-) diff --git a/XLPagerTabStrip.xcodeproj/project.pbxproj b/XLPagerTabStrip.xcodeproj/project.pbxproj index 91a5168..a6337e8 100644 --- a/XLPagerTabStrip.xcodeproj/project.pbxproj +++ b/XLPagerTabStrip.xcodeproj/project.pbxproj @@ -492,7 +492,6 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CODE_SIGN_IDENTITY = "iPhone Developer"; INFOPLIST_FILE = XLPagerTabStrip/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 7.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -505,7 +504,6 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CODE_SIGN_IDENTITY = "iPhone Developer"; INFOPLIST_FILE = XLPagerTabStrip/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 7.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; diff --git a/XLPagerTabStrip/AppDelegate.h b/XLPagerTabStrip/AppDelegate.h index 52e62a2..a1a1a0e 100644 --- a/XLPagerTabStrip/AppDelegate.h +++ b/XLPagerTabStrip/AppDelegate.h @@ -2,7 +2,7 @@ // AppDelegate.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/AppDelegate.m b/XLPagerTabStrip/AppDelegate.m index 2a4dea2..1109df2 100644 --- a/XLPagerTabStrip/AppDelegate.m +++ b/XLPagerTabStrip/AppDelegate.m @@ -2,7 +2,7 @@ // AppDelegate.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/BarExampleViewController.h b/XLPagerTabStrip/Demo/BarExampleViewController.h index 57f1ac9..16d8c19 100644 --- a/XLPagerTabStrip/Demo/BarExampleViewController.h +++ b/XLPagerTabStrip/Demo/BarExampleViewController.h @@ -2,7 +2,7 @@ // BarContainerViewController.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/BarExampleViewController.m b/XLPagerTabStrip/Demo/BarExampleViewController.m index a452f6f..a1ea503 100644 --- a/XLPagerTabStrip/Demo/BarExampleViewController.m +++ b/XLPagerTabStrip/Demo/BarExampleViewController.m @@ -2,7 +2,7 @@ // BarContainerViewController.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/ButtonBarExampleViewController.h b/XLPagerTabStrip/Demo/ButtonBarExampleViewController.h index afcdbd8..23c8aa0 100644 --- a/XLPagerTabStrip/Demo/ButtonBarExampleViewController.h +++ b/XLPagerTabStrip/Demo/ButtonBarExampleViewController.h @@ -2,7 +2,7 @@ // ButtonContainerViewController.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/ButtonBarExampleViewController.m b/XLPagerTabStrip/Demo/ButtonBarExampleViewController.m index ad9c1d5..9872fae 100644 --- a/XLPagerTabStrip/Demo/ButtonBarExampleViewController.m +++ b/XLPagerTabStrip/Demo/ButtonBarExampleViewController.m @@ -2,7 +2,7 @@ // ButtonContainerViewController.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/ChildViewController/ChildExampleViewController.h b/XLPagerTabStrip/Demo/ChildViewController/ChildExampleViewController.h index 4381d33..5e589fd 100644 --- a/XLPagerTabStrip/Demo/ChildViewController/ChildExampleViewController.h +++ b/XLPagerTabStrip/Demo/ChildViewController/ChildExampleViewController.h @@ -2,7 +2,7 @@ // ChildExampleViewController.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/ChildViewController/ChildExampleViewController.m b/XLPagerTabStrip/Demo/ChildViewController/ChildExampleViewController.m index d542d05..3dccc25 100644 --- a/XLPagerTabStrip/Demo/ChildViewController/ChildExampleViewController.m +++ b/XLPagerTabStrip/Demo/ChildViewController/ChildExampleViewController.m @@ -2,7 +2,7 @@ // ChildExampleViewController.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/ChildViewController/TableChildExampleViewController.h b/XLPagerTabStrip/Demo/ChildViewController/TableChildExampleViewController.h index 4330785..4c5b855 100644 --- a/XLPagerTabStrip/Demo/ChildViewController/TableChildExampleViewController.h +++ b/XLPagerTabStrip/Demo/ChildViewController/TableChildExampleViewController.h @@ -2,7 +2,7 @@ // TableChildExampleViewController.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/ChildViewController/TableChildExampleViewController.m b/XLPagerTabStrip/Demo/ChildViewController/TableChildExampleViewController.m index f8dde93..654d388 100644 --- a/XLPagerTabStrip/Demo/ChildViewController/TableChildExampleViewController.m +++ b/XLPagerTabStrip/Demo/ChildViewController/TableChildExampleViewController.m @@ -2,7 +2,7 @@ // TableChildExampleViewController.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/ChildViewController/Views/PostCell.h b/XLPagerTabStrip/Demo/ChildViewController/Views/PostCell.h index 1ec2841..81194dd 100644 --- a/XLPagerTabStrip/Demo/ChildViewController/Views/PostCell.h +++ b/XLPagerTabStrip/Demo/ChildViewController/Views/PostCell.h @@ -2,7 +2,7 @@ // PostCell.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/ChildViewController/Views/PostCell.m b/XLPagerTabStrip/Demo/ChildViewController/Views/PostCell.m index 1286fdc..c840724 100644 --- a/XLPagerTabStrip/Demo/ChildViewController/Views/PostCell.m +++ b/XLPagerTabStrip/Demo/ChildViewController/Views/PostCell.m @@ -2,7 +2,7 @@ // PostCell.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.h b/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.h index 2556b4a..eccb965 100644 --- a/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.h +++ b/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.h @@ -3,7 +3,7 @@ // XLPagerTabStrip // // Created by Martin Barreto on 12/20/14. -// Copyright (c) 2014 Xmartlabs. All rights reserved. +// Copyright (c) 2015 Xmartlabs. All rights reserved. // #import diff --git a/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.m b/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.m index 6a5436c..ba9144d 100644 --- a/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.m +++ b/XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.m @@ -3,7 +3,7 @@ // XLPagerTabStrip // // Created by Martin Barreto on 12/20/14. -// Copyright (c) 2014 Xmartlabs. All rights reserved. +// Copyright (c) 2015 Xmartlabs. All rights reserved. // #import "XLPagerTabStripViewController.h" #import "ReloadExampleViewController.h" diff --git a/XLPagerTabStrip/Demo/Helpers/XLJSONSerialization.h b/XLPagerTabStrip/Demo/Helpers/XLJSONSerialization.h index 844a595..78b5b4e 100644 --- a/XLPagerTabStrip/Demo/Helpers/XLJSONSerialization.h +++ b/XLPagerTabStrip/Demo/Helpers/XLJSONSerialization.h @@ -2,7 +2,7 @@ // XLJSONSerialization.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/Helpers/XLJSONSerialization.m b/XLPagerTabStrip/Demo/Helpers/XLJSONSerialization.m index 9b312b5..76201c2 100644 --- a/XLPagerTabStrip/Demo/Helpers/XLJSONSerialization.m +++ b/XLPagerTabStrip/Demo/Helpers/XLJSONSerialization.m @@ -2,7 +2,7 @@ // XLJSONSerialization.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/SegmentedExampleViewController.h b/XLPagerTabStrip/Demo/SegmentedExampleViewController.h index 1637cd5..095c294 100644 --- a/XLPagerTabStrip/Demo/SegmentedExampleViewController.h +++ b/XLPagerTabStrip/Demo/SegmentedExampleViewController.h @@ -2,7 +2,7 @@ // SegmentedContainerViewController.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/Demo/SegmentedExampleViewController.m b/XLPagerTabStrip/Demo/SegmentedExampleViewController.m index 5db0d9c..0152102 100644 --- a/XLPagerTabStrip/Demo/SegmentedExampleViewController.m +++ b/XLPagerTabStrip/Demo/SegmentedExampleViewController.m @@ -2,7 +2,7 @@ // SegmentedContainerViewController.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Controllers/XLBarPagerTabStripViewController.h b/XLPagerTabStrip/XL/Controllers/XLBarPagerTabStripViewController.h index 22f9756..3937a06 100644 --- a/XLPagerTabStrip/XL/Controllers/XLBarPagerTabStripViewController.h +++ b/XLPagerTabStrip/XL/Controllers/XLBarPagerTabStripViewController.h @@ -2,7 +2,7 @@ // XLBarPagerTabStripViewController.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Controllers/XLBarPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLBarPagerTabStripViewController.m index 605ee36..ddaca23 100644 --- a/XLPagerTabStrip/XL/Controllers/XLBarPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLBarPagerTabStripViewController.m @@ -2,7 +2,7 @@ // XLBarPagerTabStripViewController.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.h b/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.h index e917343..c276864 100644 --- a/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.h +++ b/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.h @@ -2,7 +2,7 @@ // XLButtonBarPagerTabStripViewController.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.m index c9352f2..6cef832 100644 --- a/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.m @@ -2,7 +2,7 @@ // XLButtonBarPagerTabStripViewController.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.h b/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.h index f9cda12..c1c8bd0 100644 --- a/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.h +++ b/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.h @@ -2,7 +2,7 @@ // XLPagerTabStripViewController.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.m index 6cb11c4..2cef2e5 100644 --- a/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.m @@ -2,7 +2,7 @@ // XLPagerTabStripViewController // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Controllers/XLSegmentedPagerTabStripViewController.h b/XLPagerTabStrip/XL/Controllers/XLSegmentedPagerTabStripViewController.h index 01e2f61..60618e7 100644 --- a/XLPagerTabStrip/XL/Controllers/XLSegmentedPagerTabStripViewController.h +++ b/XLPagerTabStrip/XL/Controllers/XLSegmentedPagerTabStripViewController.h @@ -2,7 +2,7 @@ // XLSegmentedPagerTabStripViewController.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Controllers/XLSegmentedPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLSegmentedPagerTabStripViewController.m index f73d721..e95ae35 100644 --- a/XLPagerTabStrip/XL/Controllers/XLSegmentedPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLSegmentedPagerTabStripViewController.m @@ -2,7 +2,7 @@ // XLSegmentedPagerTabStripViewController.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.h b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.h index 8409c2a..6119207 100644 --- a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.h +++ b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.h @@ -1,10 +1,27 @@ // // XLTwitterPagerTabStripViewController.h -// XLPagerTabStrip +// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Created by Martin Pastorin on 2/12/15. -// Copyright (c) 2015 Xmartlabs. All rights reserved. +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "XLPagerTabStripViewController.h" diff --git a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m index 15da0ed..ad49141 100644 --- a/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLTwitterPagerTabStripViewController.m @@ -1,10 +1,27 @@ // // XLTwitterPagerTabStripViewController.m -// XLPagerTabStrip +// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Created by Martin Pastorin on 2/12/15. -// Copyright (c) 2015 Xmartlabs. All rights reserved. +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "XLTwitterPagerTabStripViewController.h" #import "TableChildExampleViewController.h" diff --git a/XLPagerTabStrip/XL/Views/XLBarView.h b/XLPagerTabStrip/XL/Views/XLBarView.h index 0ff6ca3..ef21755 100644 --- a/XLPagerTabStrip/XL/Views/XLBarView.h +++ b/XLPagerTabStrip/XL/Views/XLBarView.h @@ -2,7 +2,7 @@ // XLBarView.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Views/XLBarView.m b/XLPagerTabStrip/XL/Views/XLBarView.m index 2f6fd04..d31eee2 100644 --- a/XLPagerTabStrip/XL/Views/XLBarView.m +++ b/XLPagerTabStrip/XL/Views/XLBarView.m @@ -2,7 +2,7 @@ // XLBarView.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Views/XLButtonBarView.h b/XLPagerTabStrip/XL/Views/XLButtonBarView.h index 27251bf..35c7656 100644 --- a/XLPagerTabStrip/XL/Views/XLButtonBarView.h +++ b/XLPagerTabStrip/XL/Views/XLButtonBarView.h @@ -2,7 +2,7 @@ // XLButtonBarView.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Views/XLButtonBarView.m b/XLPagerTabStrip/XL/Views/XLButtonBarView.m index 2fede8f..0f8e81c 100644 --- a/XLPagerTabStrip/XL/Views/XLButtonBarView.m +++ b/XLPagerTabStrip/XL/Views/XLButtonBarView.m @@ -2,7 +2,7 @@ // XLButtonBarView.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Views/XLButtonBarViewCell.h b/XLPagerTabStrip/XL/Views/XLButtonBarViewCell.h index bea7faa..ce011f8 100644 --- a/XLPagerTabStrip/XL/Views/XLButtonBarViewCell.h +++ b/XLPagerTabStrip/XL/Views/XLButtonBarViewCell.h @@ -2,7 +2,7 @@ // XLButtonBarViewCell.h // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/XL/Views/XLButtonBarViewCell.m b/XLPagerTabStrip/XL/Views/XLButtonBarViewCell.m index f76e7c0..f207ff3 100644 --- a/XLPagerTabStrip/XL/Views/XLButtonBarViewCell.m +++ b/XLPagerTabStrip/XL/Views/XLButtonBarViewCell.m @@ -2,7 +2,7 @@ // XLButtonBarViewCell.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStrip/main.m b/XLPagerTabStrip/main.m index 2511df6..cbfad0c 100644 --- a/XLPagerTabStrip/main.m +++ b/XLPagerTabStrip/main.m @@ -2,7 +2,7 @@ // main.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/XLPagerTabStripTests/XLPagerTabStripTests.m b/XLPagerTabStripTests/XLPagerTabStripTests.m index 0043cf5..ae306d1 100644 --- a/XLPagerTabStripTests/XLPagerTabStripTests.m +++ b/XLPagerTabStripTests/XLPagerTabStripTests.m @@ -2,7 +2,7 @@ // XLPagerTabStripTests.m // XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip ) // -// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) +// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) // // // Permission is hereby granted, free of charge, to any person obtaining a copy