VolumeBarStyle
public struct VolumeBarStyle
A value type wrapping parameters used to customize the appearance of VolumeBar.
-
The height of the bar that will be displayed on screen.
Declaration
Swift
public var height: CGFloat = 10
-
Insets from the top edge of the device screen.
If
respectsSafeAreaInsets
isfalse
, VolumeBar will be inset from screen edges by exactly these insets.If
respectsSafeAreaInsets
istrue
, VolumeBar will be inset by the sum of the safe area insets of the device andedgeInsets
.Seealso
respectsSafeAreaInsets
Declaration
Swift
public var edgeInsets: UIEdgeInsets = UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5)
-
Whether or not VolumeBar should respect
safeAreaInsets
when displaying.Seealso
edgeInsets
Declaration
Swift
public var respectsSafeAreaInsets: Bool = false
-
The number of segments that the VolumeBar is made up of. Use this with
segmentSpacing
to give VolumeBar a segmented appearance.The default value, 16, is equal to the number of volume steps on iOS devices. (When the volume is 0%, pressing volume up exactly 16 times will cause the volume to reach 100%)
Seealso
segmentSpacing
Declaration
Swift
public var segmentCount: UInt = 16
-
The number of points between individual segments in the VolumeBar.
Seealso
segmentCount
Declaration
Swift
public var segmentSpacing: CGFloat = 0
-
The corner radius of the VolumeBar.
Declaration
Swift
public var cornerRadius: CGFloat = 0
-
The color of the progress displayed on the bar.
Declaration
Swift
public var progressTintColor: UIColor = .black
-
The background color of the track.
Declaration
Swift
public var trackTintColor: UIColor = UIColor.black.withAlphaComponent(0.5)
-
The background color behind the track view. This should match the color of the view behind the VolumeBar, which might be the color of your navigation bar.
Declaration
Swift
public var backgroundColor: UIColor = .white
-
A volume bar style like Instagram, where the bar is a continuous progress view that displays to the left of the notch on iPhone X and covers the full width of the iOS status bar on all other iOS devices.
Declaration
Swift
public static let likeInstagram: VolumeBarStyle = UIDevice.current.volumeBar_isiPhoneX ? .leftOfNotch : .fullWidthContinuous
-
A volume bar style like Snapchat, where the bar is a segmented progress view that displays under the notch and status bar on iPhone X (respecting the device’s safe area insets) and covers the iOS status bar on all other iOS devices.
Declaration
Swift
public static let likeSnapchat: VolumeBarStyle =
-
A volume bar style that displays a continuous progress view and has minimal insets.
Declaration
Swift
public static let fullWidthContinuous: VolumeBarStyle =
-
A volume bar style that displays to the left of the notch on iPhone X.
Declaration
Swift
public static let leftOfNotch: VolumeBarStyle =
-
A volume bar style that displays to the right of the notch on iPhone X.
Declaration
Swift
public static let rightOfNotch: VolumeBarStyle =