@@ -37,15 +37,16 @@ struct CENotification: Identifiable, Equatable {
37
37
isSticky: Bool = false ,
38
38
isRead: Bool = false
39
39
) {
40
- self . id = id
41
- self . icon = . symbol( name: iconSymbol, color: iconColor)
42
- self . title = title
43
- self . description = description
44
- self . actionButtonTitle = actionButtonTitle
45
- self . action = action
46
- self . isSticky = isSticky
47
- self . isRead = isRead
48
- self . timestamp = Date ( )
40
+ self . init (
41
+ id: id,
42
+ icon: . symbol( name: iconSymbol, color: iconColor) ,
43
+ title: title,
44
+ description: description,
45
+ actionButtonTitle: actionButtonTitle,
46
+ action: action,
47
+ isSticky: isSticky,
48
+ isRead: isRead
49
+ )
49
50
}
50
51
51
52
init (
@@ -60,15 +61,16 @@ struct CENotification: Identifiable, Equatable {
60
61
isSticky: Bool = false ,
61
62
isRead: Bool = false
62
63
) {
63
- self . id = id
64
- self . icon = . text( iconText, backgroundColor: iconColor, textColor: iconTextColor)
65
- self . title = title
66
- self . description = description
67
- self . actionButtonTitle = actionButtonTitle
68
- self . action = action
69
- self . isSticky = isSticky
70
- self . isRead = isRead
71
- self . timestamp = Date ( )
64
+ self . init (
65
+ id: id,
66
+ icon: . text( iconText, backgroundColor: iconColor, textColor: iconTextColor) ,
67
+ title: title,
68
+ description: description,
69
+ actionButtonTitle: actionButtonTitle,
70
+ action: action,
71
+ isSticky: isSticky,
72
+ isRead: isRead
73
+ )
72
74
}
73
75
74
76
init (
@@ -80,9 +82,31 @@ struct CENotification: Identifiable, Equatable {
80
82
action: @escaping ( ) -> Void ,
81
83
isSticky: Bool = false ,
82
84
isRead: Bool = false
85
+ ) {
86
+ self . init (
87
+ id: id,
88
+ icon: . image( iconImage) ,
89
+ title: title,
90
+ description: description,
91
+ actionButtonTitle: actionButtonTitle,
92
+ action: action,
93
+ isSticky: isSticky,
94
+ isRead: isRead
95
+ )
96
+ }
97
+
98
+ private init (
99
+ id: UUID ,
100
+ icon: IconType ,
101
+ title: String ,
102
+ description: String ,
103
+ actionButtonTitle: String ,
104
+ action: @escaping ( ) -> Void ,
105
+ isSticky: Bool ,
106
+ isRead: Bool
83
107
) {
84
108
self . id = id
85
- self . icon = . image ( iconImage )
109
+ self . icon = icon
86
110
self . title = title
87
111
self . description = description
88
112
self . actionButtonTitle = actionButtonTitle
0 commit comments