//运行时,看有哪些成员变量
unsigned int count ;
Ivar *ivarList = class_copyIvarList([UIRefreshControl class], &count);
for (int i = 0; i<count; i++) {//便利所有的成员属性
Ivar ivar = ivarList[i];
NSLog(@"%s",ivar_getName(ivar));
}
free(ivarList);
注意:要导入头文件:#import <objc/message.h>
打印的结果
2016-10-28 11:00:17.862582 test[5765:941929] _style
2016-10-28 11:00:17.862614 test[5765:941929] _contentView
2016-10-28 11:00:17.862622 test[5765:941929] _scrollView
2016-10-28 11:00:17.862628 test[5765:941929] _refreshControlHeight
2016-10-28 11:00:17.862635 test[5765:941929] _visibleHeight
2016-10-28 11:00:17.862641 test[5765:941929] _snappingHeight
2016-10-28 11:00:17.862647 test[5765:941929] _additionalTopInset
2016-10-28 11:00:17.862656 test[5765:941929] _insetsApplied
2016-10-28 11:00:17.862662 test[5765:941929] _adjustingInsets
2016-10-28 11:00:17.862668 test[5765:941929] _automaticContentOffsetAdjustmentEnabledWhenLastIdle
2016-10-28 11:00:17.862674 test[5765:941929] _automaticContentOffsetAdjustmentEnabledNeedsReset
2016-10-28 11:00:17.862680 test[5765:941929] _appliedInsets
2016-10-28 11:00:17.862686 test[5765:941929] _refreshControlState