Skip to content

Commit

Permalink
Add ability to set item image tint color.
Browse files Browse the repository at this point in the history
• Allows for changing item image tint color (for use with template images) via itemImageTintColor property on WhatsNewViewController instance.
  • Loading branch information
erusso1 authored and BalestraPatrick committed Mar 15, 2019
1 parent f5844d2 commit 8a5ede9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion WhatsNew.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'WhatsNew'
s.version = '0.4.4'
s.version = '0.4.5'
s.summary = 'Showcase new features after an app update similar to Pages, Numbers and Keynote.'

# This description is used to generate tags and improve search results.
Expand Down
9 changes: 9 additions & 0 deletions WhatsNew/WhatsNewViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public class WhatsNewViewController: UIViewController {
titleLabel?.font = titleFont
}
}
/// Tint color of the feature item image, if one exists.
public var itemImageTintColor: UIColor? = nil {
didSet {
setUp(with: items)
}
}
/// Title color of the feature items.
public var itemTitleColor: UIColor = .black {
didSet {
Expand Down Expand Up @@ -139,6 +145,9 @@ public class WhatsNewViewController: UIViewController {
switch item {
case .image(let title, let subtitle, let image):
let itemView = WhatsNewItemImageView.loadFromNib()
if let imageTintColor = itemImageTintColor {
itemView.imageView.tintColor = imageTintColor
}
itemView.set(image: image, title: title, subtitle: subtitle, titleColor: itemTitleColor, subtitleColor: itemSubtitleColor, titleFont: itemTitleFont, subtitleFont: itemSubtitleFont)
view = itemView
case .text(let title, let subtitle):
Expand Down

0 comments on commit 8a5ede9

Please sign in to comment.