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

NSAttributedString range error #10

Open
NickMeepo opened this issue Dec 21, 2020 · 0 comments
Open

NSAttributedString range error #10

NickMeepo opened this issue Dec 21, 2020 · 0 comments

Comments

@NickMeepo
Copy link

NickMeepo commented Dec 21, 2020

We should use NSString.length instead of String.count when dealing with NSRange and NSAttributedString. NSRange(location: 0, length: (labelText as NSString).length) is preferred to NSRange(location: 0, length:labelText.count).
The error will occur when text is matching the suggestion "George😁Washington".

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

1 participant