You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.
if ([UIView resolveClassMethod:@selector(animateWithDuration:animations:)])
This is wrong, because resolveClassMethod: is used to ask the class to dynamically add a class method to the class that wasn't already in the class. However, animateWithDuration:animations: is a regular class method that is always loaded in the class. Since it's already loaded, resolveClassMethod: will return NO, and the code under it is always skipped.
In reality, what it looks like you wanted to do was check whether the class has this method. To do that, you should instead do:
if ([UIView respondsToSelector:@selector(animateWithDuration:animations:)])
(or, for the method that's actually being used in the code after,
if ([UIView respondsToSelector:@selector(animateWithDuration:delay:options:animations:completion:)])
)
The text was updated successfully, but these errors were encountered:
Agree. Not entirely sure what I was thinking when I wrote that. I would actually go further and state that the entire if can be removed and the code can just use block based animations only. The entire point of that section was to support pre iOS 4.0 devices which is no longer necessary.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In HPGrowingTextView.m, line 292, it says:
This is wrong, because
resolveClassMethod:
is used to ask the class to dynamically add a class method to the class that wasn't already in the class. However,animateWithDuration:animations:
is a regular class method that is always loaded in the class. Since it's already loaded,resolveClassMethod:
will return NO, and the code under it is always skipped.In reality, what it looks like you wanted to do was check whether the class has this method. To do that, you should instead do:
(or, for the method that's actually being used in the code after,
)
The text was updated successfully, but these errors were encountered: