JubeatPlus 3.9.11
Loading...
Searching...
No Matches
SVSegmentedControl Class Reference

A horizontal segmented control whose selected segment is highlighted by a draggable, cross-fading SVSegmentedThumb. More...

#include <SVSegmentedControl.h>

Inheritance diagram for SVSegmentedControl:
Collaboration diagram for SVSegmentedControl:

Instance Methods

(instancetype) - initWithSectionTitles:
 Builds the control with the library defaults and the supplied segment titles.
(void) - moveThumbToIndex:animate:
 Selects a segment, optionally animating the thumb to it.

Properties

void(^ changeHandler )(NSUInteger newIndex)
 A block invoked with the newly selected index whenever the selection changes.
void(^ selectedSegmentChangedHandler )(id sender)
 Deprecated block invoked with the control as its sender when the selection settles.
id< SVSegmentedControlDelegate > delegate
 Deprecated delegate notified of selection changes.
SVSegmentedThumb * thumb
 The sliding highlight, created lazily on first access.
NSUInteger selectedIndex
 The index of the selected segment.
BOOL animateToInitialSelection
 Whether the initial selection animates into place.
BOOL crossFadeLabelsOnDrag
 Whether the primary and secondary labels cross-fade while the thumb is dragged.
UIColor * tintColor
 The colour multiplied over the track with the overlay blend mode.
UIImage * backgroundImage
 A custom track background image.
double height
 The control's height.
UIEdgeInsets thumbEdgeInset
 The inset of the thumb inside a segment.
UIEdgeInsets titleEdgeInsets
 The inset of a title inside a segment.
double cornerRadius
 The corner radius of the drawn track.
UIFont * font
 The title font.
UIColor * textColor
 The title colour.
UIColor * textShadowColor
 The title shadow colour.
CGSize textShadowOffset
 The title shadow offset.
UIColor * shadowColor
 Deprecated alias of textShadowColor.
CGSize shadowOffset
 Deprecated alias of textShadowOffset.
double segmentPadding
 Deprecated title padding.

Detailed Description

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.

Method Documentation

◆ initWithSectionTitles:

- (instancetype) initWithSectionTitles: (NSArray<NSString *> *) sectionTitles

Builds the control with the library defaults and the supplied segment titles.

Parameters
sectionTitlesThe 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
segmentIndexThe segment to select.
animateWhether to animate the move.
Ghidra address:
0x16d534
Ghidra address:
0x16d534
Ghidra address:
0x16d6e4
Ghidra address:
0x16d7d0

Property Documentation

◆ 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

- (double) cornerRadius
readwritenonatomicassign

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

- (id<SVSegmentedControlDelegate>) delegate
readwritenonatomicassign

Deprecated delegate notified of selection changes.

Held unretained (unsafe assign).

Ghidra address:
0x16dbf0 (getter), 0x16dc00 (setter)

◆ font

- (UIFont*) font
readwritenonatomicstrong

The title font.

Default is [UIFont boldSystemFontOfSize:15].

Ghidra address:
0x16d994 (getter), 0x16d9a4 (setter)

◆ height

- (double) height
readwritenonatomicassign

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

- (UIColor*) shadowColor
readwritenonatomicstrong

Deprecated alias of textShadowColor.

The setter forwards to -setTextShadowColor:.

Ghidra address:
0x16dc40 (getter), 0x16d898 (setter)

◆ shadowOffset

- (CGSize) shadowOffset
readwritenonatomicassign

Deprecated alias of textShadowOffset.

The setter forwards to -setTextShadowOffset:.

Ghidra address:
0x16dc50 (getter), 0x16d88c (setter)

◆ textColor

- (UIColor*) textColor
readwritenonatomicstrong

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

- (SVSegmentedThumb *) thumb
readnonatomicstrong

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

- (UIColor*) tintColor
readwritenonatomicstrong

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: