Skip to content

Commit c8cc8b6

Browse files
authored
Update CloseConfig.swift
1 parent 9f6424f commit c8cc8b6

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

Sources/CloseButton/CloseConfig.swift

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
import UIKit
2-
import Foundation
2+
3+
public enum tintColor {
4+
case color(_ color: UIColor)
5+
case theme(light: UIColor, dark: UIColor, any: UIColor)
6+
}
7+
8+
public enum backColor {
9+
case color(_ color: UIColor)
10+
case theme(light: UIColor, dark: UIColor, any: UIColor)
11+
}
312

413
public struct CloseConfig {
514

615
// Title
7-
public var title: String?
16+
public var title: String!
817

918
// Action when tap CloseButton
1019
public var action: (() -> Void)?
1120

1221
// Background color
13-
public var backColor: UIColor!
22+
public var backColor: backColor!
1423

1524
// Text color
16-
public var tintColor: UIColor!
25+
public var tintColor: tintColor!
1726

18-
public init(title: String?, backColor: UIColor?, tintColor: UIColor?, action: (() -> Void)? = nil) {
27+
public init(title: String = "Close",
28+
backColor: backColor = .color(.black), tintColor: tintColor = .color(.white),
29+
action: (() -> Void)? = nil) {
1930
self.title = title
2031
self.action = action
2132
self.backColor = backColor

0 commit comments

Comments
 (0)