25
25
26
26
#import < UIKit/UIKit.h>
27
27
28
+ // thanks to http://stackoverflow.com/a/8594878/742176
29
+
30
+ #if TARGET_OS_IPHONE && defined(__IPHONE_5_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_5_0) && __clang__ && (__clang_major__ >= 3)
31
+ #define II_SDK_SUPPORTS_WEAK 1
32
+ #elif TARGET_OS_MAC && defined(__MAC_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7) && __clang__ && (__clang_major__ >= 3)
33
+ #define II_SDK_SUPPORTS_WEAK 1
34
+ #else
35
+ #define II_SDK_SUPPORTS_WEAK 0
36
+ #endif
37
+
38
+ #if II_SDK_SUPPORTS_WEAK
39
+ #define __ii_weak __weak
40
+ #define ii_weak_property weak
41
+ #else
42
+ #if __clang__ && (__clang_major__ >= 3)
43
+ #define __ii_weak __unsafe_unretained
44
+ #else
45
+ #define __ii_weak
46
+ #endif
47
+ #define ii_weak_property assign
48
+ #endif
49
+
50
+
28
51
@protocol IIViewDeckControllerDelegate;
29
52
30
53
enum {
@@ -105,7 +128,7 @@ extern IIViewDeckOffsetOrientation IIViewDeckOffsetOrientationFromIIViewDeckSide
105
128
typedef void (^IIViewDeckControllerBlock) (IIViewDeckController *controller, BOOL success);
106
129
typedef void (^IIViewDeckControllerBounceBlock) (IIViewDeckController *controller);
107
130
108
- @property (nonatomic , assign ) id <IIViewDeckControllerDelegate> delegate;
131
+ @property (nonatomic , ii_weak_property) __ii_weak id <IIViewDeckControllerDelegate> delegate;
109
132
@property (nonatomic , assign ) IIViewDeckDelegateMode delegateMode;
110
133
111
134
@property (nonatomic , readonly , retain ) NSArray * controllers;
@@ -117,7 +140,7 @@ typedef void (^IIViewDeckControllerBounceBlock) (IIViewDeckController *controlle
117
140
@property (nonatomic , readonly , assign ) UIViewController* slidingController;
118
141
119
142
@property (nonatomic , retain ) UIView* panningView;
120
- @property (nonatomic , assign ) id <UIGestureRecognizerDelegate> panningGestureDelegate;
143
+ @property (nonatomic , ii_weak_property) __ii_weak id <UIGestureRecognizerDelegate> panningGestureDelegate;
121
144
@property (nonatomic , assign , getter =isEnabled) BOOL enabled;
122
145
@property (nonatomic , assign , getter =isElastic) BOOL elastic;
123
146
0 commit comments