Skip to content

Commit

Permalink
Card part title description view attributed (#142)
Browse files Browse the repository at this point in the history
* Add left and right title attributed texts

* Bump podspec to 2.10.0
  • Loading branch information
croossin authored Apr 25, 2019
1 parent 72a695a commit bd9d6d1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CardParts.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -389,11 +401,23 @@ extension Reactive where Base: CardPartTitleDescriptionView {
}
}

public var leftTitleAttributedText: Binder<NSAttributedString?>{
return Binder(self.base) { (titleDescriptionView, leftTitleAttributedText) -> () in
titleDescriptionView.leftTitleAttributedText = leftTitleAttributedText
}
}

public var rightDescriptionAttributedText: Binder<NSAttributedString?>{
return Binder(self.base) { (titleDescriptionView, rightDescriptionAttributedText) -> () in
titleDescriptionView.rightDescriptionAttributedText = rightDescriptionAttributedText
}
}

public var rightTitleAttributedText: Binder<NSAttributedString?>{
return Binder(self.base) { (titleDescriptionView, rightTitleAttributedText) -> () in
titleDescriptionView.rightTitleAttributedText = rightTitleAttributedText
}
}

public var rightTitleText: Binder<String?>{
return Binder(self.base) { (titleDescriptionView, rightTitleText) -> () in
Expand Down

0 comments on commit bd9d6d1

Please sign in to comment.