Newer
Older
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import UIKit
public struct HUDModel {
var title: String?
var content: String?
var actionTitle: String?
var isDismissable: Bool
var animationColor: UIColor?
var onTapClosure: (() -> Void)?
public init(
title: String? = nil,
content: String? = nil,
actionTitle: String? = nil,
isDismissable: Bool = true,
animationColor: UIColor? = nil,
onTapClosure: (() -> Void)? = nil
) {
self.title = title
self.content = content
self.actionTitle = actionTitle
self.isDismissable = isDismissable
self.onTapClosure = onTapClosure
self.animationColor = animationColor
}
public init(
error: Error,
isDismissable: Bool = true
) {
self.isDismissable = isDismissable
self.title = Localized.Hud.Error.title
self.content = error.localizedDescription
self.actionTitle = Localized.Hud.Error.action
}
}
//public struct HUDError: Equatable {
// var title: String
// var content: String
// var buttonTitle: String
// var dismissable: Bool
//
// public init(
// content: String,
// title: String = Localized.Hud.Error.title,
// buttonTitle: String = Localized.Hud.Error.action,
// dismissable: Bool = true
// ) {
// self.title = title
// self.content = content
// self.buttonTitle = buttonTitle
// self.dismissable = dismissable
// }
//
// public init(with error: Error) {
// self.title = Localized.Hud.Error.title
// self.buttonTitle = Localized.Hud.Error.action
// self.content = error.localizedDescription
// self.dismissable = true
// }
//}