Improve interoperability between CKRefreshControl and UIRefreshControl classes #9
Conversation
… +appearanceWhenContainedIn: - must be consistent with class reference for the refreshControl in the contained classes
…NSAttributedString since NSParagraphStyle is not used by CKRefreshControl's attributedTitle
Thanks to @0xced's method here: https://github.com/0xced/NSUUID/blob/1.0.1/NSUUID.m#L167-L221 |
…tween CKRefreshControl and UIRefreshControl
This looks awesome. I really wish I understood better what the inline asm is doing, but if @0xced says it works I'm inclined to believe him. Does this provide complete support for using |
I think we should recommend people use |
{ | ||
*UIRefreshControlClassRef = objc_allocateClassPair(self, "UIRefreshControl", 0); | ||
objc_registerClassPair(*UIRefreshControlClassRef); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For full compatibility, I think you should use objc_duplicateClass(self, "UIRefreshControl", 0);
instead of objc_allocateClassPair
+ objc_registerClassPair
since this will add an intermediate CKRefreshControl
class in the hierarchy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deliberately took this approach rather than objc_duplicateClass
so we can later test if UIRefreshControl
is a subclass of CKRefreshControl
. This was particularly useful with the +appearance
proxy.
I used objc_duplicateClass
for CKParagraphStyle
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no problem with that
Improve interoperability between CKRefreshControl and UIRefreshControl classes
CKRefreshControl
andUIRefreshControl
can now be used interchangeably throughout the app.Adds support for
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
in iOS5.