- (UIView *)hitTest:withEvent: { if/* pointInside:withEvent:, eg. point is in our bounds */ { for/* each subview, in reverse order (eg. from top to bottom) */ { hitView = /* recursive call hitTest:withEvent: on subview */ if (hitView != nil) return hitView; } returnself; } returnnil; }
There are two types of size classes in iOS 8: regular and compact. A regular size class denotes either a large amount of screen space, such as on an iPad, or a commonly adopted paradigm that provides the illusion of a large amount of screen space, such as scrolling on an iPhone.
With the amount of screen space available, the iPad has a regular size class in the vertical and horizontal directions in both portrait and landscape orientations.
The size classes for iPhones differ based on the kind of device and its orientation. In portrait, the screen has a compact size class horizontally and a regular size class vertically. This corresponds to the common usage paradigm of scrolling vertically for more information. When iPhones are in landscape, their size classes vary. Most iPhones have a compact size class both horizontally and vertically
structobjc_class { Class isa OBJC_ISA_AVAILABILITY; #if !__OBJC2__ Class super_class OBJC2_UNAVAILABLE; constchar *name OBJC2_UNAVAILABLE; long version OBJC2_UNAVAILABLE; long info OBJC2_UNAVAILABLE; long instance_size OBJC2_UNAVAILABLE; structobjc_ivar_list *ivarsOBJC2_UNAVAILABLE; structobjc_method_list **methodListsOBJC2_UNAVAILABLE; structobjc_cache *cacheOBJC2_UNAVAILABLE; structobjc_protocol_list *protocolsOBJC2_UNAVAILABLE; #endif } OBJC2_UNAVAILABLE;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
structobjc_ivar_list { int ivar_count OBJC2_UNAVAILABLE; #ifdef __LP64__ int space OBJC2_UNAVAILABLE; #endif /* variable length structure */ structobjc_ivarivar_list[1] OBJC2_UNAVAILABLE; } structobjc_method_list { structobjc_method_list *obsoleteOBJC2_UNAVAILABLE;
int method_count OBJC2_UNAVAILABLE; #ifdef __LP64__ int space OBJC2_UNAVAILABLE; #endif /* variable length structure */ structobjc_methodmethod_list[1] OBJC2_UNAVAILABLE; }
Ivar
1
typedefstructobjc_ivar *Ivar;
1 2 3 4 5 6 7 8
structobjc_ivar { char *ivar_name OBJC2_UNAVAILABLE; char *ivar_type OBJC2_UNAVAILABLE; int ivar_offset OBJC2_UNAVAILABLE; #ifdef __LP64__ int space OBJC2_UNAVAILABLE; #endif }
- (BOOL)respondsToSelector:(SEL)aSelector { if ([super respondsToSelector:aSelector]) returnYES; else { /* Here, test whether the aSelector message can * * be forwarded to another object and whether that * * object can respond to it. Return YES if it can. */ } returnNO; }
父项目的Target Depedencies和Link Binary With Libraries中添加libSL.a
父项目的Other Linker Flags中添加-ObjC > -ObjC causes the linker to load every object file in the library that defines an Objective-C class or category. While this option will typically result in a larger executable (due to additional object code loaded into the application), it will allow the successful creation of effective Objective-C static libraries that contain categories on existing classes.
参见QA1490