Permalink
Browse files

Added a preprocessor check for NS_BLOCKS_AVAILABLE around anything th…

…at requires blocks.

FTUtils, only claims to support iOS 4+, but I'm adding the check in anyway because most of the library will work on iOS 3-.
  • Loading branch information...
1 parent a2c7ca2 commit 3e6d1f040fbcc63a0bb3204837e7a278bc561ea3 @neror committed Mar 8, 2011
@@ -22,6 +22,8 @@ of this software and associated documentation files (the "Software"), to deal
THE SOFTWARE.
*/
+#if NS_BLOCKS_AVAILABLE
+
#import "FTUtils+UIGestureRecognizer.h"
#import <objc/runtime.h>
@@ -61,3 +63,5 @@ - (void)setActionBlock:(FTUIGestureActionBlock)actionBlock {
}
@end
+
+#endif
@@ -35,6 +35,8 @@ - (void)viewDidLoad {
[self.performAnimationButton removeFromSuperview];
self.viewToAnimate.userInteractionEnabled = YES;
self.viewToAnimate.multipleTouchEnabled = YES;
+
+#if NS_BLOCKS_AVAILABLE
[self.viewToAnimate addGestureRecognizer:
[UIPanGestureRecognizer recognizerWithActionBlock:^(UIGestureRecognizer *recognizer) {
@@ -59,6 +61,8 @@ - (void)viewDidLoad {
}
};
[self.viewToAnimate addGestureRecognizer:thePinch];
+
+#endif
}
- (void)viewDidUnload {
@@ -620,6 +620,7 @@
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INSTALL_PATH = /usr/local/lib;
+ IPHONEOS_DEPLOYMENT_TARGET = 4.0;
OTHER_CFLAGS = "";
PRODUCT_NAME = FTUtils;
PROVISIONING_PROFILE = "";
@@ -683,7 +684,7 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
INFOPLIST_FILE = "UnitTests/UnitTests-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 4.0;
OTHER_LDFLAGS = (
"-framework",
SenTestingKit,
@@ -707,7 +708,7 @@
GCC_PREFIX_HEADER = "UnitTests/UnitTests-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvmgcc42;
INFOPLIST_FILE = "UnitTests/UnitTests-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 4.0;
OTHER_LDFLAGS = (
"-framework",
SenTestingKit,
@@ -22,6 +22,8 @@
THE SOFTWARE.
*/
+#if NS_BLOCKS_AVAILABLE
+
typedef void (^FTUIGestureActionBlock)(UIGestureRecognizer *recognizer);
@interface UIGestureRecognizer(FTBlockAdditions)
@@ -32,3 +34,5 @@ typedef void (^FTUIGestureActionBlock)(UIGestureRecognizer *recognizer);
@property (copy) FTUIGestureActionBlock actionBlock;
@end
+
+#endif

0 comments on commit 3e6d1f0

Please sign in to comment.