Skip to content

Loading…

Conditionally disable access to private UITouch ivars (fix broken build with iOS 6 SDK) #809

Merged
merged 1 commit into from

4 participants

@kemenaran

UITouch ivars have been removed of the iOS 6 SDK headers: private API access in UIViewAdditions breaks the build on iOS 6.

The flag to activate the UITouch extensions is now more strict, so that it is not enabled by default in debug builds, and require an explicit setting.

@kemenaran kemenaran Conditionally disable access to private UITouch ivars explicitly
UITouch ivars have been removed of the iOS 6 SDK headers: private API access in UIViewAdditions breaks the build on iOS 6.

The flag to activate the UITouch extensions is now more strict, so that it is not enabled by default in debug builds, and require an explicit setting.
f83cfd8
@diederich

Clean and straightforward. Thanks!

@diederich diederich merged commit dc2de88 into facebookarchive:development
@arthurva

Just add the following code to support ios6 sdk:

#ifdef __IPHONE_6_0
@interface UITouch () {
NSTimeInterval _timestamp;
UITouchPhase _phase;
UITouchPhase _savedPhase;
NSUInteger _tapCount;

UIWindow *_window;
UIView *_view;
UIView *_gestureView;
UIView *_warpedIntoView;
NSMutableArray *_gestureRecognizers;
NSMutableArray *_forwardingRecord;

CGPoint _locationInWindow;
CGPoint _previousLocationInWindow;
UInt8 _pathIndex;
UInt8 _pathIdentity;
float _pathMajorRadius;
struct {
    unsigned int _firstTouchForView:1;
    unsigned int _isTap:1;
    unsigned int _isDelayed:1;
    unsigned int _sentTouchesEnded:1;
    unsigned int _abandonForwardingRecord:1;
} _touchFlags;

}
@end
#endif

@fredstyles

Thanks arthurva.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 27, 2012
  1. @kemenaran

    Conditionally disable access to private UITouch ivars explicitly

    kemenaran committed
    UITouch ivars have been removed of the iOS 6 SDK headers: private API access in UIViewAdditions breaks the build on iOS 6.
    
    The flag to activate the UITouch extensions is now more strict, so that it is not enabled by default in debug builds, and require an explicit setting.
Showing with 4 additions and 3 deletions.
  1. +1 −1 src/Three20UI/Headers/UIViewAdditions.h
  2. +3 −2 src/Three20UI/Sources/UIViewAdditions.m
View
2 src/Three20UI/Headers/UIViewAdditions.h
@@ -138,7 +138,7 @@
/**
* WARNING: This depends on undocumented APIs and may be fragile. For testing only.
*/
-#ifdef DEBUG
+#ifdef DEBUG_TOUCHES
- (void)simulateTapAtPoint:(CGPoint)location;
#endif
View
5 src/Three20UI/Sources/UIViewAdditions.m
@@ -27,7 +27,7 @@
// Remove GSEvent and UITouchAdditions from Release builds
-#ifdef DEBUG
+#ifdef DEBUG_TOUCHES
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -423,7 +423,8 @@ - (void)removeAllSubviews {
}
-#ifdef DEBUG
+#ifdef DEBUG_TOUCHES
+
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)simulateTapAtPoint:(CGPoint)location {
Something went wrong with that request. Please try again.