diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..248e8f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# +# Pods/ + +# Editor residue +*~ diff --git a/AROverlayExample.xcodeproj/project.pbxproj b/AROverlayExample.xcodeproj/project.pbxproj index da1b7b9..474d3d9 100644 --- a/AROverlayExample.xcodeproj/project.pbxproj +++ b/AROverlayExample.xcodeproj/project.pbxproj @@ -165,11 +165,20 @@ /* Begin PBXProject section */ 96C334EB1353F36900AD25CA /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + TargetAttributes = { + 96C334F31353F36900AD25CA = { + DevelopmentTeam = 42X34WDLP5; + }; + }; + }; buildConfigurationList = 96C334EE1353F36900AD25CA /* Build configuration list for PBXProject "AROverlayExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = 96C334E91353F36900AD25CA; @@ -242,16 +251,42 @@ 96C335131353F36900AD25CA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; @@ -259,13 +294,37 @@ 96C335141353F36900AD25CA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_NO_COMMON_BLOCKS = YES; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; }; @@ -275,12 +334,17 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = AROverlayExample/Prefix.pch; INFOPLIST_FILE = AROverlayExample/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = com.bitcatapult.aroverlayexample; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; TARGETED_DEVICE_FAMILY = 1; WRAPPER_EXTENSION = app; }; @@ -290,11 +354,16 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = AROverlayExample/Prefix.pch; INFOPLIST_FILE = AROverlayExample/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = com.bitcatapult.aroverlayexample; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; TARGETED_DEVICE_FAMILY = 1; VALIDATE_PRODUCT = YES; WRAPPER_EXTENSION = app; diff --git a/AROverlayExample/Classes/AROverlayViewController.h b/AROverlayExample/Classes/AROverlayViewController.h index e46126c..f905bd9 100644 --- a/AROverlayExample/Classes/AROverlayViewController.h +++ b/AROverlayExample/Classes/AROverlayViewController.h @@ -5,7 +5,7 @@ } -@property (retain) CaptureSessionManager *captureManager; -@property (nonatomic, retain) UILabel *scanningLabel; +@property (strong) CaptureSessionManager *captureManager; +@property (nonatomic, strong) UILabel *scanningLabel; @end diff --git a/AROverlayExample/Classes/AROverlayViewController.m b/AROverlayExample/Classes/AROverlayViewController.m index 3ed091f..04937fc 100644 --- a/AROverlayExample/Classes/AROverlayViewController.m +++ b/AROverlayExample/Classes/AROverlayViewController.m @@ -7,7 +7,7 @@ @implementation AROverlayViewController - (void)viewDidLoad { - [self setCaptureManager:[[[CaptureSessionManager alloc] init] autorelease]]; + [self setCaptureManager:[[CaptureSessionManager alloc] init]]; [[self captureManager] addVideoInput]; @@ -18,26 +18,24 @@ - (void)viewDidLoad { CGRectGetMidY(layerRect))]; [[[self view] layer] addSublayer:[[self captureManager] previewLayer]]; - UIImageView *overlayImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"overlaygraphic.png"]]; - [overlayImageView setFrame:CGRectMake(30, 100, 260, 200)]; - [[self view] addSubview:overlayImageView]; - [overlayImageView release]; - - UIButton *overlayButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [overlayButton setImage:[UIImage imageNamed:@"scanbutton.png"] forState:UIControlStateNormal]; - [overlayButton setFrame:CGRectMake(130, 320, 60, 30)]; - [overlayButton addTarget:self action:@selector(scanButtonPressed) forControlEvents:UIControlEventTouchUpInside]; - [[self view] addSubview:overlayButton]; - - UILabel *tempLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 50, 120, 30)]; - [self setScanningLabel:tempLabel]; - [tempLabel release]; - [scanningLabel setBackgroundColor:[UIColor clearColor]]; + UIImageView *overlayImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"overlaygraphic.png"]]; + [overlayImageView setFrame:CGRectMake(30, 100, 260, 200)]; + [[self view] addSubview:overlayImageView]; + + UIButton *overlayButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [overlayButton setImage:[UIImage imageNamed:@"scanbutton.png"] forState:UIControlStateNormal]; + [overlayButton setFrame:CGRectMake(130, 320, 60, 30)]; + [overlayButton addTarget:self action:@selector(scanButtonPressed) forControlEvents:UIControlEventTouchUpInside]; + [[self view] addSubview:overlayButton]; + + UILabel *tempLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 50, 120, 30)]; + [self setScanningLabel:tempLabel]; + [scanningLabel setBackgroundColor:[UIColor clearColor]]; [scanningLabel setFont:[UIFont fontWithName:@"Courier" size: 18.0]]; [scanningLabel setTextColor:[UIColor redColor]]; [scanningLabel setText:@"Scanning..."]; - [scanningLabel setHidden:YES]; - [[self view] addSubview:scanningLabel]; + [scanningLabel setHidden:YES]; + [[self view] addSubview:scanningLabel]; [[captureManager captureSession] startRunning]; } @@ -52,14 +50,9 @@ - (void)hideLabel:(UILabel *)label { } - (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; + [super didReceiveMemoryWarning]; } -- (void)dealloc { - [captureManager release], captureManager = nil; - [scanningLabel release], scanningLabel = nil; - [super dealloc]; -} @end diff --git a/AROverlayExample/Classes/AppDelegate.h b/AROverlayExample/Classes/AppDelegate.h index ef1a5f9..3233f73 100644 --- a/AROverlayExample/Classes/AppDelegate.h +++ b/AROverlayExample/Classes/AppDelegate.h @@ -6,7 +6,7 @@ } -@property (nonatomic, retain) IBOutlet UIWindow *window; -@property (nonatomic, retain) IBOutlet AROverlayViewController *viewController; +@property (nonatomic, strong) IBOutlet UIWindow *window; +@property (nonatomic, strong) IBOutlet AROverlayViewController *viewController; @end diff --git a/AROverlayExample/Classes/AppDelegate.m b/AROverlayExample/Classes/AppDelegate.m index f56450c..946fd54 100644 --- a/AROverlayExample/Classes/AppDelegate.m +++ b/AROverlayExample/Classes/AppDelegate.m @@ -23,11 +23,5 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( return YES; } -- (void)dealloc -{ - [window release], window = nil; - [viewController release], viewController = nil; - [super dealloc]; -} @end diff --git a/AROverlayExample/Classes/CaptureSessionManager.h b/AROverlayExample/Classes/CaptureSessionManager.h index f3480ec..f182d48 100644 --- a/AROverlayExample/Classes/CaptureSessionManager.h +++ b/AROverlayExample/Classes/CaptureSessionManager.h @@ -6,8 +6,8 @@ } -@property (retain) AVCaptureVideoPreviewLayer *previewLayer; -@property (retain) AVCaptureSession *captureSession; +@property (strong) AVCaptureVideoPreviewLayer *previewLayer; +@property (strong) AVCaptureSession *captureSession; - (void)addVideoPreviewLayer; - (void)addVideoInput; diff --git a/AROverlayExample/Classes/CaptureSessionManager.m b/AROverlayExample/Classes/CaptureSessionManager.m index 01cfc67..54226f5 100644 --- a/AROverlayExample/Classes/CaptureSessionManager.m +++ b/AROverlayExample/Classes/CaptureSessionManager.m @@ -16,7 +16,7 @@ - (id)init { } - (void)addVideoPreviewLayer { - [self setPreviewLayer:[[[AVCaptureVideoPreviewLayer alloc] initWithSession:[self captureSession]] autorelease]]; + [self setPreviewLayer:[[AVCaptureVideoPreviewLayer alloc] initWithSession:[self captureSession]]]; [[self previewLayer] setVideoGravity:AVLayerVideoGravityResizeAspectFill]; } @@ -43,10 +43,7 @@ - (void)dealloc { [[self captureSession] stopRunning]; - [previewLayer release], previewLayer = nil; - [captureSession release], captureSession = nil; - [super dealloc]; } @end diff --git a/AROverlayExample/Info.plist b/AROverlayExample/Info.plist index 5e4d05f..9b07f88 100644 --- a/AROverlayExample/Info.plist +++ b/AROverlayExample/Info.plist @@ -11,7 +11,7 @@ CFBundleIconFile CFBundleIdentifier - com.bitcatapult.aroverlayexample + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -28,13 +28,15 @@ NSMainNibFile MainWindow + UIStatusBarHidden + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - UIStatusBarHidden - + NSCameraUsageDescription + "Camera required for demo to work." diff --git a/AROverlayExample/en.lproj/AROverlayViewController.xib b/AROverlayExample/en.lproj/AROverlayViewController.xib index 9a77265..d3c6b35 100644 --- a/AROverlayExample/en.lproj/AROverlayViewController.xib +++ b/AROverlayExample/en.lproj/AROverlayViewController.xib @@ -1,150 +1,26 @@ - - - 1056 - 10J567 - 1305 - 1038.35 - 462.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 300 - - - YES - IBProxyObject - IBUIView - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {320, 480} - - - - - 3 - MC43NQA - - 2 - - - NO - IBCocoaTouchFramework - - - - - YES - - - view - - - - 7 - - - - - YES - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 6 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 6.IBEditorWindowLastContentRect - 6.IBPluginDependency - - - YES - AROverlayViewController - UIResponder - {{239, 654}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 7 - - - - YES - - AROverlayViewController - UIViewController - - IBProjectSource - ./Classes/AROverlayViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 300 - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AROverlayExample/en.lproj/MainWindow.xib b/AROverlayExample/en.lproj/MainWindow.xib index 97da621..cbe5b0f 100644 --- a/AROverlayExample/en.lproj/MainWindow.xib +++ b/AROverlayExample/en.lproj/MainWindow.xib @@ -1,245 +1,36 @@ - - - 1024 - 10J567 - 1305 - 1038.35 - 462.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 300 - - - YES - IBUICustomObject - IBUIWindow - IBUIViewController - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - - AROverlayViewController - - 1 - 1 - - IBCocoaTouchFramework - NO - - - - 292 - {320, 480} - - - - - 1 - MSAxIDEAA - - NO - NO - IBCocoaTouchFramework - YES - - - - - YES - - - delegate - - - - 19 - - - - viewController - - - - 20 - - - - window - - - - 21 - - - - - YES - - 0 - - - - - - -1 - - - File's Owner - - - 3 - - - App Delegate - - - -2 - - - - - 10 - - - AR Overlay View Controller - - - 12 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 10.CustomClassName - 10.IBEditorWindowLastContentRect - 10.IBPluginDependency - 12.IBEditorWindowLastContentRect - 12.IBPluginDependency - 3.CustomClassName - 3.IBPluginDependency - - - YES - UIApplication - UIResponder - AROverlayViewController - {{234, 376}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{525, 346}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - AppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 21 - - - - YES - - AROverlayViewController - UIViewController - - IBProjectSource - ./Classes/AROverlayViewController.h - - - - AppDelegate - NSObject - - YES - - YES - viewController - window - - - YES - AROverlayViewController - UIWindow - - - - YES - - YES - viewController - window - - - YES - - viewController - AROverlayViewController - - - window - UIWindow - - - - - IBProjectSource - ./Classes/AppDelegate.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 300 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AROverlayExample/main.m b/AROverlayExample/main.m index 1ad7e5b..c4d122a 100644 --- a/AROverlayExample/main.m +++ b/AROverlayExample/main.m @@ -10,8 +10,8 @@ int main(int argc, char *argv[]) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, nil); - [pool release]; - return retVal; + @autoreleasepool { + int retVal = UIApplicationMain(argc, argv, nil, nil); + return retVal; + } }