diff --git a/Pod/Classes/Segments/IconSegment.swift b/Pod/Classes/Segments/IconSegment.swift index 01286db..cb2a3b9 100644 --- a/Pod/Classes/Segments/IconSegment.swift +++ b/Pod/Classes/Segments/IconSegment.swift @@ -32,8 +32,9 @@ open class IconSegment: BetterSegmentedControlSegment { normalBackgroundColor: UIColor? = nil, normalIconTintColor: UIColor, selectedBackgroundColor: UIColor? = nil, - selectedIconTintColor: UIColor) { - self.icon = icon.withRenderingMode(.alwaysTemplate) + selectedIconTintColor: UIColor, + iconRenderingMode: UIImage.RenderingMode = .alwaysTemplate) { + self.icon = icon.withRenderingMode(iconRenderingMode) self.iconSize = iconSize self.normalBackgroundColor = normalBackgroundColor ?? DefaultValues.normalBackgroundColor self.normalIconTintColor = normalIconTintColor @@ -84,14 +85,16 @@ public extension IconSegment { normalBackgroundColor: UIColor? = nil, normalIconTintColor: UIColor, selectedBackgroundColor: UIColor? = nil, - selectedIconTintColor: UIColor) -> [BetterSegmentedControlSegment] { + selectedIconTintColor: UIColor, + iconRenderingMode: UIImage.RenderingMode = .alwaysTemplate) -> [BetterSegmentedControlSegment] { return icons.map { IconSegment(icon: $0, iconSize: iconSize, normalBackgroundColor: normalBackgroundColor, normalIconTintColor: normalIconTintColor, selectedBackgroundColor: selectedBackgroundColor, - selectedIconTintColor: selectedIconTintColor) + selectedIconTintColor: selectedIconTintColor, + iconRenderingMode: iconRenderingMode) } } }