Skip to content

Commit 8a5ede9

Browse files
erusso1BalestraPatrick
authored andcommitted
Add ability to set item image tint color.
• Allows for changing item image tint color (for use with template images) via itemImageTintColor property on WhatsNewViewController instance.
1 parent f5844d2 commit 8a5ede9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

WhatsNew.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'WhatsNew'
3-
s.version = '0.4.4'
3+
s.version = '0.4.5'
44
s.summary = 'Showcase new features after an app update similar to Pages, Numbers and Keynote.'
55

66
# This description is used to generate tags and improve search results.

WhatsNew/WhatsNewViewController.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ public class WhatsNewViewController: UIViewController {
3333
titleLabel?.font = titleFont
3434
}
3535
}
36+
/// Tint color of the feature item image, if one exists.
37+
public var itemImageTintColor: UIColor? = nil {
38+
didSet {
39+
setUp(with: items)
40+
}
41+
}
3642
/// Title color of the feature items.
3743
public var itemTitleColor: UIColor = .black {
3844
didSet {
@@ -139,6 +145,9 @@ public class WhatsNewViewController: UIViewController {
139145
switch item {
140146
case .image(let title, let subtitle, let image):
141147
let itemView = WhatsNewItemImageView.loadFromNib()
148+
if let imageTintColor = itemImageTintColor {
149+
itemView.imageView.tintColor = imageTintColor
150+
}
142151
itemView.set(image: image, title: title, subtitle: subtitle, titleColor: itemTitleColor, subtitleColor: itemSubtitleColor, titleFont: itemTitleFont, subtitleFont: itemSubtitleFont)
143152
view = itemView
144153
case .text(let title, let subtitle):

0 commit comments

Comments
 (0)