diff --git a/TORoundedButton/TORoundedButton.h b/TORoundedButton/TORoundedButton.h index 17b20b2..a640f59 100644 --- a/TORoundedButton/TORoundedButton.h +++ b/TORoundedButton/TORoundedButton.h @@ -33,6 +33,10 @@ IB_DESIGNABLE @interface TORoundedButton : UIControl /** The text that is displayed in center of the button (Default is "Button") */ @property (nonatomic, copy) IBInspectable NSString *text; +/** The Attributed string used in the label of this button (Default is nil) */ +/** See UILabel `attributedText` property  documentation for full details. */ +@property (nonatomic, copy, nullable) NSAttributedString *attributedText; + /** The radius of the corners of this button (Default is 10.0f) */ @property (nonatomic, assign) IBInspectable CGFloat cornerRadius; diff --git a/TORoundedButton/TORoundedButton.m b/TORoundedButton/TORoundedButton.m index 5fde841..0caba11 100644 --- a/TORoundedButton/TORoundedButton.m +++ b/TORoundedButton/TORoundedButton.m @@ -429,6 +429,16 @@ - (void)setButtonScaledTappedAnimated:(BOOL)animated #pragma mark - Public Accessors - +- (void)setAttributedText:(NSAttributedString *)attributedText +{ + self.titleLabel.attributedText = attributedText; +} + +- (NSAttributedString *)attributedText +{ + return self.titleLabel.attributedText; +} + - (void)setText:(NSString *)text { self.titleLabel.text = text; diff --git a/TORoundedButtonExample/Base.lproj/Main.storyboard b/TORoundedButtonExample/Base.lproj/Main.storyboard index 3e0993f..52d91fd 100644 --- a/TORoundedButtonExample/Base.lproj/Main.storyboard +++ b/TORoundedButtonExample/Base.lproj/Main.storyboard @@ -28,6 +28,9 @@ + + +