FWSegmentedControl
@interface FWSegmentedControl : UIControl
FWSegmentedControl
-
Undocumented
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<NSString *> *sectionTitles
-
Undocumented
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<UIImage *> *sectionImages
-
Undocumented
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<UIImage *> *sectionSelectedImages
-
Provide a block to be executed when selected index is changed.
Alternativly, you could use
addTarget:action:forControlEvents:
Declaration
Objective-C
@property (nonatomic, copy, nullable) FWIndexChangeBlock indexChangeBlock;
-
Used to apply custom text styling to titles when set.
When this block is set, no additional styling is applied to the
NSAttributedString
object returned from this block.Declaration
Objective-C
@property (nonatomic, copy, nullable) FWTitleFormatterBlock titleFormatter;
-
Text attributes to apply to item title text.
Declaration
Objective-C
@property (nonatomic, strong) UI_APPEARANCE_SELECTOR NSDictionary *titleTextAttributes;
-
Undocumented
Declaration
Objective-C
@property (nonatomic, strong) NSDictionary *selectedTitleTextAttributes
-
Segmented control background color.
Default is
[UIColor whiteColor]
Declaration
Objective-C
@property (nonatomic, strong) UI_APPEARANCE_SELECTOR UIColor *backgroundColor;
-
Color for the selection indicator stripe
Default is
R:52, G:181, B:229
Declaration
Objective-C
@property (nonatomic, strong) UI_APPEARANCE_SELECTOR UIColor *selectionIndicatorColor;
-
Color for the selection indicator box
Default is selectionIndicatorColor
Declaration
Objective-C
@property (nonatomic, strong) UI_APPEARANCE_SELECTOR UIColor *selectionIndicatorBoxColor;
-
Color for the vertical divider between segments.
Default is
[UIColor blackColor]
Declaration
Objective-C
@property (nonatomic, strong) UI_APPEARANCE_SELECTOR UIColor *verticalDividerColor;
-
Opacity for the seletion indicator box.
Default is
0.2f
Declaration
Objective-C
@property (nonatomic) CGFloat selectionIndicatorBoxOpacity;
-
Width the vertical divider between segments that is added when
verticalDividerEnabled
is set to YES.Default is
1.0f
Declaration
Objective-C
@property (nonatomic) CGFloat verticalDividerWidth;
-
Specifies the style of the control
Default is
FWSegmentedControlTypeText
Declaration
Objective-C
@property (nonatomic) FWSegmentedControlType type;
-
Specifies the style of the selection indicator.
Default is
FWSegmentedControlSelectionStyleTextWidthStripe
Declaration
Objective-C
@property (nonatomic) FWSegmentedControlSelectionStyle selectionStyle;
-
Specifies the style of the segment’s width.
Default is
FWSegmentedControlSegmentWidthStyleFixed
Declaration
Objective-C
@property (nonatomic) FWSegmentedControlSegmentWidthStyle segmentWidthStyle;
-
Specifies the location of the selection indicator.
Default is
FWSegmentedControlSelectionIndicatorLocationUp
Declaration
Objective-C
@property (nonatomic) FWSegmentedControlSelectionIndicatorLocation selectionIndicatorLocation;
-
Undocumented
Declaration
Objective-C
@property (nonatomic) FWSegmentedControlBorderType borderType
-
Specifies the image position relative to the text. Only applicable for FWSegmentedControlTypeTextImages
Default is
FWSegmentedControlImagePositionBehindText
Declaration
Objective-C
@property (nonatomic) FWSegmentedControlImagePosition imagePosition;
-
Specifies the distance between the text and the image. Only applicable for FWSegmentedControlTypeTextImages
Default is
0,0
Declaration
Objective-C
@property (nonatomic) CGFloat textImageSpacing;
-
Specifies the border color.
Default is
[UIColor blackColor]
Declaration
Objective-C
@property (nonatomic, strong) UIColor *_Nonnull borderColor;
-
Specifies the border width.
Default is
1.0f
Declaration
Objective-C
@property (nonatomic) CGFloat borderWidth;
-
Default is YES. Set to NO to deny scrolling by dragging the scrollView by the user.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isUserDraggable) BOOL userDraggable;
-
Default is YES. Set to NO to deny any touch events by the user.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isTouchEnabled) BOOL touchEnabled;
-
Default is NO. Set to YES to show a vertical divider between the segments.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isVerticalDividerEnabled) BOOL verticalDividerEnabled;
-
Undocumented
Declaration
Objective-C
@property (nonatomic, getter=shouldStretchSegmentsToScreenSize) BOOL stretchSegmentsToScreenSize
-
Index of the currently selected segment.
Declaration
Objective-C
@property (nonatomic) NSUInteger selectedSegmentIndex;
-
Height of the selection indicator. Only effective when
FWSegmentedControlSelectionStyle
is eitherFWSegmentedControlSelectionStyleTextWidthStripe
orFWSegmentedControlSelectionStyleFullWidthStripe
.Default is 5.0
Declaration
Objective-C
@property (nonatomic) CGFloat selectionIndicatorHeight;
-
Edge insets for the selection indicator. NOTE: This does not affect the bounding box of FWSegmentedControlSelectionStyleBox
When FWSegmentedControlSelectionIndicatorLocationUp is selected, bottom edge insets are not used
When FWSegmentedControlSelectionIndicatorLocationDown is selected, top edge insets are not used
Defaults are top: 0.0f left: 0.0f bottom: 0.0f right: 0.0f
Declaration
Objective-C
@property (nonatomic) UIEdgeInsets selectionIndicatorEdgeInsets;
-
Edge insets for the selection indicator box. NOTE: This only affect the bounding box of FWSegmentedControlSelectionStyleBox
Defaults are top: 0.0f left: 0.0f bottom: 0.0f right: 0.0f
Declaration
Objective-C
@property (nonatomic) UIEdgeInsets selectionIndicatorBoxEdgeInsets;
-
Corner radius for the selection indicator.
Defaults is 0
Declaration
Objective-C
@property (nonatomic) CGFloat selectionIndicatorCornerRadius;
-
Corner radius for the selection indicator box.
Defaults is 0
Declaration
Objective-C
@property (nonatomic) CGFloat selectionIndicatorBoxCornerRadius;
-
Inset left and right edges of content.
Default is UIEdgeInsetsMake(0, 0, 0, 0)
Declaration
Objective-C
@property (nonatomic) UIEdgeInsets contentEdgeInset;
-
Inset left and right edges of segments.
Default is UIEdgeInsetsMake(0, 5, 0, 5)
Declaration
Objective-C
@property (nonatomic) UIEdgeInsets segmentEdgeInset;
-
Undocumented
Declaration
Objective-C
@property (nonatomic) UIEdgeInsets enlargeEdgeInset
-
Default is YES. Set to NO to disable animation during user selection.
Declaration
Objective-C
@property (nonatomic) BOOL shouldAnimateUserSelection;
-
Undocumented
Declaration
Objective-C
- (instancetype)initWithSectionTitles:(NSArray<NSString *> *)sectiontitles;
-
Undocumented
Declaration
Objective-C
- (instancetype)initWithSectionImages:(NSArray<UIImage *> *)sectionImages sectionSelectedImages:(NSArray<UIImage *> *)sectionSelectedImages;
-
Undocumented
Declaration
Objective-C
- (instancetype)initWithSectionImages:(NSArray<UIImage *> *)sectionImages sectionSelectedImages:(NSArray<UIImage *> *)sectionSelectedImages titlesForSections:(NSArray<NSString *> *)sectiontitles;
-
Undocumented
Declaration
Objective-C
- (void)setSelectedSegmentIndex:(NSUInteger)index animated:(BOOL)animated;