@@ -19,30 +19,30 @@ @interface HMSegmentedControl ()
1919@property (nonatomic , strong ) CALayer *selectionIndicatorBoxLayer;
2020@property (nonatomic , strong ) CALayer *selectionIndicatorArrowLayer;
2121@property (nonatomic , readwrite ) CGFloat segmentWidth;
22- @property (nonatomic , readwrite ) NSArray *segmentWidthsArray;
22+ @property (nonatomic , readwrite ) NSArray <NSNumber *> *segmentWidthsArray;
2323@property (nonatomic , strong ) HMScrollView *scrollView;
2424
2525@end
2626
2727@implementation HMScrollView
2828
29- - (void )touchesBegan : (NSSet *)touches withEvent : (UIEvent *)event {
29+ - (void )touchesBegan : (NSSet <UITouch *> *)touches withEvent : (UIEvent *)event {
3030 if (!self.dragging ) {
3131 [self .nextResponder touchesBegan: touches withEvent: event];
3232 } else {
3333 [super touchesBegan: touches withEvent: event];
3434 }
3535}
3636
37- - (void )touchesMoved : (NSSet *)touches withEvent : (UIEvent *)event {
37+ - (void )touchesMoved : (NSSet <UITouch *> *)touches withEvent : (UIEvent *)event {
3838 if (!self.dragging ) {
3939 [self .nextResponder touchesMoved: touches withEvent: event];
4040 } else {
4141 [super touchesMoved: touches withEvent: event];
4242 }
4343}
4444
45- - (void )touchesEnded : (NSSet *)touches withEvent : (UIEvent *)event {
45+ - (void )touchesEnded : (NSSet <UITouch *> *)touches withEvent : (UIEvent *)event {
4646 if (!self.dragging ) {
4747 [self .nextResponder touchesEnded: touches withEvent: event];
4848 } else {
@@ -72,7 +72,7 @@ - (id)initWithFrame:(CGRect)frame {
7272 return self;
7373}
7474
75- - (id )initWithSectionTitles : (NSArray *)sectiontitles {
75+ - (id )initWithSectionTitles : (NSArray <NSString *> *)sectiontitles {
7676 self = [super initWithFrame: CGRectZero];
7777
7878 if (self) {
@@ -84,7 +84,7 @@ - (id)initWithSectionTitles:(NSArray *)sectiontitles {
8484 return self;
8585}
8686
87- - (id )initWithSectionImages : (NSArray * )sectionImages sectionSelectedImages : (NSArray *)sectionSelectedImages {
87+ - (id )initWithSectionImages : (NSArray <UIImage *> * )sectionImages sectionSelectedImages : (NSArray <UIImage *> *)sectionSelectedImages {
8888 self = [super initWithFrame: CGRectZero];
8989
9090 if (self) {
@@ -97,14 +97,14 @@ - (id)initWithSectionImages:(NSArray*)sectionImages sectionSelectedImages:(NSArr
9797 return self;
9898}
9999
100- - (instancetype )initWithSectionImages : (NSArray * )sectionImages sectionSelectedImages : (NSArray * )sectionSelectedImages titlesForSections : (NSArray *)sectiontitles {
100+ - (instancetype )initWithSectionImages : (NSArray <UIImage *> * )sectionImages sectionSelectedImages : (NSArray <UIImage *> * )sectionSelectedImages titlesForSections : (NSArray <NSString *> *)sectiontitles {
101101 self = [super initWithFrame: CGRectZero];
102102
103103 if (self) {
104104 [self commonInit ];
105105
106106 if (sectionImages.count != sectiontitles.count ) {
107- [NSException raise: NSRangeException format: @" ***%s : Images bounds (%ld ) Dont match Title bounds (%ld )" , sel_getName (_cmd ), (unsigned long )sectionImages.count, (unsigned long )sectiontitles.count];
107+ [NSException raise: NSRangeException format: @" ***%s : Images bounds (%ld ) Don't match Title bounds (%ld )" , sel_getName (_cmd ), (unsigned long )sectionImages.count, (unsigned long )sectiontitles.count];
108108 }
109109
110110 self.sectionImages = sectionImages;
@@ -174,14 +174,14 @@ - (void)setFrame:(CGRect)frame {
174174 [self updateSegmentsRects ];
175175}
176176
177- - (void )setSectionTitles : (NSArray *)sectionTitles {
177+ - (void )setSectionTitles : (NSArray <NSString *> *)sectionTitles {
178178 _sectionTitles = sectionTitles;
179179
180180 [self setNeedsLayout ];
181181 [self setNeedsDisplay ];
182182}
183183
184- - (void )setSectionImages : (NSArray *)sectionImages {
184+ - (void )setSectionImages : (NSArray <UIImage *> *)sectionImages {
185185 _sectionImages = sectionImages;
186186
187187 [self setNeedsLayout ];
@@ -695,7 +695,7 @@ - (void)willMoveToSuperview:(UIView *)newSuperview {
695695
696696#pragma mark - Touch
697697
698- - (void )touchesEnded : (NSSet *)touches withEvent : (UIEvent *)event {
698+ - (void )touchesEnded : (NSSet <UITouch *> *)touches withEvent : (UIEvent *)event {
699699 UITouch *touch = [touches anyObject ];
700700 CGPoint touchLocation = [touch locationInView: self ];
701701
0 commit comments