A horizontal segmented control whose selected segment is highlighted by a draggable, cross-fading SVSegmentedThumb.
More...
#include <SVSegmentedControl.h>
A horizontal segmented control whose selected segment is highlighted by a draggable, cross-fading SVSegmentedThumb.
The control lays its segments out at a uniform segmentWidth derived from the widest title, slides the thumb under drag, and snaps it to the nearest segment on release, reporting the new selection through a block, a delegate, and UIControlEventValueChanged.
◆ initWithSectionTitles:
| - (instancetype) initWithSectionTitles: |
|
(NSArray<NSString *> *) | sectionTitles |
|
Builds the control with the library defaults and the supplied segment titles.
- Parameters
-
| sectionTitles | The segment titles. |
- Returns
- The initialised control.
- Ghidra address:
- 0x16a4b0
- Ghidra address:
- 0x16a4b0
◆ moveThumbToIndex:animate:
| - (void) moveThumbToIndex: |
|
(NSUInteger) | segmentIndex |
| animate: |
|
(BOOL) | animate |
Selects a segment, optionally animating the thumb to it.
- Parameters
-
| segmentIndex | The segment to select. |
| animate | Whether to animate the move. |
- Ghidra address:
- 0x16d534
- Ghidra address:
- 0x16d534
- Ghidra address:
- 0x16d6e4
- Ghidra address:
- 0x16d7d0
◆ animateToInitialSelection
| - (BOOL) animateToInitialSelection |
|
readwritenonatomicassign |
Whether the initial selection animates into place.
Default is NO.
- Ghidra address:
- 0x16d8fc (getter), 0x16d90c (setter)
◆ backgroundImage
| - (UIImage*) backgroundImage |
|
readwritenonatomicstrong |
A custom track background image.
Setting it also sets height to the image's height.
- Ghidra address:
- 0x16d984 (getter), 0x16d7e8 (setter)
◆ changeHandler
| - (void(^ changeHandler) (NSUInteger newIndex)) |
|
readwritenonatomiccopy |
A block invoked with the newly selected index whenever the selection changes.
- Ghidra address:
- 0x16d8c0 (getter), 0x16d8d0 (setter)
◆ cornerRadius
The corner radius of the drawn track.
Default is 4.0.
- Ghidra address:
- 0x16d940 (getter), 0x16d950 (setter)
◆ crossFadeLabelsOnDrag
| - (BOOL) crossFadeLabelsOnDrag |
|
readwritenonatomicassign |
Whether the primary and secondary labels cross-fade while the thumb is dragged.
Default is NO.
- Ghidra address:
- 0x16da88 (getter), 0x16da98 (setter)
◆ delegate
Deprecated delegate notified of selection changes.
Held unretained (unsafe assign).
- Ghidra address:
- 0x16dbf0 (getter), 0x16dc00 (setter)
◆ font
The title font.
Default is [UIFont boldSystemFontOfSize:15].
- Ghidra address:
- 0x16d994 (getter), 0x16d9a4 (setter)
◆ height
The control's height.
Default is 32.0.
- Ghidra address:
- 0x16da68 (getter), 0x16da78 (setter)
◆ segmentPadding
| - (double) segmentPadding |
|
readwritenonatomicassign |
Deprecated title padding.
The setter forwards to symmetric left/right titleEdgeInsets.
- Ghidra address:
- 0x16da28 (getter), 0x16d870 (setter)
◆ selectedIndex
| - (NSUInteger) selectedIndex |
|
readwritenonatomicassign |
The index of the selected segment.
Default is 0.
- Ghidra address:
- 0x16d8dc (getter), 0x16d8ec (setter)
◆ selectedSegmentChangedHandler
| - (void(^ selectedSegmentChangedHandler) (id sender)) |
|
readwritenonatomiccopy |
Deprecated block invoked with the control as its sender when the selection settles.
- Ghidra address:
- 0x16d8a4 (getter), 0x16d8b4 (setter)
◆ shadowColor
Deprecated alias of textShadowColor.
The setter forwards to -setTextShadowColor:.
- Ghidra address:
- 0x16dc40 (getter), 0x16d898 (setter)
◆ shadowOffset
Deprecated alias of textShadowOffset.
The setter forwards to -setTextShadowOffset:.
- Ghidra address:
- 0x16dc50 (getter), 0x16d88c (setter)
◆ textColor
The title colour.
Default is gray.
- Ghidra address:
- 0x16d9b8 (getter), 0x16d9c8 (setter)
◆ textShadowColor
| - (UIColor*) textShadowColor |
|
readwritenonatomicstrong |
The title shadow colour.
Default is black.
- Ghidra address:
- 0x16d9dc (getter), 0x16d9ec (setter)
◆ textShadowOffset
| - (CGSize) textShadowOffset |
|
readwritenonatomicassign |
The title shadow offset.
Default is CGSizeMake(0, -1).
- Ghidra address:
- 0x16da00 (getter), 0x16da14 (setter)
◆ thumb
The sliding highlight, created lazily on first access.
- Ghidra address:
- 0x16a874
◆ thumbEdgeInset
| - (UIEdgeInsets) thumbEdgeInset |
|
readwritenonatomicassign |
The inset of the thumb inside a segment.
Default is UIEdgeInsetsMake(2, 2, 3, 2).
- Ghidra address:
- 0x16dc10 (getter), 0x16dc28 (setter)
◆ tintColor
The colour multiplied over the track with the overlay blend mode.
Default is gray.
- Ghidra address:
- 0x16d960 (getter), 0x16d970 (setter)
◆ titleEdgeInsets
| - (UIEdgeInsets) titleEdgeInsets |
|
readwritenonatomicassign |
The inset of a title inside a segment.
Default is UIEdgeInsetsMake(0, 10, 0, 10).
- Ghidra address:
- 0x16da38 (getter), 0x16da50 (setter)
The documentation for this class was generated from the following files: