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

Fix warnings and a few other little things #18

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

douglashill
Copy link

We have a lot of warnings turned on. In this branch, I’ve fixed those warnings, and a few other things. The commit messages explain each change.

Casting to CGFloat is ugly, but correct.
The weak variable was accessed more than once.
In this case it’s not a problem anyway. Restructuring the code like this happens to not result in the warning.
The instance variable and parameter are equal, so we can simply use the parameter instead.
Easiest way without casting is to use the parameter, since its nullability is unspecified, and the parameter is equal to the instance variable.
This will work better if something subclasses CLTokenInputView and also wants shared initialisation, and happens to use the same selector.
It would normally be expects for this parameter to follow the same ownership rules as the property is relates to.
This avoid laying out the view more than once per runloop cycle.
The comparison will take slightly longer, but this will avoid some cases of updating the view unnecessarily.
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.

1 participant