-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnvButtonConfiguration.swift
37 lines (30 loc) · 1.1 KB
/
EnvButtonConfiguration.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// EnvButtonConfiguration.swift
// EnvChanger
//
// Created by Nikola B Nikolov on 6.12.21.
//
import UIKit
/// Struct describing an `EnvButtonConfiguration` used to set up the Env button.
public struct EnvButtonConfiguration {
/// Enum cases for style of the floating button.
public enum EnvButtonStyle {
/// Configure the button layout with title.
case title(String)
/// Configure the button layout with image.
case image(UIImage)
}
// MARK: - Properties
let style: EnvButtonStyle
let startingPosition: EnvButtonStartingPosition
// MARK: - Initializer
/// Creates an `EnvButtonConfiguration` instance.
/// - Parameters:
/// - style: Style of the button. Default is `.title("ENV")`
/// - startingPosition: Starting position of the button. Default is `y: .top, x: .left`.
public init(style: EnvButtonStyle = .title("ENV"),
startingPosition: EnvButtonStartingPosition = .init(y: .top, x: .left)) {
self.style = style
self.startingPosition = startingPosition
}
}