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 tests and rename Label -> Nantes #1

Merged
merged 11 commits into from
Jan 22, 2019
Merged

Add tests and rename Label -> Nantes #1

merged 11 commits into from
Jan 22, 2019

Conversation

chansen22
Copy link
Contributor

Replace TTTAttributedLabel with NantesLabel.

@chansen22
Copy link
Contributor Author

image

Copy link

@min min left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excited for this!

Nantes/NantesLabel.swift Outdated Show resolved Hide resolved
Nantes/NantesLabel.swift Outdated Show resolved Hide resolved
context.scaleBy(x: 1.0, y: -1.0)

let textRange = CFRangeMake(0, attributedText.length)
let txtRect = textRect(forBounds: rect, limitedToNumberOfLines: numberOfLines)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] textRect instead of txtRect

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It collides with textRect(forBounds: :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed it to limitedRect

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could always do let textRect = self.textRect(... right?

Nantes/NantesLabel.swift Outdated Show resolved Hide resolved
Nantes/NantesLabel.swift Outdated Show resolved Hide resolved
Nantes/NantesLabel.swift Outdated Show resolved Hide resolved
Nantes/NantesLabel.swift Outdated Show resolved Hide resolved
Nantes/NantesLabel.swift Outdated Show resolved Hide resolved
@chansen22 chansen22 merged commit fb993f3 into master Jan 22, 2019
@chansen22 chansen22 deleted the add-tests branch January 22, 2019 16:12
chansen22 pushed a commit that referenced this pull request Feb 27, 2019
There was an issue where if you set some custom attributes before
setting attributedText on the label, it wouldn't keep those properties
in the attributedString. Now when you set lineSpacing, and then set
attributedText on the label, it'll pull the properties already setup and
append them to the attributedString you're putting in.
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

Successfully merging this pull request may close these issues.

None yet

3 participants