@@ -58,6 +58,7 @@ public class IterableEmbeddedView:UIView {
58
58
didSet {
59
59
if let title = embeddedMessageTitle {
60
60
labelTitle. text = title
61
+ labelTitle. font = UIFont . boldSystemFont ( ofSize: 16.0 )
61
62
labelTitle. isHidden = false
62
63
} else {
63
64
labelTitle. isHidden = true
@@ -72,6 +73,7 @@ public class IterableEmbeddedView:UIView {
72
73
didSet {
73
74
if let body = embeddedMessageBody {
74
75
labelDescription. text = body
76
+ labelDescription. font = UIFont . systemFont ( ofSize: 14.0 )
75
77
labelDescription. isHidden = false
76
78
} else {
77
79
labelDescription. isHidden = true
@@ -106,91 +108,81 @@ public class IterableEmbeddedView:UIView {
106
108
/// Associated Embedded Message
107
109
public var message : IterableEmbeddedMessage ? = nil
108
110
109
- // // MARK: OOTB View IBInspectables
110
- // /// OOTB View Background Color
111
- public var bannerBackgroundColor : UIColor = UIColor . white
112
- // @IBInspectable public var bannerBackgroundColor: UIColor? = UIColor.white {
113
- // didSet {
114
- // self.backgroundColor = UIColor.clear
115
- // self.innerContentView.backgroundColor = backgroundColor!
116
- // }
117
- // }
118
- //
119
- // /// Banner Border Color
120
- public var bannerBorderColor : UIColor = UIColor . clear
121
- // @IBInspectable public var bannerBorderColor: UIColor = UIColor.clear {
122
- // didSet {
123
- // self.layer.borderColor = bannerBorderColor.cgColor
124
- // }
125
- // }
126
- //
127
- // /// Banner Border Width
128
- public var bannerBorderWidth : CGFloat = 1.0
129
- // @IBInspectable public var bannerBorderWidth: CGFloat = 1.0 {
130
- // didSet {
131
- // self.layer.borderWidth = bannerBorderWidth
132
- // }
133
- // }
134
- //
135
- // /// Banner Corner Radius
136
- public var bannerCornerRadius : CGFloat = 8.0
137
- // @IBInspectable public var bannerCornerRadius: CGFloat = 8.0 {
138
- // didSet {
139
- // self.layer.cornerRadius = bannerCornerRadius
140
- // contentView.layer.cornerRadius = bannerCornerRadius
141
- // innerContentView.layer.cornerRadius = bannerCornerRadius
142
- // }
143
- // }
144
- //
145
- // // MARK: Primary Button
146
- // /// Primary button background color.
147
- public var primaryBtnColor : UIColor = UIColor . purple
148
- // @IBInspectable public var primaryBtnColor: UIColor = UIColor.purple {
149
- // didSet {
150
- // primaryBtn.backgroundColor = primaryBtnColor
151
- // }
152
- // }
153
- //
154
- // /// Primary button text color.
155
- public var primaryBtnTextColor : UIColor = UIColor . white
156
- // @IBInspectable public var primaryBtnTextColor: UIColor = UIColor.white {
157
- // didSet {
158
- // primaryBtn.titleColor = primaryBtnTextColor
159
- // }
160
- // }
161
- //
162
- // // MARK: Second Button
163
- // /// Secondary button background color.
164
- public var secondaryBtnColor : UIColor = UIColor . clear
165
- // @IBInspectable public var secondaryBtnColor: UIColor = UIColor.clear {
166
- // didSet {
167
- // secondaryBtn.backgroundColor = secondaryBtnColor
168
- // }
169
- // }
170
- //
171
- // /// Secondary button text color.
172
- public var secondaryBtnTextColor : UIColor = UIColor . black
173
- // @IBInspectable public var secondaryBtnTextColor: UIColor = UIColor.black {
174
- // didSet {
175
- // secondaryBtn.titleColor = secondaryBtnTextColor
176
- // }
177
- // }
178
- //
179
- // /// Title Text Color
180
- public var titleTextColor : UIColor = UIColor . black
181
- // @IBInspectable public var titleTextColor: UIColor = UIColor.black {
182
- // didSet {
183
- // labelTitle.textColor = titleTextColor
184
- // }
185
- // }
186
- //
187
- // /// Description Text Color
188
- public var bodyTextColor : UIColor = UIColor . darkGray
189
- // @IBInspectable public var bodyTextColor: UIColor = UIColor.darkGray {
190
- // didSet {
191
- // labelDescription.textColor = bodyTextColor
192
- // }
193
- // }
111
+ // MARK: OOTB View IBInspectables
112
+ /// OOTB View Background Color
113
+ public var ootbViewBackgroundColor : UIColor = UIColor . white {
114
+ didSet {
115
+ self . backgroundColor = UIColor . clear
116
+ self . innerContentView. backgroundColor = ootbViewBackgroundColor
117
+ }
118
+ }
119
+
120
+ /// Banner Border Color
121
+ public var ootbViewBorderColor : UIColor = UIColor ( red: 0.88 , green: 0.87 , blue: 0.87 , alpha: 1.00 ) {
122
+ didSet {
123
+ self . layer. borderColor = ootbViewBorderColor. cgColor
124
+ }
125
+ }
126
+
127
+ /// Banner Border Width
128
+ public var ootbViewBorderWidth : CGFloat = 1.0 {
129
+ didSet {
130
+ self . layer. borderWidth = ootbViewBorderWidth
131
+ }
132
+ }
133
+
134
+ /// Banner Corner Radius
135
+ public var ootbViewCornerRadius : CGFloat = 8.0 {
136
+ didSet {
137
+ self . layer. cornerRadius = ootbViewCornerRadius
138
+ contentView. layer. cornerRadius = ootbViewCornerRadius
139
+ innerContentView. layer. cornerRadius = ootbViewCornerRadius
140
+ }
141
+ }
142
+
143
+ // MARK: Primary Button
144
+ /// Primary button background color.
145
+ public var primaryBtnColor : UIColor = UIColor . purple {
146
+ didSet {
147
+ primaryBtn. backgroundColor = primaryBtnColor
148
+ }
149
+ }
150
+
151
+ /// Primary button text color.
152
+ public var primaryBtnTextColor : UIColor = UIColor . white {
153
+ didSet {
154
+ primaryBtn. titleColor = primaryBtnTextColor
155
+ }
156
+ }
157
+
158
+ // MARK: Second Button
159
+ /// Secondary button background color.
160
+ public var secondaryBtnColor : UIColor = UIColor . clear {
161
+ didSet {
162
+ secondaryBtn. backgroundColor = secondaryBtnColor
163
+ }
164
+ }
165
+
166
+ /// Secondary button text color.
167
+ public var secondaryBtnTextColor : UIColor = UIColor . black {
168
+ didSet {
169
+ secondaryBtn. titleColor = secondaryBtnTextColor
170
+ }
171
+ }
172
+
173
+ /// Title Text Color
174
+ public var titleTextColor : UIColor = UIColor . black {
175
+ didSet {
176
+ labelTitle. textColor = titleTextColor
177
+ }
178
+ }
179
+
180
+ /// Description Text Color
181
+ public var bodyTextColor : UIColor = UIColor . darkGray {
182
+ didSet {
183
+ labelDescription. textColor = bodyTextColor
184
+ }
185
+ }
194
186
195
187
// MARK: IterableEmbeddedView init method
196
188
/// IterableEmbeddedView init method
@@ -209,7 +201,6 @@ public class IterableEmbeddedView:UIView {
209
201
self . contentView = self . loadViewFromNib ( )
210
202
self . contentView. translatesAutoresizingMaskIntoConstraints = false
211
203
self . innerContentView. clipsToBounds = true
212
- //self.setDefaultValue()
213
204
self . addSubview ( self . contentView)
214
205
215
206
NSLayoutConstraint . activate ( [
@@ -223,26 +214,10 @@ public class IterableEmbeddedView:UIView {
223
214
func loadViewFromNib( ) -> UIView ? {
224
215
let nib = UINib ( nibName: " IterableEmbeddedView " , bundle: Bundle . module)
225
216
let view = nib. instantiate ( withOwner: self , options: nil ) . first as? UIView
226
- //view?.backgroundColor = UIColor.clear
227
217
self . clipsToBounds = false
228
218
return view
229
219
}
230
220
231
- // MARK: Assign Default Value
232
- ///setDefaultValue assign default values to IterableEmbeddedView
233
- // func setDefaultValue() {
234
- // bannerBackgroundColor = UIColor.white
235
- // bannerBorderColor = UIColor(red: 0.88, green: 0.87, blue: 0.87, alpha: 1.00)
236
- // bannerBorderWidth = 1.0
237
- // bannerCornerRadius = 8.0
238
- // primaryBtnColor = UIColor.purple
239
- // primaryBtnTextColor = UIColor.white
240
- // secondaryBtnColor = UIColor.clear
241
- // secondaryBtnTextColor = UIColor.black
242
- // titleTextColor = UIColor.black
243
- // bodyTextColor = UIColor.darkGray
244
- // }
245
-
246
221
public func configure( message: IterableEmbeddedMessage , viewType: IterableEmbeddedViewType , config: IterableEmbeddedViewConfig ? ) {
247
222
248
223
self . message = message
@@ -280,10 +255,10 @@ public class IterableEmbeddedView:UIView {
280
255
let defaultTitleTextColor = ( cardOrBanner) ? cardTitleTextColor : notificationTextColor
281
256
let defaultBodyTextColor = ( cardOrBanner) ? cardBodyTextColor : notificationTextColor
282
257
283
- bannerBackgroundColor = config? . backgroundColor ?? defaultBackgroundColor
284
- bannerBorderColor = config? . borderColor ?? defaultBorderColor
285
- bannerBorderWidth = config? . borderWidth ?? 1.0
286
- bannerCornerRadius = config? . borderCornerRadius ?? 8.0
258
+ ootbViewBackgroundColor = config? . backgroundColor ?? defaultBackgroundColor
259
+ ootbViewBorderColor = config? . borderColor ?? defaultBorderColor
260
+ ootbViewBorderWidth = config? . borderWidth ?? 1.0
261
+ ootbViewCornerRadius = config? . borderCornerRadius ?? 8.0
287
262
primaryBtnColor = config? . primaryBtnBackgroundColor ?? defaultPrimaryBtnColor
288
263
primaryBtnTextColor = config? . primaryBtnTextColor ?? defaultPrimaryBtnTextColor
289
264
secondaryBtnColor = config? . secondaryBtnBackgroundColor ?? defaultSecondaryBtnColor
0 commit comments