-
Notifications
You must be signed in to change notification settings - Fork 0
EKSwipeSlider
Inherits from: EKSwipeControl : UIControl : UIView : UIResponder : NSObject
Conforms to:
- NSCoding (UIView)
- UIAppearance (UIView)
- UIAppearanceContainer (UIView)
- NSObject (NSObject)
EKSwipeSlider provides a slider similar to UISlider. A trackView
is added to the overlayView
representing the specified value
. When the overlay is displayed, the anchor point is moved on the x-axis to the left or right depending on the value
of the slider. The value can be limited using the minimumValue
and maximumValue
properties.
The slider adjusts its position depending on the value when touched. The orange point represents the touch point.
It is recommended to use the swipe slider only as a shortcut and to display a full-featured popover if the user taps the control!
For example the volume can be quickly adjusted using the swipe-slider. For precise control or AirPlay-configuration a popover with a MPVolumeView is displayed.
Vertical sliders are not supported because they are easily hidden by the user's hand.
In addition to the functionality provided by EKSwipeControl
, this control supports setting the track color for specific events via an appearance proxy. Please note that containment is not supported!
[self.appearance setTrackColor:[UIColor colorWithWhite:0.4f alpha:0.5f] forState:EKSwipeControlOverlayVisibleState];
[self.appearance setTrackColor:[UIColor colorWithWhite:0.4f alpha:0.3f] forState:EKSwipeControlOverlayFadedState];
[self.appearance setOverlayColor:[UIColor colorWithWhite:0.5f alpha:0.5f] forState:EKSwipeControlOverlayVisibleState];
[self.appearance setOverlayColor:[UIColor colorWithWhite:0.5f alpha:0.3f] forState:EKSwipeControlOverlayFadedState];
@property (nonatomic) float value;
- (void)setValue:(float)value animated:(BOOL)animated;
Used to get & set the value of the slider.
@property (nonatomic) float minimumValue;
@property (nonatomic) float maximumValue;
Specify the minimum and maximum value of the slider.
@property (strong, nonatomic) IBOutlet UIView *trackView;
The view-object that is displayed as the track. Defaults to a UIView.
@property (nonatomic, getter=isContinuous) BOOL continuous;
Indicates whether changes in the sliders value generate continuous update events.
- (CGRect)trackRectForBounds:(CGRect)bounds;
The size and position of the track rect.
@property (nonatomic) CGFloat width;
The width of the overlay.
@property (nonatomic) CGFloat offset;
The offset of the overlay.
- (UIColor *)trackColorForState:(UIControlState)state UI_APPEARANCE_SELECTOR;
- (void)setTrackColor:(UIColor *)color forState:(UIControlState)state UI_APPEARANCE_SELECTOR;
Assigns a track color for a specific state.
@property (readonly, strong, nonatomic) UIColor *currentTrackColor;
This method returns the current color of the track. The color is obtained by performing the trackColorForState:
method on the current object. If no color is returned, the appearance proxy of the current class is used.
The method tries to obtain the color using the following states:
- current state
-
EKSwipeControlOverlayFadedState
if theEKSwipeControlOverlayFadedState
flag is set -
EKSwipeControlOverlayVisibleState
if theEKSwipeControlOverlayVisibleState
flag is set UIControlStateNormal
- Fallback to:
[UIColor colorWithWhite:0.4f alpha:0.5f]