Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can it be done with a uitextview? #7

Open
ghost opened this issue Aug 7, 2014 · 3 comments
Open

can it be done with a uitextview? #7

ghost opened this issue Aug 7, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 7, 2014

can it be done with a uitextview?

@NBibikov
Copy link

@johnsd have you found the answer? I also need work it with UITextView

@zipme
Copy link
Owner

zipme commented Jun 15, 2015

It's possible since the plugin is relying on attributeText property of UILabel which UITextView also has, I am thinking of rewriting this plugin in Swift 2.0, and by taking advantage of extension/protocol we can avoid lots of code duplication.

In the meantime, you can just copy RQShineLabel.h/m and change the subclass UILabel to UITextView, (perhaps also change ShineLabel to ShineTextView 😉) Things should just work.

@NBibikov
Copy link

Thanks! I done it with change sublacss to UITextView and add some property for mutableAttributedString(because without it i cann't change font family, font size and alignment in my controller)

[mutableAttributedString addAttribute:NSFontAttributeName
                                value:self.typeSizeFont
                                range:NSMakeRange(0, mutableAttributedString.length)];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
paragraphStyle.alignment = NSTextAlignmentCenter;
[mutableAttributedString addAttribute:NSParagraphStyleAttributeName
                       value:paragraphStyle
                       range:NSMakeRange(0, mutableAttributedString.length)];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants