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
respectsSafeAreaInsetsisfalse, VolumeBar will be inset from screen edges by exactly these insets.If
respectsSafeAreaInsetsistrue, VolumeBar will be inset by the sum of the safe area insets of the device andedgeInsets.Seealso
respectsSafeAreaInsetsDeclaration
Swift
public var edgeInsets: UIEdgeInsets = UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5) -
Whether or not VolumeBar should respect
safeAreaInsetswhen displaying.Seealso
edgeInsetsDeclaration
Swift
public var respectsSafeAreaInsets: Bool = false
-
The number of segments that the VolumeBar is made up of. Use this with
segmentSpacingto 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
segmentSpacingDeclaration
Swift
public var segmentCount: UInt = 16 -
The number of points between individual segments in the VolumeBar.
Seealso
segmentCountDeclaration
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 =
View on GitHub
Install in Dash
VolumeBarStyle Struct Reference