From 4ce6cd1dd3f80e807eec080eb33faf70934e1c35 Mon Sep 17 00:00:00 2001 From: Garrison Locke Date: Wed, 23 Sep 2015 10:34:23 -0400 Subject: [PATCH 1/3] Added the ability to toggle the drawing of the triangle on or off using the the shouldDrawTriangle:drawTriangle method. Modified the second example to utilize this new method as a way of testing it out. --- Example/TTHorizontalPicker/TTViewController.m | 1 + Source/TTGradientView.h | 5 + Source/TTGradientView.m | 76 ++++++----- Source/TTHorizontalPicker.h | 7 +- Source/TTHorizontalPicker.m | 126 +++++++++--------- 5 files changed, 119 insertions(+), 96 deletions(-) diff --git a/Example/TTHorizontalPicker/TTViewController.m b/Example/TTHorizontalPicker/TTViewController.m index b3b6110..d97851c 100644 --- a/Example/TTHorizontalPicker/TTViewController.m +++ b/Example/TTHorizontalPicker/TTViewController.m @@ -57,6 +57,7 @@ - (void)viewDidLoad { [self.horizontalPickerWithTwoRow setMinimumValue:[NSNumber numberWithInteger:1]]; [self.horizontalPickerWithTwoRow setMaximumValue:[NSNumber numberWithInteger:10]]; [self.horizontalPickerWithTwoRow setDefaultIndex:1]; + [self.horizontalPickerWithTwoRow shouldDrawTriangle:NO]; } - (void)didReceiveMemoryWarning { diff --git a/Source/TTGradientView.h b/Source/TTGradientView.h index 951fa70..81b6095 100644 --- a/Source/TTGradientView.h +++ b/Source/TTGradientView.h @@ -50,4 +50,9 @@ typedef NS_OPTIONS (NSInteger, GradientDirection) { */ @property (nonatomic) GradientDirection direction; +/*! + * Used set whether or not to draw the triangle + */ +@property (nonatomic, strong) NSNumber *drawTriangle; + @end diff --git a/Source/TTGradientView.m b/Source/TTGradientView.m index 7e77985..4ea6422 100644 --- a/Source/TTGradientView.m +++ b/Source/TTGradientView.m @@ -51,69 +51,77 @@ - (GradientDirection)direction { return _direction ? _direction : (GradientDirection)LeftToRight; } +- (NSNumber *)drawTriangle { + return _drawTriangle ? _drawTriangle : @1; +} + #pragma mark - Draw - (void)drawRect:(CGRect)rect { - + CGContextRef context = UIGraphicsGetCurrentContext(); - + [[self horizontalLinesColor] setStroke]; [[UIColor clearColor] setFill]; - + UIBezierPath *topPath = [UIBezierPath bezierPath]; [topPath moveToPoint:CGPointMake(0, 1)]; [topPath addLineToPoint:CGPointMake([self width], 1)]; - + topPath.lineWidth = 1; [topPath fill]; [topPath stroke]; - + UIBezierPath *trianglePath = [UIBezierPath bezierPath]; - + [trianglePath moveToPoint:CGPointMake(0, [self height])]; - - //Begining of triangle - [trianglePath addLineToPoint:CGPointMake(([self width] / 2) - (kTriangleSide / 2), [self height] - 1)]; - - //Tip of the triangle - [trianglePath addLineToPoint:CGPointMake(([self width] / 2), [self height] - (kTriangleSide / 2))]; - - //End of triangle - [trianglePath addLineToPoint:CGPointMake(([self width] / 2) + (kTriangleSide / 2), [self height] - 1)]; - + + // If we skip the triangle portion then we'll end up with a straight border along the bottom + if ([[self drawTriangle] boolValue] == YES) { + + //Begining of triangle + [trianglePath addLineToPoint:CGPointMake(([self width] / 2) - (kTriangleSide / 2), [self height] - 1)]; + + //Tip of the triangle + [trianglePath addLineToPoint:CGPointMake(([self width] / 2), [self height] - (kTriangleSide / 2))]; + + //End of triangle + [trianglePath addLineToPoint:CGPointMake(([self width] / 2) + (kTriangleSide / 2), [self height] - 1)]; + } + [trianglePath addLineToPoint:CGPointMake([self width], [self height])]; - + trianglePath.lineWidth = 1; [trianglePath fill]; [trianglePath stroke]; - - + + [[self verticalLinesColor] setStroke]; [[UIColor clearColor] setFill]; - + UIBezierPath *leftVerticalPath = [UIBezierPath bezierPath]; - + [leftVerticalPath moveToPoint:CGPointMake([self width] / 3, kVerticalLineOffset)]; [leftVerticalPath addLineToPoint:CGPointMake([self width] / 3, [self height] - kVerticalLineOffset)]; - + leftVerticalPath.lineWidth = 1; [leftVerticalPath fill]; [leftVerticalPath stroke]; - + UIBezierPath *rightVerticalPath = [UIBezierPath bezierPath]; [rightVerticalPath moveToPoint:CGPointMake([self width] / 3 * 2, kVerticalLineOffset)]; [rightVerticalPath addLineToPoint:CGPointMake([self width] / 3 * 2, [self height] - kVerticalLineOffset)]; - + rightVerticalPath.lineWidth = 1; [rightVerticalPath fill]; [rightVerticalPath stroke]; - + [self drawLinearGradientWithContext:context withRect:CGRectMake(0, 0, [self width] / 3, [self height]) withStartColor:[self leftGradientStartColor].CGColor withEndColor:[self leftGradientEndColor].CGColor withDirection:[self direction]]; - + [self drawLinearGradientWithContext:context withRect:CGRectMake([self width] / 3 * 2, 0, [self width] / 3, [self height]) withStartColor:[self rightGradientStartColor].CGColor @@ -126,35 +134,35 @@ - (void)drawLinearGradientWithContext:(CGContextRef)context withStartColor:(CGColorRef)startColor withEndColor:(CGColorRef)endColor withDirection:(GradientDirection)direction { - + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGFloat locations[] = { 0.0, 1.0 }; - + NSArray *colors = @[(__bridge id) startColor, (__bridge id) endColor]; - + CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef) colors, locations); - + CGPoint startPoint; CGPoint endPoint; - + switch (direction) { case LeftToRight: startPoint = CGPointMake(CGRectGetMinX(rect), CGRectGetMidY(rect)); endPoint = CGPointMake(CGRectGetMaxX(rect), CGRectGetMidY(rect)); break; - + case TopToBottom: startPoint = CGPointMake(CGRectGetMidX(rect), CGRectGetMinY(rect)); endPoint = CGPointMake(CGRectGetMidX(rect), CGRectGetMaxY(rect)); break; } - + CGContextSaveGState(context); CGContextAddRect(context, rect); CGContextClip(context); CGContextDrawLinearGradient(context, gradient, startPoint, endPoint, 0); CGContextRestoreGState(context); - + CGGradientRelease(gradient); CGColorSpaceRelease(colorSpace); } diff --git a/Source/TTHorizontalPicker.h b/Source/TTHorizontalPicker.h index f3517a8..9008828 100644 --- a/Source/TTHorizontalPicker.h +++ b/Source/TTHorizontalPicker.h @@ -35,7 +35,7 @@ @end @interface TTHorizontalPicker : UIView - + @property (strong, nonatomic) id delegate; /*! @@ -113,6 +113,11 @@ */ - (void)gradientDirection:(GradientDirection)direction; +/*! + * Used to enable or disable the drawing of the triangle + */ +- (void)shouldDrawTriangle:(BOOL)drawTriangle; + /*! * Use to get saved index from picker */ diff --git a/Source/TTHorizontalPicker.m b/Source/TTHorizontalPicker.m index b304599..3edaed0 100644 --- a/Source/TTHorizontalPicker.m +++ b/Source/TTHorizontalPicker.m @@ -29,16 +29,16 @@ @implementation TTHorizontalPicker #pragma mark - Lifecycle - (id)initWithCoder:(NSCoder *)coder { - + self = [super initWithCoder:coder]; - + if (self) { - + self.autoresizesSubviews = YES; - + UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init]; - [flowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal]; - + [flowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal]; + self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, [self width], [self height]) collectionViewLayout:flowLayout]; [self.collectionView setDataSource:self]; [self.collectionView setDelegate:self]; @@ -47,27 +47,27 @@ - (id)initWithCoder:(NSCoder *)coder { [self.collectionView setDecelerationRate:UIScrollViewDecelerationRateFast]; self.collectionView.backgroundColor = [UIColor clearColor]; self.collectionView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - + [self addSubview:self.collectionView]; - + gradientView = [[TTGradientView alloc] initWithFrame:CGRectMake(0, 0, [self width], [self height])]; gradientView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; gradientView.backgroundColor = [UIColor clearColor]; gradientView.userInteractionEnabled = NO; - + [self addSubview:gradientView]; } - + return self; } - (void)layoutSubviews { [super layoutSubviews]; - + //Causes collection view items to redraw with new frame when view rotates [self.collectionView reloadData]; [self.collectionView selectItemAtIndexPath:lastIndexSelected animated:NO scrollPosition:UICollectionViewScrollPositionCenteredHorizontally]; - + //Causes the gradient view to re-draw with new frame when view rotates instead of stretching it [gradientView setNeedsDisplay]; } @@ -106,6 +106,10 @@ - (void)gradientDirection:(GradientDirection)direction { gradientView.direction = direction; } +- (void)shouldDrawTriangle:(BOOL)drawTriangle { + gradientView.drawTriangle = [NSNumber numberWithBool:drawTriangle]; +} + #pragma mark - ScrollView Delegate - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { @@ -113,7 +117,7 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { } - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { - + if (!decelerate) { [self scrollViewDidFinishScrolling:scrollView]; } @@ -121,13 +125,13 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL - (void)scrollViewDidFinishScrolling:(UIScrollView *)scrollView { CGPoint point = [self convertPoint:CGPointMake(([self width] / 2.0f), ([self height] / 2.0f)) toView:self.collectionView]; - + NSIndexPath *centerIndexPath = [self.collectionView indexPathForItemAtPoint:point]; - + if (self.minimumValue != nil && self.maximumValue != nil) { [self.collectionView selectItemAtIndexPath:centerIndexPath animated:YES scrollPosition:UICollectionViewScrollPositionCenteredHorizontally]; } - + if (centerIndexPath.row != self.currentIndex.row) { [self setCurrentIndex:centerIndexPath]; } @@ -149,7 +153,7 @@ - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectio - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section { return 0; -} +} #pragma mark - UICollectionViewDelegate @@ -158,7 +162,7 @@ - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - + if (self.minimumValue == nil || self.maximumValue == nil) { return 0; } else { @@ -167,64 +171,64 @@ - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSe } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - + UICollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HorizontalPickerCell" forIndexPath:indexPath]; cell.backgroundColor = [UIColor clearColor]; - + if ([[self.dataSource objectAtIndex:indexPath.row] objectForKey:@"string1"]) { - + for (UIView *subview in [cell.contentView subviews]) { [subview removeFromSuperview]; } - + UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 4, [self width] / 3, [self height] / 2)]; - + [self setLabel:textLabel withText:[[self.dataSource objectAtIndex:indexPath.row] objectForKey:@"string"]]; [textLabel setAdjustsFontSizeToFitWidth:YES]; [textLabel setMinimumScaleFactor:0.5f]; - + [cell.contentView addSubview:textLabel]; - + UILabel *detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, [self height] / 2 - 8, [self width] / 3, [self height] / 2)]; - + [self setLabel:detailLabel withText:[[self.dataSource objectAtIndex:indexPath.row] objectForKey:@"string1"]]; - + [cell.contentView addSubview:detailLabel]; } else { - + for (UIView *subview in [cell.contentView subviews]) { [subview removeFromSuperview]; } - + UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, [self width] / 3, [self height])]; - + [self setLabel:textLabel withText:[[self.dataSource objectAtIndex:indexPath.row] objectForKey:@"string"]]; - + [cell.contentView addSubview:textLabel]; } - + return cell; } - (void)setLabel:(UILabel *)label withText:(NSString *)text { - + label.textAlignment = NSTextAlignmentCenter; label.text = text; label.textColor = [UIColor blackColor]; - + if (self.font) { label.font = self.font; } - + if (self.fontColor) { label.textColor = self.fontColor; } - + [label setAdjustsFontSizeToFitWidth:YES]; [label setMinimumScaleFactor:0.5f]; } -#pragma mark - Getters +#pragma mark - Getters - (float)width { return self.frame.size.width; @@ -235,7 +239,7 @@ - (float)height { } - (NSUInteger)indexOfDictionaryForValue:(NSNumber *)value { - + if (value != nil) { for (NSDictionary *dict in self.dataSource) { if ([[dict objectForKey:@"value"] isEqualToNumber:value]) { @@ -246,13 +250,13 @@ - (NSUInteger)indexOfDictionaryForValue:(NSNumber *)value { } } } - + return 0; } - (NSInteger)savedIndexForKey:(NSString *)identifier { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - + // We do it like this to tell the difference between a missing key, and a stored value of 0.0; if ([defaults objectForKey:identifier] != nil) { NSNumber *num = [defaults objectForKey:identifier]; @@ -262,11 +266,11 @@ - (NSInteger)savedIndexForKey:(NSString *)identifier { } } -#pragma mark - Setters +#pragma mark - Setters - (void)setDataSource:(NSArray *)dataSource { self->_dataSource = dataSource; - + if (dataSource != nil && ([dataSource count] > 0)) { self.absoluteMinimumValue = [[dataSource objectAtIndex:0] objectForKey:@"value"]; self.absoluteMaximumValue = [[dataSource objectAtIndex:([dataSource count] - 1)] objectForKey:@"value"]; @@ -275,15 +279,15 @@ - (void)setDataSource:(NSArray *)dataSource { - (void)setMinimumValue:(NSNumber *)minimumValue { NSInteger value = [minimumValue integerValue]; - + if (self.dataSource != nil && [self.dataSource count] >= 1) { // check that the value is not smaller than the minimum value of our datasource if (value < [self.absoluteMinimumValue integerValue]) { value = [self.absoluteMinimumValue integerValue]; } - + self->_minimumValue = [NSNumber numberWithInteger:value]; - + if (self.currentIndex != nil) { [self.collectionView reloadData]; } @@ -294,15 +298,15 @@ - (void)setMinimumValue:(NSNumber *)minimumValue { - (void)setMaximumValue:(NSNumber *)maximumValue { NSInteger value = [maximumValue integerValue]; - + if (self.dataSource != nil && [self.dataSource count] >= 1) { // check that the value is not larger than the maximum value of our datasource if (value > [self.absoluteMaximumValue integerValue]) { value = [self.absoluteMaximumValue integerValue]; } - + self->_maximumValue = [NSNumber numberWithInteger:value]; - + if (self.currentIndex != nil) { [self.collectionView reloadData]; } @@ -313,35 +317,35 @@ - (void)setMaximumValue:(NSNumber *)maximumValue { - (void)setCurrentIndex:(NSIndexPath *)currentIndex { self->_currentIndex = currentIndex; - + if (self.minimumValue) { if (self.currentIndex.row < [self indexOfDictionaryForValue:self.minimumValue]) { self->_currentIndex = [NSIndexPath indexPathForRow:[self indexOfDictionaryForValue:self.minimumValue] inSection:0]; } } - + if (self.maximumValue) { if (self.currentIndex.row > [self indexOfDictionaryForValue:self.maximumValue]) { self->_currentIndex = [NSIndexPath indexPathForRow:[self indexOfDictionaryForValue:self.maximumValue] inSection:0]; } } - + if (self.currentIndex != nil) { [self updateForSelectedIndex]; } } - (void)updateForSelectedIndex { - + if (self.minimumValue != nil && self.maximumValue != nil) { [self.collectionView reloadData]; [self.collectionView scrollToItemAtIndexPath:self.currentIndex atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES]; - + NSDictionary *dict = [self.dataSource objectAtIndex:self.currentIndex.row]; - + self.value = [[dict objectForKey:@"value"] floatValue]; self.valueString = [dict objectForKey:@"string"]; - + [self updateDelegateForIndex:self.currentIndex]; } else { return; @@ -358,24 +362,24 @@ - (void)saveIndex:(NSInteger)index forKey:(NSString *)identifier { - (void)updateDelegateForIndex:(NSIndexPath *)currentIndex { lastIndexSelected = currentIndex; - + if ([self.delegate respondsToSelector:@selector(horizontalPicker:didSelectObjectFromDataSourceAtIndex:)]) { [self.delegate horizontalPicker:self didSelectObjectFromDataSourceAtIndex:currentIndex.row]; } - + NSDictionary *dict = [self.dataSource objectAtIndex:currentIndex.row]; - + if ([self.delegate respondsToSelector:@selector(horizontalPicker:didSelectValue:)]) { [self.delegate horizontalPicker:self didSelectValue:[dict objectForKey:@"value"]]; } - + if ([self.delegate respondsToSelector:@selector(horizontalPicker:didSelectString:)]) { [self.delegate horizontalPicker:self didSelectString:[dict objectForKey:@"string"]]; } - + if ([self.delegate respondsToSelector:@selector(horizontalPicker:didSelectString1:)]) { [self.delegate horizontalPicker:self didSelectString1:[dict objectForKey:@"string1"]]; } -} +} @end From ff50b95384debe126f83cb2aa6fcce3ab087a7b5 Mon Sep 17 00:00:00 2001 From: Garrison Locke Date: Tue, 27 Oct 2015 15:33:26 -0400 Subject: [PATCH 2/3] Added the ability to have a different font color for the selected item --- .DS_Store | Bin 0 -> 6148 bytes Example/.DS_Store | Bin 0 -> 6148 bytes Example/Podfile.lock | 6 +- .../TTHorizontalPicker.podspec.json | 4 +- Example/Pods/Manifest.lock | 6 +- Example/Pods/Pods.xcodeproj/project.pbxproj | 553 ++++++++---------- .../xcschemes/TTHorizontalPicker.xcscheme | 60 ++ .../Pods-TTHorizontalPicker.xcscheme | 60 ++ .../xcschemes/Pods-Tests.xcscheme | 60 ++ .../xcschemes/xcschememanagement.plist | 42 ++ ...Picker-TTHorizontalPicker-Private.xcconfig | 6 - ...orizontalPicker-TTHorizontalPicker-dummy.m | 5 - ...zontalPicker-TTHorizontalPicker-prefix.pch | 5 - ...rizontalPicker-TTHorizontalPicker.xcconfig | 0 .../Pods-TTHorizontalPicker-environment.h | 14 - .../Pods-TTHorizontalPicker-frameworks.sh | 84 +++ .../Pods-TTHorizontalPicker-resources.sh | 8 +- .../Pods-TTHorizontalPicker.debug.xcconfig | 3 +- .../Pods-TTHorizontalPicker.release.xcconfig | 3 +- .../Pods-Tests-TTHorizontalPicker-dummy.m | 5 - .../Pods-Tests-TTHorizontalPicker.xcconfig | 0 .../Pods-Tests/Pods-Tests-environment.h | 14 - .../Pods-Tests/Pods-Tests-frameworks.sh | 84 +++ .../Pods-Tests/Pods-Tests-resources.sh | 8 +- .../Pods-Tests/Pods-Tests.debug.xcconfig | 3 +- .../Pods-Tests/Pods-Tests.release.xcconfig | 3 +- .../TTHorizontalPicker-dummy.m | 5 + .../TTHorizontalPicker-prefix.pch} | 1 - .../TTHorizontalPicker.xcconfig} | 2 - .../project.pbxproj | 32 + .../xcschemes/xcschememanagement.plist | 27 + .../UserInterfaceState.xcuserstate | Bin 0 -> 12791 bytes .../xcdebugger/Breakpoints_v2.xcbkptlist | 5 + Example/TTHorizontalPicker/TTViewController.m | 1 + Source/TTHorizontalPicker.h | 5 + Source/TTHorizontalPicker.m | 17 +- 36 files changed, 728 insertions(+), 403 deletions(-) create mode 100644 .DS_Store create mode 100644 Example/.DS_Store create mode 100644 Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/TTHorizontalPicker.xcscheme create mode 100644 Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-TTHorizontalPicker.xcscheme create mode 100644 Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-Tests.xcscheme create mode 100644 Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/xcschememanagement.plist delete mode 100644 Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-Private.xcconfig delete mode 100644 Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-dummy.m delete mode 100644 Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-prefix.pch delete mode 100644 Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker.xcconfig delete mode 100644 Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-environment.h create mode 100755 Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-frameworks.sh delete mode 100644 Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-dummy.m delete mode 100644 Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker.xcconfig delete mode 100644 Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-environment.h create mode 100755 Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh create mode 100644 Example/Pods/Target Support Files/TTHorizontalPicker/TTHorizontalPicker-dummy.m rename Example/Pods/Target Support Files/{Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-prefix.pch => TTHorizontalPicker/TTHorizontalPicker-prefix.pch} (57%) rename Example/Pods/Target Support Files/{Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-Private.xcconfig => TTHorizontalPicker/TTHorizontalPicker.xcconfig} (79%) create mode 100644 Example/TTHorizontalPicker.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 Example/TTHorizontalPicker.xcworkspace/xcuserdata/garrisonlocke.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 Example/TTHorizontalPicker.xcworkspace/xcuserdata/garrisonlocke.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..50df5d3f1e35a49ff83e28df8e0d272ccd1b98e5 GIT binary patch literal 6148 zcmeHKJ8nWT5S&erf#^56 zwmik#w*YMUxxEMG0H$*b9fm_;hfH7JxWmIE?e? zC5X)f#9lZgGD5SY5|e7xVp!4{ZNQd=AjZ#1g94l~} z%emM8HT_Kge@xO!3P^!}rGQOVo7Iv}s@ghwoY&e$f1rELH{Ff%pm2zCOpJ2Og_q++ cBxPRnIrn?vkQj8vgHF`Xfa@ZY0@qgH2ecIxU;qFB literal 0 HcmV?d00001 diff --git a/Example/.DS_Store b/Example/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6c40cbf5f4376016975ae1ef7bcbac5d622651e4 GIT binary patch literal 6148 zcmeH~O-chn5QSfB7C|>zx)7PADOF27T&^F zU4>*wTAr7YQojmTt(F|Kiedlb0B zY-zO*H~}ZHZUp4)?&5^MBc9vE^V`E1$2`w{j4szrf}Ayxr{=lc{d% z;k8bzNs(pweAWlv_D|nq#2>%cq{x3Q)^xbI$0vEQy>IZkjZ{atA+sL&4XVr@pX

Cr5HioIiA?M)U;GpcLYm5f;~A{h7#h_89#~35mHsJoq!Xl z64=ykOYZ-}uk-(^llPo}6ZlsILL=*D9d60))}_tKU7N6+v53jKQZ>4;vg + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-TTHorizontalPicker.xcscheme b/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-TTHorizontalPicker.xcscheme new file mode 100644 index 0000000..848e9e1 --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-TTHorizontalPicker.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-Tests.xcscheme b/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-Tests.xcscheme new file mode 100644 index 0000000..d2512cf --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-Tests.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/xcschememanagement.plist b/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..ba8970e --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,42 @@ + + + + + SchemeUserState + + Pods-TTHorizontalPicker.xcscheme + + isShown + + + Pods-Tests.xcscheme + + isShown + + + TTHorizontalPicker.xcscheme + + isShown + + + + SuppressBuildableAutocreation + + 0F4854119FD56E0A9C661D7EB8377D09 + + primary + + + 70939BDF52412D6F058DF740DF5B3494 + + primary + + + B7FAA9A0DBDFDD49AA5C58D64030656E + + primary + + + + + diff --git a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-Private.xcconfig b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-Private.xcconfig deleted file mode 100644 index 35e1d32..0000000 --- a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-Private.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -#include "Pods-TTHorizontalPicker-TTHorizontalPicker.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/TTHorizontalPicker" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/TTHorizontalPicker" -OTHER_LDFLAGS = -ObjC -PODS_ROOT = ${SRCROOT} -SKIP_INSTALL = YES \ No newline at end of file diff --git a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-dummy.m b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-dummy.m deleted file mode 100644 index 0d0b074..0000000 --- a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_TTHorizontalPicker_TTHorizontalPicker : NSObject -@end -@implementation PodsDummy_Pods_TTHorizontalPicker_TTHorizontalPicker -@end diff --git a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-prefix.pch b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-prefix.pch deleted file mode 100644 index 357e5fe..0000000 --- a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker-prefix.pch +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - -#import "Pods-TTHorizontalPicker-environment.h" diff --git a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker.xcconfig b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker-TTHorizontalPicker/Pods-TTHorizontalPicker-TTHorizontalPicker.xcconfig deleted file mode 100644 index e69de29..0000000 diff --git a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-environment.h b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-environment.h deleted file mode 100644 index ca8008b..0000000 --- a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-environment.h +++ /dev/null @@ -1,14 +0,0 @@ - -// To check if a library is compiled with CocoaPods you -// can use the `COCOAPODS` macro definition which is -// defined in the xcconfigs so it is available in -// headers also when they are imported in the client -// project. - - -// TTHorizontalPicker -#define COCOAPODS_POD_AVAILABLE_TTHorizontalPicker -#define COCOAPODS_VERSION_MAJOR_TTHorizontalPicker 1 -#define COCOAPODS_VERSION_MINOR_TTHorizontalPicker 0 -#define COCOAPODS_VERSION_PATCH_TTHorizontalPicker 0 - diff --git a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-frameworks.sh b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-frameworks.sh new file mode 100755 index 0000000..6f76344 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-frameworks.sh @@ -0,0 +1,84 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + diff --git a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-resources.sh b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-resources.sh index 43f0852..16774fb 100755 --- a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-resources.sh +++ b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-resources.sh @@ -9,7 +9,7 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() realpath() { - DIRECTORY=$(cd "${1%/*}" && pwd) + DIRECTORY="$(cd "${1%/*}" && pwd)" FILENAME="${1##*/}" echo "$DIRECTORY/$FILENAME" } @@ -22,7 +22,7 @@ install_resource() ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" ;; *.framework) @@ -58,8 +58,10 @@ install_resource() esac } +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]]; then +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" fi rm -f "$RESOURCES_TO_COPY" diff --git a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker.debug.xcconfig b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker.debug.xcconfig index c9a1af0..2b8d78b 100644 --- a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker.debug.xcconfig +++ b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker.debug.xcconfig @@ -1,6 +1,5 @@ GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/TTHorizontalPicker" OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/TTHorizontalPicker" -OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-TTHorizontalPicker-TTHorizontalPicker" -OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) +OTHER_LDFLAGS = $(inherited) -ObjC -l"TTHorizontalPicker" PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker.release.xcconfig b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker.release.xcconfig index c9a1af0..2b8d78b 100644 --- a/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker.release.xcconfig +++ b/Example/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker.release.xcconfig @@ -1,6 +1,5 @@ GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/TTHorizontalPicker" OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/TTHorizontalPicker" -OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-TTHorizontalPicker-TTHorizontalPicker" -OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) +OTHER_LDFLAGS = $(inherited) -ObjC -l"TTHorizontalPicker" PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-dummy.m b/Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-dummy.m deleted file mode 100644 index a13b074..0000000 --- a/Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_Tests_TTHorizontalPicker : NSObject -@end -@implementation PodsDummy_Pods_Tests_TTHorizontalPicker -@end diff --git a/Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker.xcconfig b/Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker.xcconfig deleted file mode 100644 index e69de29..0000000 diff --git a/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-environment.h b/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-environment.h deleted file mode 100644 index ca8008b..0000000 --- a/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-environment.h +++ /dev/null @@ -1,14 +0,0 @@ - -// To check if a library is compiled with CocoaPods you -// can use the `COCOAPODS` macro definition which is -// defined in the xcconfigs so it is available in -// headers also when they are imported in the client -// project. - - -// TTHorizontalPicker -#define COCOAPODS_POD_AVAILABLE_TTHorizontalPicker -#define COCOAPODS_VERSION_MAJOR_TTHorizontalPicker 1 -#define COCOAPODS_VERSION_MINOR_TTHorizontalPicker 0 -#define COCOAPODS_VERSION_PATCH_TTHorizontalPicker 0 - diff --git a/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh b/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh new file mode 100755 index 0000000..6f76344 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh @@ -0,0 +1,84 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + diff --git a/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh b/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh index 43f0852..16774fb 100755 --- a/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh +++ b/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh @@ -9,7 +9,7 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() realpath() { - DIRECTORY=$(cd "${1%/*}" && pwd) + DIRECTORY="$(cd "${1%/*}" && pwd)" FILENAME="${1##*/}" echo "$DIRECTORY/$FILENAME" } @@ -22,7 +22,7 @@ install_resource() ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" ;; *.framework) @@ -58,8 +58,10 @@ install_resource() esac } +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]]; then +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" fi rm -f "$RESOURCES_TO_COPY" diff --git a/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig b/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig index 766b9af..2b8d78b 100644 --- a/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig +++ b/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig @@ -1,6 +1,5 @@ GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/TTHorizontalPicker" OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/TTHorizontalPicker" -OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-Tests-TTHorizontalPicker" -OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) +OTHER_LDFLAGS = $(inherited) -ObjC -l"TTHorizontalPicker" PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig b/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig index 766b9af..2b8d78b 100644 --- a/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig +++ b/Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig @@ -1,6 +1,5 @@ GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/TTHorizontalPicker" OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/TTHorizontalPicker" -OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-Tests-TTHorizontalPicker" -OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) +OTHER_LDFLAGS = $(inherited) -ObjC -l"TTHorizontalPicker" PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Example/Pods/Target Support Files/TTHorizontalPicker/TTHorizontalPicker-dummy.m b/Example/Pods/Target Support Files/TTHorizontalPicker/TTHorizontalPicker-dummy.m new file mode 100644 index 0000000..d125155 --- /dev/null +++ b/Example/Pods/Target Support Files/TTHorizontalPicker/TTHorizontalPicker-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_TTHorizontalPicker : NSObject +@end +@implementation PodsDummy_TTHorizontalPicker +@end diff --git a/Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-prefix.pch b/Example/Pods/Target Support Files/TTHorizontalPicker/TTHorizontalPicker-prefix.pch similarity index 57% rename from Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-prefix.pch rename to Example/Pods/Target Support Files/TTHorizontalPicker/TTHorizontalPicker-prefix.pch index 2f298b1..aa992a4 100644 --- a/Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-prefix.pch +++ b/Example/Pods/Target Support Files/TTHorizontalPicker/TTHorizontalPicker-prefix.pch @@ -2,4 +2,3 @@ #import #endif -#import "Pods-Tests-environment.h" diff --git a/Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-Private.xcconfig b/Example/Pods/Target Support Files/TTHorizontalPicker/TTHorizontalPicker.xcconfig similarity index 79% rename from Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-Private.xcconfig rename to Example/Pods/Target Support Files/TTHorizontalPicker/TTHorizontalPicker.xcconfig index b86eb5f..a0084ec 100644 --- a/Example/Pods/Target Support Files/Pods-Tests-TTHorizontalPicker/Pods-Tests-TTHorizontalPicker-Private.xcconfig +++ b/Example/Pods/Target Support Files/TTHorizontalPicker/TTHorizontalPicker.xcconfig @@ -1,6 +1,4 @@ -#include "Pods-Tests-TTHorizontalPicker.xcconfig" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/TTHorizontalPicker" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/TTHorizontalPicker" -OTHER_LDFLAGS = -ObjC PODS_ROOT = ${SRCROOT} SKIP_INSTALL = YES \ No newline at end of file diff --git a/Example/TTHorizontalPicker.xcodeproj/project.pbxproj b/Example/TTHorizontalPicker.xcodeproj/project.pbxproj index a16a96b..53f4f87 100644 --- a/Example/TTHorizontalPicker.xcodeproj/project.pbxproj +++ b/Example/TTHorizontalPicker.xcodeproj/project.pbxproj @@ -210,6 +210,7 @@ 6003F587195388D20070C39A /* Frameworks */, 6003F588195388D20070C39A /* Resources */, 2340ADEA341F46B8440C2D9E /* Copy Pods Resources */, + 765AAE8DF51617D9DE0EE298 /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -229,6 +230,7 @@ 6003F5AB195388D20070C39A /* Frameworks */, 6003F5AC195388D20070C39A /* Resources */, 737B1D77D66F3304A2624FCF /* Copy Pods Resources */, + 1CEA02D2FBDEFBAA41495922 /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -298,6 +300,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 1CEA02D2FBDEFBAA41495922 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 2133A3794387EABFCECD9C83 /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -343,6 +360,21 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 765AAE8DF51617D9DE0EE298 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TTHorizontalPicker/Pods-TTHorizontalPicker-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; BCB87856438982D001C62474 /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/Example/TTHorizontalPicker.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/xcschememanagement.plist b/Example/TTHorizontalPicker.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..486153a --- /dev/null +++ b/Example/TTHorizontalPicker.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + TTHorizontalPicker-Example.xcscheme_^#shared#^_ + + orderHint + 0 + + + SuppressBuildableAutocreation + + 6003F589195388D20070C39A + + primary + + + 6003F5AD195388D20070C39A + + primary + + + + + diff --git a/Example/TTHorizontalPicker.xcworkspace/xcuserdata/garrisonlocke.xcuserdatad/UserInterfaceState.xcuserstate b/Example/TTHorizontalPicker.xcworkspace/xcuserdata/garrisonlocke.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..9c618e50db86735fa4c49706807c30492595bccd GIT binary patch literal 12791 zcmch73tW@c|NpscV=&mBUD&v6Y-0n5${o3wnINDff(hbX8ZdA=7;ZyFv(B< z+C`8wH8bs=X4*xwvNFr8G&MELZq~PpX4e1n>|x-F`t|z%zrVk{gzb6G`J8h;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/TTHorizontalPicker/TTViewController.m index d97851c..c72763a 100644 --- a/Example/TTHorizontalPicker/TTViewController.m +++ b/Example/TTHorizontalPicker/TTViewController.m @@ -38,6 +38,7 @@ - (void)viewDidLoad { [self.horizontalPickerWithOneRow setMinimumValue:[NSNumber numberWithInteger:67]]; [self.horizontalPickerWithOneRow setMaximumValue:[NSNumber numberWithInteger:600]]; [self.horizontalPickerWithOneRow setDefaultIndex:1]; + [self.horizontalPickerWithOneRow setSelectedFontColor:[UIColor redColor]]; // Optional - You can change the gradient, horizontal and vertical lines color [self.horizontalPickerWithOneRow gradientViewLeftGradientStarColor:[UIColor redColor]]; diff --git a/Source/TTHorizontalPicker.h b/Source/TTHorizontalPicker.h index 9008828..cd97a41 100644 --- a/Source/TTHorizontalPicker.h +++ b/Source/TTHorizontalPicker.h @@ -43,6 +43,11 @@ */ @property (strong, nonatomic) UIColor *fontColor; +/*! + * Use to change the horizontal picker text font color of the selected item + */ +@property (strong, nonatomic) UIColor *selectedFontColor; + /*! * Use to change the horizontal picker text font */ diff --git a/Source/TTHorizontalPicker.m b/Source/TTHorizontalPicker.m index 3edaed0..272cb2d 100644 --- a/Source/TTHorizontalPicker.m +++ b/Source/TTHorizontalPicker.m @@ -183,7 +183,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 4, [self width] / 3, [self height] / 2)]; - [self setLabel:textLabel withText:[[self.dataSource objectAtIndex:indexPath.row] objectForKey:@"string"]]; + [self setLabel:textLabel withText:[[self.dataSource objectAtIndex:indexPath.row] objectForKey:@"string"] forRowAtIndexPath:indexPath]; [textLabel setAdjustsFontSizeToFitWidth:YES]; [textLabel setMinimumScaleFactor:0.5f]; @@ -191,7 +191,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell UILabel *detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, [self height] / 2 - 8, [self width] / 3, [self height] / 2)]; - [self setLabel:detailLabel withText:[[self.dataSource objectAtIndex:indexPath.row] objectForKey:@"string1"]]; + [self setLabel:detailLabel withText:[[self.dataSource objectAtIndex:indexPath.row] objectForKey:@"string1"] forRowAtIndexPath:indexPath]; [cell.contentView addSubview:detailLabel]; } else { @@ -202,7 +202,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, [self width] / 3, [self height])]; - [self setLabel:textLabel withText:[[self.dataSource objectAtIndex:indexPath.row] objectForKey:@"string"]]; + [self setLabel:textLabel withText:[[self.dataSource objectAtIndex:indexPath.row] objectForKey:@"string"] forRowAtIndexPath:indexPath]; [cell.contentView addSubview:textLabel]; } @@ -210,7 +210,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell return cell; } -- (void)setLabel:(UILabel *)label withText:(NSString *)text { +- (void)setLabel:(UILabel *)label withText:(NSString *)text forRowAtIndexPath:(NSIndexPath *)indexPath { label.textAlignment = NSTextAlignmentCenter; label.text = text; @@ -223,7 +223,14 @@ - (void)setLabel:(UILabel *)label withText:(NSString *)text { if (self.fontColor) { label.textColor = self.fontColor; } - + + if ([self.currentIndex isEqual:indexPath] || (self.currentIndex == nil && indexPath.row == 0)) { + + if (self.selectedFontColor) { + label.textColor = self.selectedFontColor; + } + } + [label setAdjustsFontSizeToFitWidth:YES]; [label setMinimumScaleFactor:0.5f]; } From ba6b54b1f74d3db274f6bb1fe5035d788f70d8af Mon Sep 17 00:00:00 2001 From: Garrison Locke Date: Tue, 27 Oct 2015 15:40:12 -0400 Subject: [PATCH 3/3] Made the selected color look at the defaultIndex value instead of 0 --- .../xcschemes/TTHorizontalPicker.xcscheme | 2 +- .../Pods-TTHorizontalPicker.xcscheme | 2 +- .../xcschemes/Pods-Tests.xcscheme | 2 +- .../UserInterfaceState.xcuserstate | Bin 12791 -> 12792 bytes Source/TTHorizontalPicker.m | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/TTHorizontalPicker.xcscheme b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/TTHorizontalPicker.xcscheme index bba7bfd..efff691 100644 --- a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/TTHorizontalPicker.xcscheme +++ b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/TTHorizontalPicker.xcscheme @@ -14,7 +14,7 @@ buildForArchiving = "YES"> diff --git a/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-TTHorizontalPicker.xcscheme b/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-TTHorizontalPicker.xcscheme index 848e9e1..ae3316a 100644 --- a/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-TTHorizontalPicker.xcscheme +++ b/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-TTHorizontalPicker.xcscheme @@ -14,7 +14,7 @@ buildForArchiving = "YES"> diff --git a/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-Tests.xcscheme b/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-Tests.xcscheme index d2512cf..2171b1c 100644 --- a/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-Tests.xcscheme +++ b/Example/Pods/Pods.xcodeproj/xcuserdata/garrisonlocke.xcuserdatad/xcschemes/Pods-Tests.xcscheme @@ -14,7 +14,7 @@ buildForArchiving = "YES"> diff --git a/Example/TTHorizontalPicker.xcworkspace/xcuserdata/garrisonlocke.xcuserdatad/UserInterfaceState.xcuserstate b/Example/TTHorizontalPicker.xcworkspace/xcuserdata/garrisonlocke.xcuserdatad/UserInterfaceState.xcuserstate index 9c618e50db86735fa4c49706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