JubeatPlus 3.9.11
Loading...
Searching...
No Matches
SVSegmentedControl.h
Go to the documentation of this file.
1
11
12#import <UIKit/UIKit.h>
13
14#import "SVSegmentedThumb.h"
15
16NS_ASSUME_NONNULL_BEGIN
17
19
26@protocol SVSegmentedControlDelegate <NSObject>
27
33- (void)segmentedControl:(SVSegmentedControl *)segmentedControl didSelectIndex:(NSUInteger)index;
34
35@end
36
45@interface SVSegmentedControl : UIControl
46
47#pragma mark - Change notification
48
53@property(nonatomic, copy, nullable) void (^changeHandler)(NSUInteger newIndex);
54
59@property(nonatomic, copy, nullable) void (^selectedSegmentChangedHandler)(id sender);
60
65@property(nonatomic, assign, nullable) id<SVSegmentedControlDelegate> delegate;
66
67#pragma mark - Appearance and configuration
68
73@property(nonatomic, strong, readonly) SVSegmentedThumb *thumb;
74
79@property(nonatomic, assign) NSUInteger selectedIndex;
80
85@property(nonatomic, assign) BOOL animateToInitialSelection;
86
92@property(nonatomic, assign) BOOL crossFadeLabelsOnDrag;
93
98@property(nonatomic, strong, nullable) UIColor *tintColor;
99
104@property(nonatomic, strong, nullable) UIImage *backgroundImage;
105
110@property(nonatomic, assign) double height;
111
116@property(nonatomic, assign) UIEdgeInsets thumbEdgeInset;
117
122@property(nonatomic, assign) UIEdgeInsets titleEdgeInsets;
123
128@property(nonatomic, assign) double cornerRadius;
129
134@property(nonatomic, strong, nullable) UIFont *font;
135
140@property(nonatomic, strong, nullable) UIColor *textColor;
141
146@property(nonatomic, strong, nullable) UIColor *textShadowColor;
147
152@property(nonatomic, assign) CGSize textShadowOffset;
153
154#pragma mark - Deprecated appearance aliases
155
160@property(nonatomic, strong, nullable) UIColor *shadowColor;
161
166@property(nonatomic, assign) CGSize shadowOffset;
167
172@property(nonatomic, assign) double segmentPadding;
173
174#pragma mark - Lifecycle and layout
175
182- (instancetype)initWithSectionTitles:(NSArray<NSString *> *)sectionTitles;
183
190- (void)moveThumbToIndex:(NSUInteger)segmentIndex animate:(BOOL)animate;
191
192@end
193
194NS_ASSUME_NONNULL_END
195
196// code: language=Objective-C
197// kate: hl Objective-C;
198// vim: set ft=objc :
The sliding selected-segment highlight ("thumb") view of Sam Vermette's third-party SVSegmentedContro...
A horizontal segmented control whose selected segment is highlighted by a draggable,...
Definition SVSegmentedControl.h:46
NSUInteger selectedIndex
The index of the selected segment.
Definition SVSegmentedControl.h:79
UIColor * tintColor
The colour multiplied over the track with the overlay blend mode.
Definition SVSegmentedControl.h:98
SVSegmentedThumb * thumb
The sliding highlight, created lazily on first access.
Definition SVSegmentedControl.m:117
double height
The control's height.
Definition SVSegmentedControl.h:110
id< SVSegmentedControlDelegate > delegate
Deprecated delegate notified of selection changes.
Definition SVSegmentedControl.h:65
UIEdgeInsets titleEdgeInsets
The inset of a title inside a segment.
Definition SVSegmentedControl.h:122
UIColor * textColor
The title colour.
Definition SVSegmentedControl.h:140
UIEdgeInsets thumbEdgeInset
The inset of the thumb inside a segment.
Definition SVSegmentedControl.h:116
BOOL animateToInitialSelection
Whether the initial selection animates into place.
Definition SVSegmentedControl.h:85
CGSize shadowOffset
Deprecated alias of textShadowOffset.
Definition SVSegmentedControl.h:166
UIFont * font
The title font.
Definition SVSegmentedControl.h:134
double segmentPadding
Deprecated title padding.
Definition SVSegmentedControl.h:172
void(^ selectedSegmentChangedHandler)(id sender)
Deprecated block invoked with the control as its sender when the selection settles.
UIColor * textShadowColor
The title shadow colour.
Definition SVSegmentedControl.h:146
BOOL crossFadeLabelsOnDrag
Whether the primary and secondary labels cross-fade while the thumb is dragged.
Definition SVSegmentedControl.h:92
double cornerRadius
The corner radius of the drawn track.
Definition SVSegmentedControl.h:128
CGSize textShadowOffset
The title shadow offset.
Definition SVSegmentedControl.h:152
void(^ changeHandler)(NSUInteger newIndex)
A block invoked with the newly selected index whenever the selection changes.
UIColor * shadowColor
Deprecated alias of textShadowColor.
Definition SVSegmentedControl.h:160
UIImage * backgroundImage
A custom track background image.
Definition SVSegmentedControl.h:104
The rounded highlight the segmented control slides over its selected segment.
Definition SVSegmentedThumb.h:26