From bd9d6d12c82671639575ff691c9550b9370eea27 Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 25 Apr 2019 14:14:08 -0700 Subject: [PATCH] Card part title description view attributed (#142) * Add left and right title attributed texts * Bump podspec to 2.10.0 --- CardParts.podspec | 2 +- .../CardPartTitleDescriptionView.swift | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CardParts.podspec b/CardParts.podspec index d7cb3194..e82f3309 100644 --- a/CardParts.podspec +++ b/CardParts.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'CardParts' - s.version = '2.9.0' + s.version = '2.10.0' s.platform = :ios s.summary = 'iOS Card UI framework.' diff --git a/CardParts/src/Classes/Card Parts/CardPartTitleDescriptionView.swift b/CardParts/src/Classes/Card Parts/CardPartTitleDescriptionView.swift index fa5c2335..4c6f74c7 100644 --- a/CardParts/src/Classes/Card Parts/CardPartTitleDescriptionView.swift +++ b/CardParts/src/Classes/Card Parts/CardPartTitleDescriptionView.swift @@ -51,6 +51,12 @@ public class CardPartTitleDescriptionView : UIView, CardPartView { leftDescriptionLabel.attributedText = leftDescriptionAttributedText } } + + public var leftTitleAttributedText: NSAttributedString? { + didSet { + leftTitleLabel.attributedText = leftTitleAttributedText + } + } public var rightTitleText: String? { didSet { @@ -69,6 +75,12 @@ public class CardPartTitleDescriptionView : UIView, CardPartView { rightDescriptionLabel.attributedText = rightDescriptionAttributedText } } + + public var rightTitleAttributedText: NSAttributedString? { + didSet { + rightTitleLabel.attributedText = rightTitleAttributedText + } + } public var leftTitleFont: UIFont = CardParts.theme.leftTitleFont { didSet { @@ -389,11 +401,23 @@ extension Reactive where Base: CardPartTitleDescriptionView { } } + public var leftTitleAttributedText: Binder{ + return Binder(self.base) { (titleDescriptionView, leftTitleAttributedText) -> () in + titleDescriptionView.leftTitleAttributedText = leftTitleAttributedText + } + } + public var rightDescriptionAttributedText: Binder{ return Binder(self.base) { (titleDescriptionView, rightDescriptionAttributedText) -> () in titleDescriptionView.rightDescriptionAttributedText = rightDescriptionAttributedText } } + + public var rightTitleAttributedText: Binder{ + return Binder(self.base) { (titleDescriptionView, rightTitleAttributedText) -> () in + titleDescriptionView.rightTitleAttributedText = rightTitleAttributedText + } + } public var rightTitleText: Binder{ return Binder(self.base) { (titleDescriptionView, rightTitleText) -> () in