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

Add PastelLabel #11

Open
cruisediary opened this issue May 17, 2017 · 3 comments
Open

Add PastelLabel #11

cruisediary opened this issue May 17, 2017 · 3 comments

Comments

@cruisediary
Copy link
Owner

PastelLabel

desc

  • gradient animation label
  • UILabel + PastelView WrapperView using layer mask
@kgellci
Copy link
Contributor

kgellci commented May 22, 2017

I was going to tackle this issue but I ended up rewriting much of the framework to add some extra abilities I was looking for, (motion color shifting). Feel free to take a look at my implementation, specifically in the ShiftUI file. When I have more time, I will explore a solution which does not wrap a UIlabel in a UIView, as show in the ShiftImageView class implementation vs ShiftMaskableLabel implementation:

https://github.com/kgellci/Shift/blob/master/Shift/Classes/ShiftUI.swift

@cruisediary
Copy link
Owner Author

@kgellci nice job. looks good to me i give star too :)
I don't want to use wrapping methods but In the case of UIButton, it is itself wrapping label and imageView too

    // UIButton
    @available(iOS 3.0, *)
    open var titleLabel: UILabel? { get }

    @available(iOS 3.0, *)
    open var imageView: UIImageView? { get }

so I wrapped the UILabel once and tried to use the functionality of the UILabel like an adapter in #16

public protocol PastelLabelable {
    var text: String? { get set }
    var font: UIFont? { get set }
    var textAlignment: NSTextAlignment { get set }
    var attributedText: NSAttributedString? { get set }
}

If you find how to mask a UILabel without wrapping it, I would appreciate it if you would share it
I'm considering to solve this use CATextLayer or override drawTextInRect of UILabel too :)

I reopen Issue Masking PastelLabel without wrapping to solve it

Shift nice job :D thank you

@kgellci
Copy link
Contributor

kgellci commented May 24, 2017

I will try and take a look this weekend. There is a way to do it w/o wrapping but need to take care of different cases like updating text, font, etc.

cruisediary added a commit that referenced this issue Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants