diff --git a/MapProj.xcodeproj/project.pbxproj b/MapProj.xcodeproj/project.pbxproj index cf213e5..d966d18 100644 --- a/MapProj.xcodeproj/project.pbxproj +++ b/MapProj.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 15BCB8B26ECD52FEB0233AFE /* Pods_MapProj.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57A22C3A8A42092E2740ED24 /* Pods_MapProj.framework */; }; + 1739BB8C1D3C538200855F2B /* RegionMonitoring.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1739BB8B1D3C538200855F2B /* RegionMonitoring.swift */; }; 1B6365AC1D344DF900472F64 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B6365AB1D344DF900472F64 /* AppDelegate.swift */; }; 1B6365AE1D344DF900472F64 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B6365AD1D344DF900472F64 /* ViewController.swift */; }; 1B6365B11D344DF900472F64 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1B6365AF1D344DF900472F64 /* Main.storyboard */; }; @@ -18,6 +20,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 0611E19F1AECEF93C6170E8C /* Pods-MapProj.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MapProj.release.xcconfig"; path = "Pods/Target Support Files/Pods-MapProj/Pods-MapProj.release.xcconfig"; sourceTree = ""; }; + 1739BB8B1D3C538200855F2B /* RegionMonitoring.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegionMonitoring.swift; sourceTree = ""; }; 1B6365A81D344DF900472F64 /* MapProj.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MapProj.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1B6365AB1D344DF900472F64 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 1B6365AD1D344DF900472F64 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -28,6 +32,8 @@ 1B6365BD1D34531900472F64 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 1B6365BF1D345D5000472F64 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; 1BADFADC1D358A53001482DE /* CustomPointAnnotation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CustomPointAnnotation.swift; path = ../CustomPointAnnotation.swift; sourceTree = ""; }; + 57A22C3A8A42092E2740ED24 /* Pods_MapProj.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MapProj.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + AA3945AF81932BE903040910 /* Pods-MapProj.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MapProj.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MapProj/Pods-MapProj.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -37,6 +43,7 @@ files = ( 1B6365C01D345D5000472F64 /* MapKit.framework in Frameworks */, 1B6365BE1D34531900472F64 /* CoreLocation.framework in Frameworks */, + 15BCB8B26ECD52FEB0233AFE /* Pods_MapProj.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -50,6 +57,8 @@ 1B6365BD1D34531900472F64 /* CoreLocation.framework */, 1B6365AA1D344DF900472F64 /* MapProj */, 1B6365A91D344DF900472F64 /* Products */, + AE1EC74B787F11CF38ED837A /* Pods */, + 9090FF170B165648DCCF18C6 /* Frameworks */, ); sourceTree = ""; }; @@ -68,6 +77,7 @@ 1BADFADC1D358A53001482DE /* CustomPointAnnotation.swift */, 1B6365AD1D344DF900472F64 /* ViewController.swift */, 1B6365AF1D344DF900472F64 /* Main.storyboard */, + 1739BB8B1D3C538200855F2B /* RegionMonitoring.swift */, 1B6365B21D344DF900472F64 /* Assets.xcassets */, 1B6365B41D344DF900472F64 /* LaunchScreen.storyboard */, 1B6365B71D344DF900472F64 /* Info.plist */, @@ -75,6 +85,23 @@ path = MapProj; sourceTree = ""; }; + 9090FF170B165648DCCF18C6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 57A22C3A8A42092E2740ED24 /* Pods_MapProj.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + AE1EC74B787F11CF38ED837A /* Pods */ = { + isa = PBXGroup; + children = ( + AA3945AF81932BE903040910 /* Pods-MapProj.debug.xcconfig */, + 0611E19F1AECEF93C6170E8C /* Pods-MapProj.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -82,9 +109,12 @@ isa = PBXNativeTarget; buildConfigurationList = 1B6365BA1D344DF900472F64 /* Build configuration list for PBXNativeTarget "MapProj" */; buildPhases = ( + 2516CD68D98B5420E3A1EFF0 /* [CP] Check Pods Manifest.lock */, 1B6365A41D344DF900472F64 /* Sources */, 1B6365A51D344DF900472F64 /* Frameworks */, 1B6365A61D344DF900472F64 /* Resources */, + 543BFA5D3EAF28241E7B736C /* [CP] Embed Pods Frameworks */, + D8E8371573846674395F1275 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -107,6 +137,7 @@ TargetAttributes = { 1B6365A71D344DF900472F64 = { CreatedOnToolsVersion = 7.3.1; + DevelopmentTeam = 85826LGZGV; }; }; }; @@ -141,6 +172,54 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 2516CD68D98B5420E3A1EFF0 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 543BFA5D3EAF28241E7B736C /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + D8E8371573846674395F1275 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 1B6365A41D344DF900472F64 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -149,6 +228,7 @@ 1B6365AE1D344DF900472F64 /* ViewController.swift in Sources */, 1BADFADD1D358A53001482DE /* CustomPointAnnotation.swift in Sources */, 1B6365AC1D344DF900472F64 /* AppDelegate.swift in Sources */, + 1739BB8C1D3C538200855F2B /* RegionMonitoring.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -195,6 +275,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; + DEPLOYMENT_LOCATION = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -240,6 +321,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEPLOYMENT_LOCATION = NO; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -259,23 +341,33 @@ }; 1B6365BB1D344DF900472F64 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = AA3945AF81932BE903040910 /* Pods-MapProj.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; INFOPLIST_FILE = MapProj/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = FIS.MapProj; + PRODUCT_BUNDLE_IDENTIFIER = FIS4.MapProj; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; }; name = Debug; }; 1B6365BC1D344DF900472F64 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0611E19F1AECEF93C6170E8C /* Pods-MapProj.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; INFOPLIST_FILE = MapProj/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = FIS.MapProj; + PRODUCT_BUNDLE_IDENTIFIER = FIS4.MapProj; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; }; name = Release; }; diff --git a/MapProj.xcodeproj/project.xcworkspace/xcuserdata/Jordan.xcuserdatad/UserInterfaceState.xcuserstate b/MapProj.xcodeproj/project.xcworkspace/xcuserdata/Jordan.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..02b2d69 Binary files /dev/null and b/MapProj.xcodeproj/project.xcworkspace/xcuserdata/Jordan.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/MapProj.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/MapProj.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/MapProj.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/MapProj.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/MapProj.xcscheme b/MapProj.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/MapProj.xcscheme new file mode 100644 index 0000000..5f2ca5b --- /dev/null +++ b/MapProj.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/MapProj.xcscheme @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MapProj.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/xcschememanagement.plist b/MapProj.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..b8db5ff --- /dev/null +++ b/MapProj.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + MapProj.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 1B6365A71D344DF900472F64 + + primary + + + + + diff --git a/MapProj.xcworkspace/contents.xcworkspacedata b/MapProj.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..22b38f9 --- /dev/null +++ b/MapProj.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/MapProj.xcworkspace/xcuserdata/Jordan.xcuserdatad/UserInterfaceState.xcuserstate b/MapProj.xcworkspace/xcuserdata/Jordan.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..5a83722 Binary files /dev/null and b/MapProj.xcworkspace/xcuserdata/Jordan.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/MapProj.xcworkspace/xcuserdata/Jordan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/MapProj.xcworkspace/xcuserdata/Jordan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..ed9a9b4 --- /dev/null +++ b/MapProj.xcworkspace/xcuserdata/Jordan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/MapProj/AppDelegate.swift b/MapProj/AppDelegate.swift index 4b58cd9..c8b3f3a 100644 --- a/MapProj/AppDelegate.swift +++ b/MapProj/AppDelegate.swift @@ -1,4 +1,4 @@ -// + // AppDelegate.swift // MapProj // diff --git a/MapProj/Assets.xcassets/camera (1).imageset/Contents.json b/MapProj/Assets.xcassets/camera (1).imageset/Contents.json new file mode 100644 index 0000000..2f3cbed --- /dev/null +++ b/MapProj/Assets.xcassets/camera (1).imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "camera (1).png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/MapProj/Assets.xcassets/camera (1).imageset/camera (1).png b/MapProj/Assets.xcassets/camera (1).imageset/camera (1).png new file mode 100644 index 0000000..b1c8908 Binary files /dev/null and b/MapProj/Assets.xcassets/camera (1).imageset/camera (1).png differ diff --git a/MapProj/Assets.xcassets/redpanda3d.imageset/redpanda3d.png b/MapProj/Assets.xcassets/redpanda3d.imageset/redpanda3d.png index 6a7da33..a513314 100644 Binary files a/MapProj/Assets.xcassets/redpanda3d.imageset/redpanda3d.png and b/MapProj/Assets.xcassets/redpanda3d.imageset/redpanda3d.png differ diff --git a/MapProj/Assets.xcassets/unicorn.imageset/Contents.json b/MapProj/Assets.xcassets/unicorn.imageset/Contents.json new file mode 100644 index 0000000..cd088fb --- /dev/null +++ b/MapProj/Assets.xcassets/unicorn.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "unicorn.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/MapProj/Assets.xcassets/unicorn.imageset/unicorn.png b/MapProj/Assets.xcassets/unicorn.imageset/unicorn.png new file mode 100644 index 0000000..1ca4de3 Binary files /dev/null and b/MapProj/Assets.xcassets/unicorn.imageset/unicorn.png differ diff --git a/MapProj/Base.lproj/Main.storyboard b/MapProj/Base.lproj/Main.storyboard index 62c3b41..ccc86d4 100644 --- a/MapProj/Base.lproj/Main.storyboard +++ b/MapProj/Base.lproj/Main.storyboard @@ -20,32 +20,36 @@ - + + - + - + + + + diff --git a/MapProj/Info.plist b/MapProj/Info.plist index 2a72ff8..25dac71 100644 --- a/MapProj/Info.plist +++ b/MapProj/Info.plist @@ -2,8 +2,6 @@ - NSLocationWhenInUseUsageDescription - App needs location services CFBundleDevelopmentRegion en CFBundleExecutable @@ -24,6 +22,8 @@ 1 LSRequiresIPhoneOS + NSLocationWhenInUseUsageDescription + App needs location services UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/MapProj/RegionMonitoring.swift b/MapProj/RegionMonitoring.swift new file mode 100644 index 0000000..45ecd33 --- /dev/null +++ b/MapProj/RegionMonitoring.swift @@ -0,0 +1,14 @@ +// +// RegionMonitoring.swift +// MapProj +// +// Created by Jordan Kiley on 7/17/16. +// Copyright © 2016 Flatiron School. All rights reserved. +// + +import Foundation +import MapKit + +class RegionMonitoring : ViewController { + +} \ No newline at end of file diff --git a/MapProj/ViewController.swift b/MapProj/ViewController.swift index 5cf6b02..833bf26 100644 --- a/MapProj/ViewController.swift +++ b/MapProj/ViewController.swift @@ -9,39 +9,78 @@ import UIKit import CoreLocation import MapKit +import DKCamera - -class ViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate { -@IBOutlet weak var map: MKMapView! -var locationManager = CLLocationManager() - +class ViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate, UINavigationControllerDelegate { + @IBOutlet weak var map: MKMapView! + + @IBOutlet weak var photoButton: UIButton! + var locationManager = CLLocationManager() + var locationChoice = (place : "National Museum of the American Indian", latitude: 40.704001, longitude: -74.013725) + var locationCoordinates = CLLocation(latitude: 40.704001, longitude: -74.013725) + var center = CLLocationCoordinate2D() + var circleRegion = CLCircularRegion() - //copied stuff from viewdidload to viewwill appear to make sure it still shows location after camera access override func viewWillAppear(animated: Bool) { - self.locationManager.delegate = self - self.locationManager.desiredAccuracy = kCLLocationAccuracyBest - self.locationManager.requestWhenInUseAuthorization() - self.locationManager.startUpdatingLocation() - self.map.showsUserLocation = true + super.viewWillAppear(animated) // No need for semicolon + + + } - override func viewDidLoad() { - super.viewDidLoad() + setupMap() + self.locationManager.startUpdatingLocation() + self.locationManager.startMonitoringForRegion(circleRegion) + // self.circleRegion.notifyOnEntry = true + // self.locationManager(locationManager, didEnterRegion: circleRegion) + // self.circleRegion.notifyOnExit = true + // self.locationManager(locationManager, didExitRegion: circleRegion) + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } + + func setupLocationManager() { self.locationManager.delegate = self + self.locationManager.desiredAccuracy = kCLLocationAccuracyBest + self.locationManager.requestWhenInUseAuthorization() //Grants access to user location when app is in use + self.locationManager.startUpdatingLocation() + locationManager.distanceFilter = kCLLocationAccuracyNearestTenMeters; + locationManager.desiredAccuracy = kCLLocationAccuracyBest; + } + + func setupMap() { + setupLocationManager() + + map.delegate = self + map.showsUserLocation = true + map.userTrackingMode = .Follow + + setupLocationForCircle() + self.locationManager.desiredAccuracy = kCLLocationAccuracyBest self.locationManager.requestWhenInUseAuthorization() self.locationManager.startUpdatingLocation() self.map.showsUserLocation = true + locationManager.stopUpdatingLocation() + self.locationManager.startMonitoringForRegion(circleRegion) + self.circleRegion.notifyOnEntry = true + self.locationManager(locationManager, didEnterRegion: circleRegion) + self.circleRegion.notifyOnExit = true + // self.locationManager(locationManager, didExitRegion: circleRegion) - //a random location for testing. need to add an array of them around flatiron - - let newYorkLocation = CLLocationCoordinate2DMake(37.7, -122.406417) + populateMap() + } + + func populateMap () { + let newYorkLocation = CLLocationCoordinate2DMake(locationCoordinates.coordinate.latitude, -locationCoordinates.coordinate.longitude) // Drop a pin let dropPin = MKPointAnnotation() dropPin.coordinate = newYorkLocation @@ -49,70 +88,81 @@ var locationManager = CLLocationManager() dropPin.subtitle = "address" map.addAnnotation(dropPin) - let userCoordinate = CLLocationCoordinate2D(latitude: 37.1927, longitude: 122.0153) - let eyeCoordinate = CLLocationCoordinate2D(latitude: 37.1927, longitude: 122.0153) - let mapCamera = MKMapCamera(lookingAtCenterCoordinate: userCoordinate, fromEyeCoordinate: eyeCoordinate, eyeAltitude: 400.0) + let userCoordinate = CLLocationCoordinate2D(latitude: locationCoordinates.coordinate.latitude, longitude: -locationCoordinates.coordinate.longitude) + let eyeCoordinate = CLLocationCoordinate2D(latitude: locationCoordinates.coordinate.latitude, longitude: -locationCoordinates.coordinate.longitude) + let mapCamera = MKMapCamera(lookingAtCenterCoordinate: userCoordinate, fromEyeCoordinate: eyeCoordinate, eyeAltitude: 500.0) let annotationZ = MKPointAnnotation() - - //Setup the Map View map.delegate = self map.mapType = MKMapType.Standard //.HybridFlyover to change view map.addAnnotation(annotationZ) map.setCamera(mapCamera, animated: true) + let museumLocation = CLLocationCoordinate2DMake(40.704001, -74.013725) + // Drop a pin + let dropPin1 = MKPointAnnotation() + dropPin1.coordinate = museumLocation + dropPin1.title = "National Museum of the American Indian" + dropPin1.subtitle = "Red Panda" + map.addAnnotation(dropPin1) + // locationChoice = (place : "National Museum of the American Indian", latitude : 40.704001, longitude : -74.013725) + locationCoordinates = CLLocation(latitude: 40.704001, longitude: -74.013725) + + let woolworthBuildingLocation = CLLocationCoordinate2DMake(40.712449, -74.008292) + // Drop a pin + let dropPin2 = MKPointAnnotation() + dropPin2.coordinate = woolworthBuildingLocation + dropPin2.title = "The Woolworth Building" + dropPin2.subtitle = "Red Panda" + map.addAnnotation(dropPin2) + + let washingtonSquareParkLocation = CLLocationCoordinate2DMake(40.730823, -73.997332) + // Drop a pin + let dropPin3 = MKPointAnnotation() + dropPin3.coordinate = washingtonSquareParkLocation + dropPin3.title = "Washington Square Park" + dropPin3.subtitle = "Red Panda" + map.addAnnotation(dropPin3) + + + let brooklynBridgeLocation = CLLocationCoordinate2DMake(40.706086, -73.996864) + // Drop a pin + let dropPin4 = MKPointAnnotation() + dropPin4.coordinate = brooklynBridgeLocation + dropPin4.title = "Brooklyn Bridge" + dropPin4.subtitle = "Red Panda" + map.addAnnotation(dropPin4) + + let flatironBuildingLocation = CLLocationCoordinate2DMake(40.741061, -73.989699) + // Drop a pin + let dropPin5 = MKPointAnnotation() + dropPin5.coordinate = flatironBuildingLocation + dropPin5.title = "Flatiron Building" + dropPin5.subtitle = "Red Panda" + map.addAnnotation(dropPin5) + } - - - - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() + func randomLocation(arrayOfLocations : [( place : String, latitude: CLLocationDegrees, longitude : CLLocationDegrees)]) -> ( place : String, latitude: CLLocationDegrees, longitude : CLLocationDegrees) { + let arrayLength : UInt32 = UInt32(arrayOfLocations.count) // Converts array count to UInt32 so it can be randomized + let randomNumber = Int(arc4random_uniform(arrayLength)) //picks random index in random location array + let selectedPlace = arrayOfLocations[randomNumber] + return selectedPlace } - - //location manager. should probably change the span for something closer than "1" later func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { let location = locations.last let center = CLLocationCoordinate2D(latitude: location!.coordinate.latitude, longitude: location!.coordinate.longitude) - let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.9, longitudeDelta: 0.88)) + let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.1, longitudeDelta: 0.1)) self.map.setRegion(region, animated: true) self.locationManager.stopUpdatingLocation() } - - - - //to have it throw an error if there is one while load - func locationManager(manager: CLLocationManager, didFailWithError error: NSError) { - print("Errors: " + error.localizedDescription) - - } - - /////////// camera button. has access to photo library. need to add access to camera and make it go straight to it when button tapped. - - //Probably have it in separate file - @IBOutlet weak var imageTest: UIButton! - @IBAction func captureImage(){ - let imageFromSource = UIImagePickerController() - imageFromSource.delegate = self - imageFromSource.allowsEditing = false - if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera){ - imageFromSource.sourceType = UIImagePickerControllerSourceType.Camera - }else{ - - imageFromSource.sourceType = UIImagePickerControllerSourceType.PhotoLibrary - } - self.presentViewController(imageFromSource, animated: true, completion: nil) - } - //////////// - - //this function is to change standard red pin to a custom image + //this function is to change standard red pin to a custom image func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? { // Dont show a custom image if the annotation is the user's location. guard !annotation.isKindOfClass(MKUserLocation) else { @@ -135,14 +185,83 @@ var locationManager = CLLocationManager() if let annotationView = annotationView { // Configure your annotation view here annotationView.canShowCallout = true - annotationView.image = UIImage(named: "redpanda3d.png") + let panda = UIImage(named: "unicorn.png") + let panda3d = UIImage(named: "redpanda3d.png") + let arr = [panda, panda3d] + let randomIndex = Int(arc4random_uniform(UInt32(arr.count))) + annotationView.image = arr[randomIndex] + + // annotationView.image = UIImage(named: "redpanda3d.png") } return annotationView } - + + //Map Radius Stuff + func setupLocationForCircle() { + if CLLocationManager.isMonitoringAvailableForClass(CLCircularRegion.self) { + + let title = String(locationChoice.0) //Sets up name of location + + center = CLLocationCoordinate2D(latitude: locationCoordinates.coordinate.latitude, longitude: locationCoordinates.coordinate.longitude) //Sets up center coordinates for the region + + let regionRadius = 200.0 + + circleRegion = CLCircularRegion(center: CLLocationCoordinate2D(latitude: center.latitude, longitude: center.longitude), radius: regionRadius, identifier: title) //Creates a circular region! + + let redPandaAnnotation = MKPointAnnotation() + redPandaAnnotation.coordinate = center + redPandaAnnotation.title = "\(title)" + map.addAnnotation(redPandaAnnotation) + + let circle = MKCircle(centerCoordinate: center, radius: regionRadius) + map.addOverlay(circle) //Defines region on map with an overlay + } else { + print("Nope") + } } - - + func mapView(mapView: MKMapView, rendererForOverlay overlay: MKOverlay) -> MKOverlayRenderer { + let circleRenderer = MKCircleRenderer(overlay: overlay) //Creates overlay + circleRenderer.strokeColor = UIColor(red: 0.094, green:0.655, blue:0.710, alpha:1.0) //Teal circle + circleRenderer.fillColor = UIColor(red: 0.094, green:0.655, blue:0.710, alpha:0.3) //Slightly transparent teal + circleRenderer.lineWidth = 0.75 + return circleRenderer + + } + + //Method to enable photo button when you enter region + func locationManager(manager: CLLocationManager, didEnterRegion region: CLRegion) { + photoButton.enabled = true + photoButton.hidden = false + print("We're close!") + } + // Disables the photo button when you leave the region + func locationManager(manager: CLLocationManager, didExitRegion region: CLRegion) { + photoButton.enabled = false + photoButton.hidden = true + print("Not there") + } + // func locationManager(manager: CLLocationManager!, didFailWithError error: NSError!) { + // print("\(error)") + // } + @IBAction func photoButton(sender: AnyObject) { + let camera = DKCamera() + + camera.didCancel = { () in + print("didCancel") + + self.dismissViewControllerAnimated(true, completion: nil) + } + + camera.didFinishCapturingImage = {(image: UIImage) in + print("didFinishCapturingImage") + print(image) + UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil) + self.dismissViewControllerAnimated(true, completion: nil) + } + self.presentViewController(camera, animated: true, completion: nil) + } + +} \ No newline at end of file diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..261a2cb --- /dev/null +++ b/Podfile @@ -0,0 +1,11 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +target 'MapProj' do + # Comment this line if you're not using Swift and don't want to use dynamic frameworks + use_frameworks! + pod 'DKCamera' + pod 'CameraManager', '~> 2.2' + # Pods for MapProj + +end diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..a5d6616 --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,15 @@ +PODS: + - CameraManager (2.2.4) + - DKCamera (1.2.9) + +DEPENDENCIES: + - CameraManager (~> 2.2) + - DKCamera + +SPEC CHECKSUMS: + CameraManager: 761f0d3dca325e8dabd46065f0b376798bca66bf + DKCamera: a070bfb4d4b1cafae3816270a35536ff61a9329a + +PODFILE CHECKSUM: e047c2ab0e5fdb550503f6f401e86d1a61e7ec70 + +COCOAPODS: 1.0.1 diff --git a/Pods/CameraManager/LICENSE b/Pods/CameraManager/LICENSE new file mode 100755 index 0000000..c292585 --- /dev/null +++ b/Pods/CameraManager/LICENSE @@ -0,0 +1,18 @@ +Camera Manager + +Copyright (c) 2014 ImaginaryCloud, imaginarycloud.com. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Pods/CameraManager/README.md b/Pods/CameraManager/README.md new file mode 100755 index 0000000..ba4cce1 --- /dev/null +++ b/Pods/CameraManager/README.md @@ -0,0 +1,163 @@ + +# Camera Manager +[![CocoaPods](https://img.shields.io/cocoapods/v/CameraManager.svg)](https://github.com/imaginary-cloud/CameraManager) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) + +This is a simple Swift class to provide all the configurations you need to create custom camera view in your app. +It follows orientation change and updates UI accordingly, supports front and rear camera selection, pinch to zoom, different flash modes, inputs and outputs. +Just drag, drop and use. + +Now it's compatible with latest Swift syntax if you're using any Swift version prior to 2.0 make sure to use one of the previously tagged releases. + +## Installation with CocoaPods + +The easiest way to install the CameraManager is with: [CocoaPods](http://cocoapods.org) + +### Podfile + +If you want Swift 2.0 syntax use: + +```ruby +use_frameworks! + +pod 'CameraManager', '~> 2.2' +``` + +If you want Swift 1.2 syntax use: + +```ruby +use_frameworks! + +pod 'CameraManager', '~> 1.0.14' +``` + +## Installation with Swift Package Manager + +The [Swift Package Manager](https://swift.org/package-manager/) is a tool for managing the distribution of Swift code. + +Add `CameraManager` as a dependency in your `Package.swift` file: + +``` +import PackageDescription + +let package = Package( + dependencies: [ + .Package(url: "https://github.com/imaginary-cloud/CameraManager", majorVersion: 2, minor: 2) + ] +) +``` + +## Installation with Carthage + +[Carthage](https://github.com/Carthage/Carthage) is another dependency management tool written in Swift. + +Add the following line to your Cartfile: + +If you want Swift 2.0 syntax use: + +``` +github "imaginary-cloud/CameraManager" >= 2.2 +``` + +If you want Swift 1.2 syntax use: + +``` +github "imaginary-cloud/CameraManager" >= 1.0 +``` + +And run `carthage update` to build the dynamic framework. + +## How to use +To use it you just add the preview layer to your desired view, you'll get back the state of the camera if it's unavailable, ready or the user denied access to it. Have in mind that in order to retain the AVCaptureSession you will need to retain cameraManager instance somewhere, ex. as an instance constant. +```swift +let cameraManager = CameraManager() +cameraManager.addPreviewLayerToView(self.cameraView) +``` +You can set input device to front or back camera: +```swift +cameraManager.cameraDevice = .Front +cameraManager.cameraDevice = .Back +``` + +You can set output format to Image, video or video with audio: +```swift +cameraManager.cameraOutputMode = .StillImage +cameraManager.cameraOutputMode = .VideoWithMic +cameraManager.cameraOutputMode = .VideoOnly +``` + +You can set the quality: +```swift +cameraManager.cameraOutputQuality = .Low +cameraManager.cameraOutputQuality = .Medium +cameraManager.cameraOutputQuality = .High +``` + +And flash mode (it will also set corresponding torch mode for video shoot): +```swift +cameraManager.flashMode = .Off +cameraManager.flashMode = .On +cameraManager.flashMode = .Auto +``` + +To check if the device supports flash call: +```swift +cameraManager.hasFlash +``` + +To change flash mode to the next available one you can use this handy function which will also return current value for you to update the UI accordingly: +```swift +cameraManager.changeFlashMode() +``` + + +You can specify if you want to save the files to phone library: +```swift +cameraManager.writeFilesToPhoneLibrary = true +``` + +You can specify if you want the user to be asked about camera permissions automatically when you first try to use the camera or manually: +```swift +cameraManager.showAccessPermissionPopupAutomatically = false +``` + +You can even setUp your custom block to handle error messages: +It can be customized to be presented on the Window root view controller, for example. +```swift +cameraManager.showErrorBlock = { (erTitle: String, erMessage: String) -> Void in + var alertController = UIAlertController(title: erTitle, message: erMessage, preferredStyle: .Alert) + alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (alertAction) -> Void in + })) + + let topController = UIApplication.sharedApplication().keyWindow?.rootViewController + + if (topController != nil) { + topController?.presentViewController(alertController, animated: true, completion: { () -> Void in + // + }) + } + +} +``` + +To shoot image all you need to do is call: +```swift +cameraManager.capturePictureWithCompletion({ (image, error) -> Void in + self.myImage = image +}) +``` + +To record video you do: +```swift +cameraManager.startRecordingVideo() +cameraManager.stopVideoRecording({ (videoURL, error) -> Void in + NSFileManager.defaultManager().copyItemAtURL(videoURL, toURL: self.myVideoURL, error: &error) +}) +``` + +## Support + +Supports iOS 8 and above. Xcode 7.0 is required to build the latest code written in Swift 2.0. + +## License + +Copyright © 2016 ImaginaryCloud, imaginarycloud.com. This library is licensed under the MIT license. diff --git a/Pods/CameraManager/camera/CameraManager.swift b/Pods/CameraManager/camera/CameraManager.swift new file mode 100644 index 0000000..2d27217 --- /dev/null +++ b/Pods/CameraManager/camera/CameraManager.swift @@ -0,0 +1,934 @@ +// +// CameraManager.swift +// camera +// +// Created by Natalia Terlecka on 10/10/14. +// Copyright (c) 2014 imaginaryCloud. All rights reserved. +// + +import UIKit +import AVFoundation +import AssetsLibrary + +public enum CameraState { + case Ready, AccessDenied, NoDeviceFound, NotDetermined +} + +public enum CameraDevice { + case Front, Back +} + +public enum CameraFlashMode: Int { + case Off, On, Auto +} + +public enum CameraOutputMode { + case StillImage, VideoWithMic, VideoOnly +} + +public enum CameraOutputQuality: Int { + case Low, Medium, High +} + +/// Class for handling iDevices custom camera usage +public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate, UIGestureRecognizerDelegate { + + // MARK: - Public properties + + /// Capture session to customize camera settings. + public var captureSession: AVCaptureSession? + + /// Property to determine if the manager should show the error for the user. If you want to show the errors yourself set this to false. If you want to add custom error UI set showErrorBlock property. Default value is false. + public var showErrorsToUsers = false + + /// Property to determine if the manager should show the camera permission popup immediatly when it's needed or you want to show it manually. Default value is true. Be carful cause using the camera requires permission, if you set this value to false and don't ask manually you won't be able to use the camera. + public var showAccessPermissionPopupAutomatically = true + + /// A block creating UI to present error message to the user. This can be customised to be presented on the Window root view controller, or to pass in the viewController which will present the UIAlertController, for example. + public var showErrorBlock:(erTitle: String, erMessage: String) -> Void = { (erTitle: String, erMessage: String) -> Void in + +// var alertController = UIAlertController(title: erTitle, message: erMessage, preferredStyle: .Alert) +// alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (alertAction) -> Void in })) +// +// if let topController = UIApplication.sharedApplication().keyWindow?.rootViewController { +// topController.presentViewController(alertController, animated: true, completion:nil) +// } + } + + /// Property to determine if manager should write the resources to the phone library. Default value is true. + public var writeFilesToPhoneLibrary = true + + /// Property to determine if manager should follow device orientation. Default value is true. + public var shouldRespondToOrientationChanges = true { + didSet { + if shouldRespondToOrientationChanges { + _startFollowingDeviceOrientation() + } else { + _stopFollowingDeviceOrientation() + } + } + } + + /// The Bool property to determine if the camera is ready to use. + public var cameraIsReady: Bool { + get { + return cameraIsSetup + } + } + + /// The Bool property to determine if current device has front camera. + public var hasFrontCamera: Bool = { + let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) + for device in devices { + let captureDevice = device as! AVCaptureDevice + if (captureDevice.position == .Front) { + return true + } + } + return false + }() + + /// The Bool property to determine if current device has flash. + public var hasFlash: Bool = { + let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) + for device in devices { + let captureDevice = device as! AVCaptureDevice + if (captureDevice.position == .Back) { + return captureDevice.hasFlash + } + } + return false + }() + + /// Property to change camera device between front and back. + public var cameraDevice = CameraDevice.Back { + didSet { + if cameraIsSetup { + if cameraDevice != oldValue { + _updateCameraDevice(cameraDevice) + _setupMaxZoomScale() + _zoom(0) + } + } + } + } + + /// Property to change camera flash mode. + public var flashMode = CameraFlashMode.Off { + didSet { + if cameraIsSetup { + if flashMode != oldValue { + _updateFlasMode(flashMode) + } + } + } + } + + /// Property to change camera output quality. + public var cameraOutputQuality = CameraOutputQuality.High { + didSet { + if cameraIsSetup { + if cameraOutputQuality != oldValue { + _updateCameraQualityMode(cameraOutputQuality) + } + } + } + } + + /// Property to change camera output. + public var cameraOutputMode = CameraOutputMode.StillImage { + didSet { + if cameraIsSetup { + if cameraOutputMode != oldValue { + _setupOutputMode(cameraOutputMode, oldCameraOutputMode: oldValue) + } + _setupMaxZoomScale() + _zoom(0) + } + } + } + + /// Property to check video recording duration when in progress + public var recordedDuration : CMTime { return movieOutput?.recordedDuration ?? kCMTimeZero } + + /// Property to check video recording file size when in progress + public var recordedFileSize : Int64 { return movieOutput?.recordedFileSize ?? 0 } + + + // MARK: - Private properties + + private weak var embeddingView: UIView? + private var videoCompletion: ((videoURL: NSURL?, error: NSError?) -> Void)? + + private var sessionQueue: dispatch_queue_t = dispatch_queue_create("CameraSessionQueue", DISPATCH_QUEUE_SERIAL) + + private lazy var frontCameraDevice: AVCaptureDevice? = { + let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) as! [AVCaptureDevice] + return devices.filter{$0.position == .Front}.first + }() + + private lazy var backCameraDevice: AVCaptureDevice? = { + let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) as! [AVCaptureDevice] + return devices.filter{$0.position == .Back}.first + }() + + private lazy var mic: AVCaptureDevice? = { + return AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeAudio) + }() + + private var stillImageOutput: AVCaptureStillImageOutput? + private var movieOutput: AVCaptureMovieFileOutput? + private var previewLayer: AVCaptureVideoPreviewLayer? + private var library: ALAssetsLibrary? + + private var cameraIsSetup = false + private var cameraIsObservingDeviceOrientation = false + + private var zoomScale = CGFloat(1.0) + private var beginZoomScale = CGFloat(1.0) + private var maxZoomScale = CGFloat(1.0) + + private var tempFilePath: NSURL = { + let tempPath = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("tempMovie").URLByAppendingPathExtension("mp4").absoluteString + if NSFileManager.defaultManager().fileExistsAtPath(tempPath) { + do { + try NSFileManager.defaultManager().removeItemAtPath(tempPath) + } catch { } + } + return NSURL(string: tempPath)! + }() + + + // MARK: - CameraManager + + /** + Inits a capture session and adds a preview layer to the given view. Preview layer bounds will automaticaly be set to match given view. Default session is initialized with still image output. + + :param: view The view you want to add the preview layer to + :param: cameraOutputMode The mode you want capturesession to run image / video / video and microphone + :param: completion Optional completion block + + :returns: Current state of the camera: Ready / AccessDenied / NoDeviceFound / NotDetermined. + */ + public func addPreviewLayerToView(view: UIView) -> CameraState { + return addPreviewLayerToView(view, newCameraOutputMode: cameraOutputMode) + } + public func addPreviewLayerToView(view: UIView, newCameraOutputMode: CameraOutputMode) -> CameraState { + return addLayerPreviewToView(view, newCameraOutputMode: newCameraOutputMode, completion: nil) + } + + @available(*, unavailable, renamed="addLayerPreviewToView") + public func addPreviewLayerToView(view: UIView, newCameraOutputMode: CameraOutputMode, completition: (Void -> Void)?) -> CameraState { + return addLayerPreviewToView(view, newCameraOutputMode: newCameraOutputMode, completion: completition) + } + + public func addLayerPreviewToView(view: UIView, newCameraOutputMode: CameraOutputMode, completion: (Void -> Void)?) -> CameraState { + if _canLoadCamera() { + if let _ = embeddingView { + if let validPreviewLayer = previewLayer { + validPreviewLayer.removeFromSuperlayer() + } + } + if cameraIsSetup { + _addPreviewLayerToView(view) + cameraOutputMode = newCameraOutputMode + if let validCompletion = completion { + validCompletion() + } + } else { + _setupCamera({ Void -> Void in + self._addPreviewLayerToView(view) + self.cameraOutputMode = newCameraOutputMode + if let validCompletion = completion { + validCompletion() + } + }) + } + } + return _checkIfCameraIsAvailable() + } + + @available(*, unavailable, renamed="askUserForCameraPermission") + public func askUserForCameraPermissions(completition: Bool -> Void) {} + + /** + Asks the user for camera permissions. Only works if the permissions are not yet determined. Note that it'll also automaticaly ask about the microphone permissions if you selected VideoWithMic output. + + :param: completion Completion block with the result of permission request + */ + public func askUserForCameraPermission(completion: Bool -> Void) { + AVCaptureDevice.requestAccessForMediaType(AVMediaTypeVideo, completionHandler: { (alowedAccess) -> Void in + if self.cameraOutputMode == .VideoWithMic { + AVCaptureDevice.requestAccessForMediaType(AVMediaTypeAudio, completionHandler: { (alowedAccess) -> Void in + dispatch_sync(dispatch_get_main_queue(), { () -> Void in + completion(alowedAccess) + }) + }) + } else { + dispatch_sync(dispatch_get_main_queue(), { () -> Void in + completion(alowedAccess) + }) + + } + }) + } + + /** + Stops running capture session but all setup devices, inputs and outputs stay for further reuse. + */ + public func stopCaptureSession() { + captureSession?.stopRunning() + _stopFollowingDeviceOrientation() + } + + /** + Resumes capture session. + */ + public func resumeCaptureSession() { + if let validCaptureSession = captureSession { + if !validCaptureSession.running && cameraIsSetup { + validCaptureSession.startRunning() + _startFollowingDeviceOrientation() + } + } else { + if _canLoadCamera() { + if cameraIsSetup { + stopAndRemoveCaptureSession() + } + _setupCamera({Void -> Void in + if let validEmbeddingView = self.embeddingView { + self._addPreviewLayerToView(validEmbeddingView) + } + self._startFollowingDeviceOrientation() + }) + } + } + } + + /** + Stops running capture session and removes all setup devices, inputs and outputs. + */ + public func stopAndRemoveCaptureSession() { + stopCaptureSession() + cameraDevice = .Back + cameraIsSetup = false + previewLayer = nil + captureSession = nil + frontCameraDevice = nil + backCameraDevice = nil + mic = nil + stillImageOutput = nil + movieOutput = nil + } + + @available(*, unavailable, renamed="capturePictureWithCompletion") + public func capturePictureWithCompletition(imageCompletition: (UIImage?, NSError?) -> Void) {} + + /** + Captures still image from currently running capture session. + + :param: imageCompletion Completion block containing the captured UIImage + */ + public func capturePictureWithCompletion(imageCompletion: (UIImage?, NSError?) -> Void) { + self.capturePictureDataWithCompletion { data, error in + + guard error == nil, let imageData = data else { + imageCompletion(nil, error) + return + } + + if self.writeFilesToPhoneLibrary == true, let library = self.library { + + library.writeImageDataToSavedPhotosAlbum(imageData, metadata:nil, completionBlock: { picUrl, error in + + guard error != nil else { + return + } + + dispatch_async(dispatch_get_main_queue(), { + self._show(NSLocalizedString("Error", comment:""), message: error.localizedDescription) + }) + + }) + + } + imageCompletion(UIImage(data: imageData), nil) + } + + } + + @available(*, unavailable, renamed="capturePictureWithCompletion") + public func capturePictureDataWithCompletition(imageCompletition: (NSData?, NSError?) -> Void) {} + + /** + Captures still image from currently running capture session. + + :param: imageCompletion Completion block containing the captured imageData + */ + public func capturePictureDataWithCompletion(imageCompletion: (NSData?, NSError?) -> Void) { + + guard cameraIsSetup else { + _show(NSLocalizedString("No capture session setup", comment:""), message: NSLocalizedString("I can't take any picture", comment:"")) + return + } + + guard cameraOutputMode == .StillImage else { + _show(NSLocalizedString("Capture session output mode video", comment:""), message: NSLocalizedString("I can't take any picture", comment:"")) + return + } + + dispatch_async(sessionQueue, { + self._getStillImageOutput().captureStillImageAsynchronouslyFromConnection(self._getStillImageOutput().connectionWithMediaType(AVMediaTypeVideo), completionHandler: { [unowned self] sample, error in + + + guard error == nil else { + dispatch_async(dispatch_get_main_queue(), { + self._show(NSLocalizedString("Error", comment:""), message: error.localizedDescription) + }) + imageCompletion(nil, error) + return + } + + let imageData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(sample) + + + imageCompletion(imageData, nil) + + }) + }) + + } + + /** + Starts recording a video with or without voice as in the session preset. + */ + public func startRecordingVideo() { + if cameraOutputMode != .StillImage { + _getMovieOutput().startRecordingToOutputFileURL(tempFilePath, recordingDelegate: self) + } else { + _show(NSLocalizedString("Capture session output still image", comment:""), message: NSLocalizedString("I can only take pictures", comment:"")) + } + } + + @available(*, unavailable, renamed="stopVideoRecording") + public func stopRecordingVideo(completition:(videoURL: NSURL?, error: NSError?) -> Void) {} + + /** + Stop recording a video. Save it to the cameraRoll and give back the url. + */ + public func stopVideoRecording(completion:(videoURL: NSURL?, error: NSError?) -> Void) { + if let runningMovieOutput = movieOutput { + if runningMovieOutput.recording { + videoCompletion = completion + runningMovieOutput.stopRecording() + } + } + } + + /** + Current camera status. + + :returns: Current state of the camera: Ready / AccessDenied / NoDeviceFound / NotDetermined + */ + public func currentCameraStatus() -> CameraState { + return _checkIfCameraIsAvailable() + } + + /** + Change current flash mode to next value from available ones. + + :returns: Current flash mode: Off / On / Auto + */ + public func changeFlashMode() -> CameraFlashMode { + flashMode = CameraFlashMode(rawValue: (flashMode.rawValue+1)%3)! + return flashMode + } + + /** + Change current output quality mode to next value from available ones. + + :returns: Current quality mode: Low / Medium / High + */ + public func changeQualityMode() -> CameraOutputQuality { + cameraOutputQuality = CameraOutputQuality(rawValue: (cameraOutputQuality.rawValue+1)%3)! + return cameraOutputQuality + } + + // MARK: - AVCaptureFileOutputRecordingDelegate + + public func captureOutput(captureOutput: AVCaptureFileOutput!, didStartRecordingToOutputFileAtURL fileURL: NSURL!, fromConnections connections: [AnyObject]!) { + captureSession?.beginConfiguration() + if flashMode != .Off { + _updateTorch(flashMode) + } + captureSession?.commitConfiguration() + } + + public func captureOutput(captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAtURL outputFileURL: NSURL!, fromConnections connections: [AnyObject]!, error: NSError!) { + _updateTorch(.Off) + if (error != nil) { + _show(NSLocalizedString("Unable to save video to the iPhone", comment:""), message: error.localizedDescription) + } else { + if let validLibrary = library { + if writeFilesToPhoneLibrary { + validLibrary.writeVideoAtPathToSavedPhotosAlbum(outputFileURL, completionBlock: { (assetURL: NSURL?, error: NSError?) -> Void in + if (error != nil) { + self._show(NSLocalizedString("Unable to save video to the iPhone.", comment:""), message: error!.localizedDescription) + self._executeVideoCompletionWithURL(nil, error: error) + } else { + if let validAssetURL = assetURL { + self._executeVideoCompletionWithURL(validAssetURL, error: error) + } + } + }) + } else { + _executeVideoCompletionWithURL(outputFileURL, error: error) + } + } + } + } + + // MARK: - UIGestureRecognizerDelegate + + private func attachZoom(view: UIView) { + let pinch = UIPinchGestureRecognizer(target: self, action: #selector(CameraManager._zoomStart(_:))) + view.addGestureRecognizer(pinch) + pinch.delegate = self + } + + public func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer) -> Bool { + + if gestureRecognizer.isKindOfClass(UIPinchGestureRecognizer) { + beginZoomScale = zoomScale; + } + + return true + } + + @objc + private func _zoomStart(recognizer: UIPinchGestureRecognizer) { + guard let view = embeddingView, + previewLayer = previewLayer + else { return } + + var allTouchesOnPreviewLayer = true + let numTouch = recognizer.numberOfTouches() + + for i in 0 ..< numTouch { + let location = recognizer.locationOfTouch(i, inView: view) + let convertedTouch = previewLayer.convertPoint(location, fromLayer: previewLayer.superlayer) + if !previewLayer.containsPoint(convertedTouch) { + allTouchesOnPreviewLayer = false + break + } + } + if allTouchesOnPreviewLayer { + _zoom(recognizer.scale) + } + } + + private func _zoom(scale: CGFloat) { + do { + let captureDevice = AVCaptureDevice.devices().first as? AVCaptureDevice + try captureDevice?.lockForConfiguration() + + zoomScale = max(1.0, min(beginZoomScale * scale, maxZoomScale)) + + captureDevice?.videoZoomFactor = zoomScale + + captureDevice?.unlockForConfiguration() + + } catch { + print("Error locking configuration") + } + } + + // MARK: - CameraManager() + + private func _updateTorch(flashMode: CameraFlashMode) { + captureSession?.beginConfiguration() + let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) + for device in devices { + let captureDevice = device as! AVCaptureDevice + if (captureDevice.position == AVCaptureDevicePosition.Back) { + let avTorchMode = AVCaptureTorchMode(rawValue: flashMode.rawValue) + if (captureDevice.isTorchModeSupported(avTorchMode!)) { + do { + try captureDevice.lockForConfiguration() + } catch { + return; + } + captureDevice.torchMode = avTorchMode! + captureDevice.unlockForConfiguration() + } + } + } + captureSession?.commitConfiguration() + } + + + private func _executeVideoCompletionWithURL(url: NSURL?, error: NSError?) { + if let validCompletion = videoCompletion { + validCompletion(videoURL: url, error: error) + videoCompletion = nil + } + } + + private func _getMovieOutput() -> AVCaptureMovieFileOutput { + var shouldReinitializeMovieOutput = movieOutput == nil + if !shouldReinitializeMovieOutput { + if let connection = movieOutput!.connectionWithMediaType(AVMediaTypeVideo) { + shouldReinitializeMovieOutput = shouldReinitializeMovieOutput || !connection.active + } + } + + if shouldReinitializeMovieOutput { + movieOutput = AVCaptureMovieFileOutput() + movieOutput!.movieFragmentInterval = kCMTimeInvalid + + if let captureSession = captureSession { + if captureSession.canAddOutput(movieOutput) { + captureSession.beginConfiguration() + captureSession.addOutput(movieOutput) + captureSession.commitConfiguration() + } + } + } + return movieOutput! + } + + private func _getStillImageOutput() -> AVCaptureStillImageOutput { + var shouldReinitializeStillImageOutput = stillImageOutput == nil + if !shouldReinitializeStillImageOutput { + if let connection = stillImageOutput!.connectionWithMediaType(AVMediaTypeVideo) { + shouldReinitializeStillImageOutput = shouldReinitializeStillImageOutput || !connection.active + } + } + if shouldReinitializeStillImageOutput { + stillImageOutput = AVCaptureStillImageOutput() + + if let captureSession = captureSession { + if captureSession.canAddOutput(stillImageOutput) { + captureSession.beginConfiguration() + captureSession.addOutput(stillImageOutput) + captureSession.commitConfiguration() + } + } + } + return stillImageOutput! + } + + @objc private func _orientationChanged() { + var currentConnection: AVCaptureConnection?; + switch cameraOutputMode { + case .StillImage: + currentConnection = stillImageOutput?.connectionWithMediaType(AVMediaTypeVideo) + case .VideoOnly, .VideoWithMic: + currentConnection = _getMovieOutput().connectionWithMediaType(AVMediaTypeVideo) + } + if let validPreviewLayer = previewLayer { + if let validPreviewLayerConnection = validPreviewLayer.connection { + if validPreviewLayerConnection.supportsVideoOrientation { + validPreviewLayerConnection.videoOrientation = _currentVideoOrientation() + } + } + if let validOutputLayerConnection = currentConnection { + if validOutputLayerConnection.supportsVideoOrientation { + validOutputLayerConnection.videoOrientation = _currentVideoOrientation() + } + } + dispatch_async(dispatch_get_main_queue(), { () -> Void in + if let validEmbeddingView = self.embeddingView { + validPreviewLayer.frame = validEmbeddingView.bounds + } + }) + } + } + + private func _currentVideoOrientation() -> AVCaptureVideoOrientation { + switch UIDevice.currentDevice().orientation { + case .LandscapeLeft: + return .LandscapeRight + case .LandscapeRight: + return .LandscapeLeft + default: + return .Portrait + } + } + + private func _canLoadCamera() -> Bool { + let currentCameraState = _checkIfCameraIsAvailable() + return currentCameraState == .Ready || (currentCameraState == .NotDetermined && showAccessPermissionPopupAutomatically) + } + + private func _setupCamera(completion: Void -> Void) { + captureSession = AVCaptureSession() + + dispatch_async(sessionQueue, { + if let validCaptureSession = self.captureSession { + validCaptureSession.beginConfiguration() + validCaptureSession.sessionPreset = AVCaptureSessionPresetHigh + self._updateCameraDevice(self.cameraDevice) + self._setupOutputs() + self._setupOutputMode(self.cameraOutputMode, oldCameraOutputMode: nil) + self._setupPreviewLayer() + validCaptureSession.commitConfiguration() + self._updateFlasMode(self.flashMode) + self._updateCameraQualityMode(self.cameraOutputQuality) + validCaptureSession.startRunning() + self._startFollowingDeviceOrientation() + self.cameraIsSetup = true + self._orientationChanged() + + completion() + } + }) + } + + private func _startFollowingDeviceOrientation() { + if shouldRespondToOrientationChanges && !cameraIsObservingDeviceOrientation { + NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(CameraManager._orientationChanged), name: UIDeviceOrientationDidChangeNotification, object: nil) + cameraIsObservingDeviceOrientation = true + } + } + + private func _stopFollowingDeviceOrientation() { + if cameraIsObservingDeviceOrientation { + NSNotificationCenter.defaultCenter().removeObserver(self, name: UIDeviceOrientationDidChangeNotification, object: nil) + cameraIsObservingDeviceOrientation = false + } + } + + private func _addPreviewLayerToView(view: UIView) { + embeddingView = view + attachZoom(view) + dispatch_async(dispatch_get_main_queue(), { () -> Void in + guard let _ = self.previewLayer else { + return + } + self.previewLayer!.frame = view.layer.bounds + view.clipsToBounds = true + view.layer.addSublayer(self.previewLayer!) + }) + } + + private func _setupMaxZoomScale() { + var maxZoom = CGFloat(1.0) + beginZoomScale = CGFloat(1.0) + + if cameraDevice == .Back { + maxZoom = (backCameraDevice?.activeFormat.videoMaxZoomFactor)! + } + else if cameraDevice == .Front { + maxZoom = (frontCameraDevice?.activeFormat.videoMaxZoomFactor)! + } + + maxZoomScale = maxZoom + } + + private func _checkIfCameraIsAvailable() -> CameraState { + let deviceHasCamera = UIImagePickerController.isCameraDeviceAvailable(UIImagePickerControllerCameraDevice.Rear) || UIImagePickerController.isCameraDeviceAvailable(UIImagePickerControllerCameraDevice.Front) + if deviceHasCamera { + let authorizationStatus = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo) + let userAgreedToUseIt = authorizationStatus == .Authorized + if userAgreedToUseIt { + return .Ready + } else if authorizationStatus == AVAuthorizationStatus.NotDetermined { + return .NotDetermined + } else { + _show(NSLocalizedString("Camera access denied", comment:""), message:NSLocalizedString("You need to go to settings app and grant acces to the camera device to use it.", comment:"")) + return .AccessDenied + } + } else { + _show(NSLocalizedString("Camera unavailable", comment:""), message:NSLocalizedString("The device does not have a camera.", comment:"")) + return .NoDeviceFound + } + } + + private func _setupOutputMode(newCameraOutputMode: CameraOutputMode, oldCameraOutputMode: CameraOutputMode?) { + captureSession?.beginConfiguration() + + if let cameraOutputToRemove = oldCameraOutputMode { + // remove current setting + switch cameraOutputToRemove { + case .StillImage: + if let validStillImageOutput = stillImageOutput { + captureSession?.removeOutput(validStillImageOutput) + } + case .VideoOnly, .VideoWithMic: + if let validMovieOutput = movieOutput { + captureSession?.removeOutput(validMovieOutput) + } + if cameraOutputToRemove == .VideoWithMic { + _removeMicInput() + } + } + } + + // configure new devices + switch newCameraOutputMode { + case .StillImage: + if (stillImageOutput == nil) { + _setupOutputs() + } + if let validStillImageOutput = stillImageOutput { + if let captureSession = captureSession { + if captureSession.canAddOutput(validStillImageOutput) { + captureSession.addOutput(validStillImageOutput) + } + } + } + case .VideoOnly, .VideoWithMic: + captureSession?.addOutput(_getMovieOutput()) + + if newCameraOutputMode == .VideoWithMic { + if let validMic = _deviceInputFromDevice(mic) { + captureSession?.addInput(validMic) + } + } + } + captureSession?.commitConfiguration() + _updateCameraQualityMode(cameraOutputQuality) + _orientationChanged() + } + + private func _setupOutputs() { + if (stillImageOutput == nil) { + stillImageOutput = AVCaptureStillImageOutput() + } + if (movieOutput == nil) { + movieOutput = AVCaptureMovieFileOutput() + movieOutput!.movieFragmentInterval = kCMTimeInvalid + } + if library == nil { + library = ALAssetsLibrary() + } + } + + private func _setupPreviewLayer() { + if let validCaptureSession = captureSession { + previewLayer = AVCaptureVideoPreviewLayer(session: validCaptureSession) + previewLayer?.videoGravity = AVLayerVideoGravityResizeAspectFill + } + } + + private func _updateCameraDevice(deviceType: CameraDevice) { + if let validCaptureSession = captureSession { + validCaptureSession.beginConfiguration() + let inputs = validCaptureSession.inputs as! [AVCaptureInput] + + for input in inputs { + if let deviceInput = input as? AVCaptureDeviceInput { + if deviceInput.device == backCameraDevice && cameraDevice == .Front { + validCaptureSession.removeInput(deviceInput) + break; + } else if deviceInput.device == frontCameraDevice && cameraDevice == .Back { + validCaptureSession.removeInput(deviceInput) + break; + } + } + } + switch cameraDevice { + case .Front: + if hasFrontCamera { + if let validFrontDevice = _deviceInputFromDevice(frontCameraDevice) { + if !inputs.contains(validFrontDevice) { + validCaptureSession.addInput(validFrontDevice) + } + } + } + case .Back: + if let validBackDevice = _deviceInputFromDevice(backCameraDevice) { + if !inputs.contains(validBackDevice) { + validCaptureSession.addInput(validBackDevice) + } + } + } + validCaptureSession.commitConfiguration() + } + } + + private func _updateFlasMode(flashMode: CameraFlashMode) { + captureSession?.beginConfiguration() + let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) + for device in devices { + let captureDevice = device as! AVCaptureDevice + if (captureDevice.position == AVCaptureDevicePosition.Back) { + let avFlashMode = AVCaptureFlashMode(rawValue: flashMode.rawValue) + if (captureDevice.isFlashModeSupported(avFlashMode!)) { + do { + try captureDevice.lockForConfiguration() + } catch { + return + } + captureDevice.flashMode = avFlashMode! + captureDevice.unlockForConfiguration() + } + } + } + captureSession?.commitConfiguration() + } + + private func _updateCameraQualityMode(newCameraOutputQuality: CameraOutputQuality) { + if let validCaptureSession = captureSession { + var sessionPreset = AVCaptureSessionPresetLow + switch (newCameraOutputQuality) { + case CameraOutputQuality.Low: + sessionPreset = AVCaptureSessionPresetLow + case CameraOutputQuality.Medium: + sessionPreset = AVCaptureSessionPresetMedium + case CameraOutputQuality.High: + if cameraOutputMode == .StillImage { + sessionPreset = AVCaptureSessionPresetPhoto + } else { + sessionPreset = AVCaptureSessionPresetHigh + } + } + if validCaptureSession.canSetSessionPreset(sessionPreset) { + validCaptureSession.beginConfiguration() + validCaptureSession.sessionPreset = sessionPreset + validCaptureSession.commitConfiguration() + } else { + _show(NSLocalizedString("Preset not supported", comment:""), message: NSLocalizedString("Camera preset not supported. Please try another one.", comment:"")) + } + } else { + _show(NSLocalizedString("Camera error", comment:""), message: NSLocalizedString("No valid capture session found, I can't take any pictures or videos.", comment:"")) + } + } + + private func _removeMicInput() { + guard let inputs = captureSession?.inputs as? [AVCaptureInput] else { return } + + for input in inputs { + if let deviceInput = input as? AVCaptureDeviceInput { + if deviceInput.device == mic { + captureSession?.removeInput(deviceInput) + break; + } + } + } + } + + private func _show(title: String, message: String) { + if showErrorsToUsers { + dispatch_async(dispatch_get_main_queue(), { () -> Void in + self.showErrorBlock(erTitle: title, erMessage: message) + }) + } + } + + private func _deviceInputFromDevice(device: AVCaptureDevice?) -> AVCaptureDeviceInput? { + guard let validDevice = device else { return nil } + do { + return try AVCaptureDeviceInput(device: validDevice) + } catch let outError { + _show(NSLocalizedString("Device setup error occured", comment:""), message: "\(outError)") + return nil + } + } + + deinit { + stopAndRemoveCaptureSession() + _stopFollowingDeviceOrientation() + } +} diff --git a/Pods/CameraManager/camera/CameraManager.swift.qlpreview/Preview.txt b/Pods/CameraManager/camera/CameraManager.swift.qlpreview/Preview.txt new file mode 100644 index 0000000..0d7b37a --- /dev/null +++ b/Pods/CameraManager/camera/CameraManager.swift.qlpreview/Preview.txt @@ -0,0 +1,653 @@ +// +// CameraManager.swift +// camera +// +// Created by Natalia Terlecka on 10/10/14. +// Copyright (c) 2014 imaginaryCloud. All rights reserved. +// + +import UIKit +import AVFoundation +import AssetsLibrary + +private let _singletonSharedInstance = CameraManager() + +enum CameraDevice { + case Front, Back +} + +enum CameraFlashMode: Int { + case Off, On, Auto +} + +enum CameraOutputMode { + case StillImage, VideoWithMic, VideoOnly +} + +enum CameraOutputQuality { + case Low, Medium, High +} + +/// Class for handling iDevices custom camera usage +class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate { + + /// Capture session to customize camera settings. + var captureSession: AVCaptureSession? + + /// Property to determine if the manager should show the error for the user. If you want to show the errors yourself set this to false. If you want to add custom error UI set showErrorBlock property. Default value is true. + var showErrorsToUsers = true + + /// A block creating UI to present error message to the user. + var showErrorBlock:(erTitle: String, erMessage: String) -> Void = { (erTitle: String, erMessage: String) -> Void in + UIAlertView(title: erTitle, message: erMessage, delegate: nil, cancelButtonTitle: "OK").show() + } + + /// Property to determine if manager should write the resources to the phone library. Default value is true. + var writeFilesToPhoneLibrary = true + + /// The Bool property to determin if current device has front camera. + var hasFrontCamera: Bool = { + let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) + for device in devices { + let captureDevice = device as AVCaptureDevice + if (captureDevice.position == .Front) { + return true + } + } + return false + }() + + /// Property to change camera device between front and back. + var cameraDevice: CameraDevice { + get { + return _cameraDevice + } + set(newCameraDevice) { + if let validCaptureSession = self.captureSession { + validCaptureSession.beginConfiguration() + let inputs = validCaptureSession.inputs as [AVCaptureInput] + + switch newCameraDevice { + case .Front: + if self.hasFrontCamera { + if let validBackDevice = self.rearCamera? { + if contains(inputs, validBackDevice) { + validCaptureSession.removeInput(validBackDevice) + } + } + if let validFrontDevice = self.frontCamera? { + if !contains(inputs, validFrontDevice) { + validCaptureSession.addInput(validFrontDevice) + } + } + } + case .Back: + if let validFrontDevice = self.frontCamera? { + if contains(inputs, validFrontDevice) { + validCaptureSession.removeInput(validFrontDevice) + } + } + if let validBackDevice = self.rearCamera? { + if !contains(inputs, validBackDevice) { + validCaptureSession.addInput(validBackDevice) + } + } + } + validCaptureSession.commitConfiguration() + } + _cameraDevice = newCameraDevice + } + } + + /// Property to change camera flash mode. + var flashMode: CameraFlashMode { + get { + return _flashMode + } + set(newflashMode) { + if newflashMode != _flashMode { + self.captureSession?.beginConfiguration() + let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) + for device in devices { + let captureDevice = device as AVCaptureDevice + if (captureDevice.position == AVCaptureDevicePosition.Back) { + let avFlashMode = AVCaptureFlashMode(rawValue: newflashMode.rawValue) + if (captureDevice.isFlashModeSupported(avFlashMode!)) { + captureDevice.lockForConfiguration(nil) + captureDevice.flashMode = avFlashMode! + captureDevice.unlockForConfiguration() + } + } + } + self.captureSession?.commitConfiguration() + + _flashMode = newflashMode + } + } + } + + /// Property to change camera output quality. + var cameraOutputQuality: CameraOutputQuality { + get { + return _cameraOutputQuality + } + set(newCameraOutputQuality) { + if newCameraOutputQuality != _cameraOutputQuality { + if let validCaptureSession = self.captureSession? { + validCaptureSession.beginConfiguration() + switch (newCameraOutputQuality) { + case CameraOutputQuality.Low: + validCaptureSession.sessionPreset = AVCaptureSessionPresetLow + case CameraOutputQuality.Medium: + validCaptureSession.sessionPreset = AVCaptureSessionPresetMedium + case CameraOutputQuality.High: + validCaptureSession.sessionPreset = AVCaptureSessionPresetHigh + } + validCaptureSession.commitConfiguration() + + _cameraOutputQuality = newCameraOutputQuality + } else { + self._show("Camera error", message: "No valid capture session found, I can't take any pictures or videos.") + } + } + } + } + + /// Property to change camera output. + var cameraOutputMode: CameraOutputMode { + get { + return _cameraOutputMode + } + set(newCameraOutputMode) { + if newCameraOutputMode != _cameraOutputMode { + self._setupOutputMode(newCameraOutputMode) + } + } + } + + private weak var embedingView: UIView? + private var videoCompletition: ((videoURL: NSURL) -> Void)? + + private var sessionQueue: dispatch_queue_t = dispatch_queue_create("CameraSessionQueue", DISPATCH_QUEUE_SERIAL) + + private var frontCamera: AVCaptureInput? + private var rearCamera: AVCaptureInput? + private var mic: AVCaptureDeviceInput? + private var stillImageOutput: AVCaptureStillImageOutput? + private var movieOutput: AVCaptureMovieFileOutput? + private var previewLayer: AVCaptureVideoPreviewLayer? + private var library: ALAssetsLibrary? + + private var cameraIsSetup = false + private var cameraIsObservingDeviceOrientation = false + + private var _cameraDevice = CameraDevice.Back + private var _flashMode = CameraFlashMode.Off + private var _cameraOutputMode = CameraOutputMode.StillImage + private var _cameraOutputQuality = CameraOutputQuality.High + + private var tempFilePath: NSURL = { + let tempPath = NSTemporaryDirectory().stringByAppendingPathComponent("tempMovie").stringByAppendingPathExtension("mp4") + if NSFileManager.defaultManager().fileExistsAtPath(tempPath!) { + NSFileManager.defaultManager().removeItemAtPath(tempPath!, error: nil) + } + return NSURL(fileURLWithPath: tempPath!)! + }() + + /// CameraManager singleton instance to use the camera. + class var sharedInstance: CameraManager { + return _singletonSharedInstance + } + + deinit { + self.stopAndRemoveCaptureSession() + self._stopFollowingDeviceOrientation() + } + + /** + Inits a capture session and adds a preview layer to the given view. Preview layer bounds will automaticaly be set to match given view. Default session is initialized with still image output. + + :param: view The view you want to add the preview layer to + :param: cameraOutputMode The mode you want capturesession to run image / video / video and microphone + */ + func addPreviewLayerToView(view: UIView) + { + self.addPreviewLayerToView(view, newCameraOutputMode: _cameraOutputMode) + } + func addPreviewLayerToView(view: UIView, newCameraOutputMode: CameraOutputMode) + { + if let validEmbedingView = self.embedingView? { + if let validPreviewLayer = self.previewLayer? { + validPreviewLayer.removeFromSuperlayer() + } + } + if self.cameraIsSetup { + self._addPreeviewLayerToView(view) + self.cameraOutputMode = newCameraOutputMode + } else { + self._setupCamera({ Void -> Void in + self._addPreeviewLayerToView(view) + self.cameraOutputMode = newCameraOutputMode + }) + } + } + + /** + Stops running capture session but all setup devices, inputs and outputs stay for further reuse. + */ + func stopCaptureSession() + { + self.captureSession?.stopRunning() + self._stopFollowingDeviceOrientation() + } + + /** + Resumes capture session. + */ + func resumeCaptureSession() + { + if let validCaptureSession = self.captureSession? { + if !validCaptureSession.running && self.cameraIsSetup { + validCaptureSession.startRunning() + self._startFollowingDeviceOrientation() + } + } else { + if self.cameraIsSetup { + self.stopAndRemoveCaptureSession() + } + self._setupCamera({Void -> Void in + if let validEmbedingView = self.embedingView? { + self._addPreeviewLayerToView(validEmbedingView) + } + self._startFollowingDeviceOrientation() + }) + } + } + + /** + Stops running capture session and removes all setup devices, inputs and outputs. + */ + func stopAndRemoveCaptureSession() + { + self.stopCaptureSession() + self.cameraDevice = .Back + self.cameraIsSetup = false + self.previewLayer = nil + self.captureSession = nil + self.frontCamera = nil + self.rearCamera = nil + self.mic = nil + self.stillImageOutput = nil + self.movieOutput = nil + } + + /** + Captures still image from currently running capture session. + + :param: imageCompletition Completition block containing the captured UIImage + */ + func capturePictureWithCompletition(imageCompletition: UIImage -> Void) + { + if self.cameraIsSetup { + if self.cameraOutputMode == .StillImage { + dispatch_async(self.sessionQueue, { + self._getStillImageOutput().captureStillImageAsynchronouslyFromConnection(self._getStillImageOutput().connectionWithMediaType(AVMediaTypeVideo), completionHandler: { [weak self] (sample: CMSampleBuffer!, error: NSError!) -> Void in + if (error? != nil) { + dispatch_async(dispatch_get_main_queue(), { + if let weakSelf = self { + weakSelf._show("error", message: error.localizedDescription) + } + }) + } else { + let imageData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(sample) + if let weakSelf = self { + if weakSelf.writeFilesToPhoneLibrary { + if let validLibrary = weakSelf.library? { + validLibrary.writeImageDataToSavedPhotosAlbum(imageData, metadata:nil, completionBlock: { + (picUrl, error) -> Void in + if (error? != nil) { + dispatch_async(dispatch_get_main_queue(), { + weakSelf._show("error", message: error.localizedDescription) + }) + } + }) + } + } + } + imageCompletition(UIImage(data: imageData)!) + } + }) + }) + } else { + self._show("Capture session output mode video", message: "I can't take any picture") + } + } else { + self._show("No capture session setup", message: "I can't take any picture") + } + } + + /** + Starts recording a video with or without voice as in the session preset. + */ + func startRecordingVideo() + { + if self.cameraOutputMode != .StillImage { + self._getMovieOutput().startRecordingToOutputFileURL(self.tempFilePath, recordingDelegate: self) + } else { + self._show("Capture session output still image", message: "I can only take pictures") + } + } + + /** + Stop recording a video. Save it to the cameraRoll and give back the url. + */ + func stopRecordingVideo(completition:(videoURL: NSURL) -> Void) + { + if let runningMovieOutput = self.movieOutput { + if runningMovieOutput.recording { + self.videoCompletition = completition + runningMovieOutput.stopRecording() + } + } + } + + + // PRAGMA MARK - AVCaptureFileOutputRecordingDelegate + + func captureOutput(captureOutput: AVCaptureFileOutput!, didStartRecordingToOutputFileAtURL fileURL: NSURL!, fromConnections connections: [AnyObject]!) + { + + } + + func captureOutput(captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAtURL outputFileURL: NSURL!, fromConnections connections: [AnyObject]!, error: NSError!) + { + if (error != nil) { + self._show("Unable to save video to the iPhone", message: error.localizedDescription) + } else { + if let validLibrary = self.library? { + if self.writeFilesToPhoneLibrary { + validLibrary.writeVideoAtPathToSavedPhotosAlbum(outputFileURL, completionBlock: { (assetURL: NSURL?, error: NSError?) -> Void in + if (error != nil) { + self._show("Unable to save video to the iPhone.", message: error!.localizedDescription) + } else { + if let validAssetURL = assetURL { + self._executeVideoCompletitionWithURL(validAssetURL) + } + } + }) + } else { + self._executeVideoCompletitionWithURL(outputFileURL) + } + } + } + } + + // PRAGMA MARK - CameraManager() + + private func _executeVideoCompletitionWithURL(url: NSURL) + { + if let validCompletition = self.videoCompletition { + validCompletition(videoURL: url) + self.videoCompletition = nil + } + } + + private func _getMovieOutput() -> AVCaptureMovieFileOutput + { + var shouldReinitializeMovieOutput = self.movieOutput == nil + if !shouldReinitializeMovieOutput { + if let connection = self.movieOutput!.connectionWithMediaType(AVMediaTypeVideo) { + shouldReinitializeMovieOutput = shouldReinitializeMovieOutput || !connection.active + } + } + + if shouldReinitializeMovieOutput { + self.movieOutput = AVCaptureMovieFileOutput() + + self.captureSession?.beginConfiguration() + self.captureSession?.addOutput(self.movieOutput) + self.captureSession?.commitConfiguration() + } + return self.movieOutput! + } + + private func _getStillImageOutput() -> AVCaptureStillImageOutput + { + var shouldReinitializeStillImageOutput = self.stillImageOutput == nil + if !shouldReinitializeStillImageOutput { + if let connection = self.stillImageOutput!.connectionWithMediaType(AVMediaTypeVideo) { + shouldReinitializeStillImageOutput = shouldReinitializeStillImageOutput || !connection.active + } + } + if shouldReinitializeStillImageOutput { + self.stillImageOutput = AVCaptureStillImageOutput() + + self.captureSession?.beginConfiguration() + self.captureSession?.addOutput(self.stillImageOutput) + self.captureSession?.commitConfiguration() + } + return self.stillImageOutput! + } + + @objc private func _orientationChanged() + { + var currentConnection: AVCaptureConnection?; + switch self.cameraOutputMode { + case .StillImage: + currentConnection = self.stillImageOutput?.connectionWithMediaType(AVMediaTypeVideo) + case .VideoOnly, .VideoWithMic: + currentConnection = self._getMovieOutput().connectionWithMediaType(AVMediaTypeVideo) + } + if let validPreviewLayer = self.previewLayer? { + if let validPreviewLayerConnection = validPreviewLayer.connection? { + if validPreviewLayerConnection.supportsVideoOrientation { + validPreviewLayerConnection.videoOrientation = self._currentVideoOrientation() + } + } + if let validOutputLayerConnection = currentConnection? { + if validOutputLayerConnection.supportsVideoOrientation { + validOutputLayerConnection.videoOrientation = self._currentVideoOrientation() + } + } + dispatch_async(dispatch_get_main_queue(), { () -> Void in + if let validEmbedingView = self.embedingView? { + validPreviewLayer.frame = validEmbedingView.bounds + } + }) + } + } + + private func _currentVideoOrientation() -> AVCaptureVideoOrientation + { + switch UIDevice.currentDevice().orientation { + case .LandscapeLeft: + return .LandscapeRight + case .LandscapeRight: + return .LandscapeLeft + default: + return .Portrait + } + } + + private func _setupCamera(completition: Void -> Void) + { + if self._checkIfCameraIsAvailable() { + self.captureSession = AVCaptureSession() + + dispatch_async(sessionQueue, { + if let validCaptureSession = self.captureSession? { + validCaptureSession.beginConfiguration() + validCaptureSession.sessionPreset = AVCaptureSessionPresetHigh + self._addVideoInput() + self._setupOutputs() + self._setupOutputMode(self._cameraOutputMode) + self.cameraOutputQuality = self._cameraOutputQuality + self._setupPreviewLayer() + validCaptureSession.commitConfiguration() + validCaptureSession.startRunning() + self._startFollowingDeviceOrientation() + self.cameraIsSetup = true + + completition() + } + }) + } else { + self._show("Camera unavailable", message: "The device does not have a camera") + } + } + + private func _startFollowingDeviceOrientation() + { + if !self.cameraIsObservingDeviceOrientation { + NSNotificationCenter.defaultCenter().addObserver(self, selector: "_orientationChanged", name: UIDeviceOrientationDidChangeNotification, object: nil) + self.cameraIsObservingDeviceOrientation = true + } + } + + private func _stopFollowingDeviceOrientation() + { + if self.cameraIsObservingDeviceOrientation { + NSNotificationCenter.defaultCenter().removeObserver(self, name: UIDeviceOrientationDidChangeNotification, object: nil) + self.cameraIsObservingDeviceOrientation = false + } + } + + private func _addPreeviewLayerToView(view: UIView) + { + self.embedingView = view + dispatch_async(dispatch_get_main_queue(), { () -> Void in + self.previewLayer?.frame = view.layer.bounds + view.clipsToBounds = true + view.layer.addSublayer(self.previewLayer) + }) + } + + private func _checkIfCameraIsAvailable() -> Bool + { + let deviceHasCamera = UIImagePickerController.isCameraDeviceAvailable(UIImagePickerControllerCameraDevice.Rear) || UIImagePickerController.isCameraDeviceAvailable(UIImagePickerControllerCameraDevice.Front) + return deviceHasCamera + } + + private func _addVideoInput() + { + var error: NSError? + + if (self.frontCamera? == nil) || (self.rearCamera? == nil) { + var videoFrontDevice: AVCaptureDevice? + var videoBackDevice: AVCaptureDevice? + for device: AnyObject in AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) { + if device.position == AVCaptureDevicePosition.Back { + videoBackDevice = device as? AVCaptureDevice + } else if device.position == AVCaptureDevicePosition.Front { + videoFrontDevice = device as? AVCaptureDevice + } + } + if (self.frontCamera? == nil) { + if let validVideoFrontDevice = videoFrontDevice? { + self.frontCamera = AVCaptureDeviceInput.deviceInputWithDevice(validVideoFrontDevice, error: &error) as AVCaptureDeviceInput + } + } + if (self.rearCamera? == nil) { + if let validVideoBackDevice = videoBackDevice? { + self.rearCamera = AVCaptureDeviceInput.deviceInputWithDevice(validVideoBackDevice, error: &error) as AVCaptureDeviceInput + } + } + if let validError = error? { + self._show("Device setup error occured", message: validError.localizedDescription) + } + } + self.cameraDevice = _cameraDevice + } + + private func _setupMic() + { + if (self.mic == nil) { + var error: NSError? + let micDevice:AVCaptureDevice = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeAudio); + self.mic = AVCaptureDeviceInput.deviceInputWithDevice(micDevice, error: &error) as? AVCaptureDeviceInput; + if let errorHappened = error? { + self.mic = nil + self._show("Mic error", message: errorHappened.description) + } + } + } + + private func _setupOutputMode(newCameraOutputMode: CameraOutputMode) + { + self.captureSession?.beginConfiguration() + + if (_cameraOutputMode != newCameraOutputMode) { + // remove current setting + switch _cameraOutputMode { + case .StillImage: + if let validStillImageOutput = self.stillImageOutput? { + self.captureSession?.removeOutput(validStillImageOutput) + } + case .VideoOnly, .VideoWithMic: + if let validMovieOutput = self.movieOutput? { + self.captureSession?.removeOutput(validMovieOutput) + } + if _cameraOutputMode == .VideoWithMic { + if let validMic = self.mic? { + self.captureSession?.removeInput(validMic) + } + } + } + } + + // configure new devices + switch newCameraOutputMode { + case .StillImage: + if (self.stillImageOutput == nil) { + self._setupOutputs() + } + if let validStillImageOutput = self.stillImageOutput? { + self.captureSession?.addOutput(validStillImageOutput) + } + case .VideoOnly, .VideoWithMic: + self.captureSession?.addOutput(self._getMovieOutput()) + + if newCameraOutputMode == .VideoWithMic { + if (self.mic == nil) { + self._setupMic() + } + if let validMic = self.mic? { + self.captureSession?.addInput(validMic) + } + } + } + self.captureSession?.commitConfiguration() + _cameraOutputMode = newCameraOutputMode; + self._orientationChanged() + } + + private func _setupOutputs() + { + if (self.stillImageOutput == nil) { + self.stillImageOutput = AVCaptureStillImageOutput() + } + if (self.movieOutput == nil) { + self.movieOutput = AVCaptureMovieFileOutput() + } + if self.library == nil { + self.library = ALAssetsLibrary() + } + } + + private func _setupPreviewLayer() + { + if let validCaptureSession = self.captureSession? { + self.previewLayer = AVCaptureVideoPreviewLayer(session: validCaptureSession) + self.previewLayer?.videoGravity = AVLayerVideoGravityResizeAspectFill + } + } + + private func _show(title: String, message: String) + { + if self.showErrorsToUsers { + dispatch_async(dispatch_get_main_queue(), { () -> Void in + self.showErrorBlock(erTitle: title, erMessage: message) + }) + } + } +} diff --git a/Pods/CameraManager/camera/CameraManager.swift.qlpreview/PreviewProperties.plist b/Pods/CameraManager/camera/CameraManager.swift.qlpreview/PreviewProperties.plist new file mode 100644 index 0000000..3d5d57c --- /dev/null +++ b/Pods/CameraManager/camera/CameraManager.swift.qlpreview/PreviewProperties.plist @@ -0,0 +1,8 @@ + + + + + BaseBundlePath + /Applications/TextMate.app/Contents/Library/QuickLook/TextMateQL.qlgenerator + + diff --git a/Pods/DKCamera/DKCamera/DKCamera.swift b/Pods/DKCamera/DKCamera/DKCamera.swift new file mode 100644 index 0000000..ea355ea --- /dev/null +++ b/Pods/DKCamera/DKCamera/DKCamera.swift @@ -0,0 +1,656 @@ +// +// DKCamera.swift +// DKCameraDemo +// +// Created by ZhangAo on 15/8/30. +// Copyright (c) 2015年 ZhangAo. All rights reserved. +// + +import UIKit +import AVFoundation +import CoreMotion + +public class DKCameraPassthroughView: UIView { + public override func hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? { + let hitTestingView = super.hitTest(point, withEvent: event) + return hitTestingView == self ? nil : hitTestingView + } +} + +public class DKCamera: UIViewController { + + public class func checkCameraPermission(handler: (granted: Bool) -> Void) { + func hasCameraPermission() -> Bool { + return AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo) == .Authorized + } + + func needsToRequestCameraPermission() -> Bool { + return AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo) == .NotDetermined + } + + hasCameraPermission() ? handler(granted: true) : (needsToRequestCameraPermission() ? + AVCaptureDevice.requestAccessForMediaType(AVMediaTypeVideo, completionHandler: { granted in + dispatch_async(dispatch_get_main_queue(), { () -> Void in + hasCameraPermission() ? handler(granted: true) : handler(granted: false) + }) + }) : handler(granted: false)) + } + + public var didCancel: (() -> Void)? + public var didFinishCapturingImage: ((image: UIImage) -> Void)? + + public var cameraOverlayView: UIView? { + didSet { + if let cameraOverlayView = cameraOverlayView { + self.view.addSubview(cameraOverlayView) + } + } + } + + /// The flashModel will to be remembered to next use. + public var flashMode:AVCaptureFlashMode! { + didSet { + self.updateFlashButton() + self.updateFlashMode() + self.updateFlashModeToUserDefautls(self.flashMode) + } + } + + public class func isAvailable() -> Bool { + return UIImagePickerController.isSourceTypeAvailable(.Camera) + } + + /// Determines whether or not the rotation is enabled. + public var allowsRotate = false + + public let captureSession = AVCaptureSession() + public var previewLayer: AVCaptureVideoPreviewLayer! + private var beginZoomScale: CGFloat = 1.0 + private var zoomScale: CGFloat = 1.0 + + public var currentDevice: AVCaptureDevice? + public var captureDeviceFront: AVCaptureDevice? + public var captureDeviceBack: AVCaptureDevice? + private weak var stillImageOutput: AVCaptureStillImageOutput? + + public var contentView = UIView() + + public var originalOrientation: UIDeviceOrientation! + public var currentOrientation: UIDeviceOrientation! + public let motionManager = CMMotionManager() + + public lazy var flashButton: UIButton = { + let flashButton = UIButton() + flashButton.addTarget(self, action: #selector(DKCamera.switchFlashMode), forControlEvents: .TouchUpInside) + + return flashButton + }() + public var cameraSwitchButton: UIButton! + + + override public func viewDidLoad() { + super.viewDidLoad() + + self.setupDevices() + self.setupUI() + self.beginSession() + + self.setupMotionManager() + } + + public override func viewWillAppear(animated: Bool) { + super.viewWillAppear(animated) + + if !self.captureSession.running { + self.captureSession.startRunning() + } + + if !self.motionManager.accelerometerActive { + self.motionManager.startAccelerometerUpdatesToQueue(NSOperationQueue.currentQueue()!, withHandler: { accelerometerData, error in + if error == nil { + let currentOrientation = accelerometerData!.acceleration.toDeviceOrientation() ?? self.currentOrientation + if self.originalOrientation == nil { + self.initialOriginalOrientationForOrientation() + self.currentOrientation = self.originalOrientation + } + if let currentOrientation = currentOrientation where self.currentOrientation != currentOrientation { + self.currentOrientation = currentOrientation + self.updateContentLayoutForCurrentOrientation() + } + } else { + print("error while update accelerometer: \(error!.localizedDescription)", terminator: "") + } + }) + } + + } + + public override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + + if self.originalOrientation == nil { + self.contentView.frame = self.view.bounds + self.previewLayer.frame = self.view.bounds + } + } + + public override func viewDidDisappear(animated: Bool) { + super.viewDidDisappear(animated) + + self.captureSession.stopRunning() + self.motionManager.stopAccelerometerUpdates() + } + + override public func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + public override func prefersStatusBarHidden() -> Bool { + return true + } + + public func setupDevices() { + let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) as! [AVCaptureDevice] + + for device in devices { + if device.position == .Back { + self.captureDeviceBack = device + } + + if device.position == .Front { + self.captureDeviceFront = device + } + } + + self.currentDevice = self.captureDeviceBack ?? self.captureDeviceFront + } + + let bottomView = UIView() + + public func setupUI() { + self.view.backgroundColor = UIColor.blackColor() + self.view.addSubview(self.contentView) + self.contentView.backgroundColor = UIColor.clearColor() + self.contentView.frame = self.view.bounds + + let bottomViewHeight: CGFloat = 70 + bottomView.bounds.size = CGSize(width: contentView.bounds.width, height: bottomViewHeight) + bottomView.frame.origin = CGPoint(x: 0, y: contentView.bounds.height - bottomViewHeight) + bottomView.autoresizingMask = [.FlexibleWidth, .FlexibleTopMargin] + bottomView.backgroundColor = UIColor(white: 0, alpha: 0.4) + contentView.addSubview(bottomView) + + // switch button + let cameraSwitchButton: UIButton = { + let cameraSwitchButton = UIButton() + cameraSwitchButton.addTarget(self, action: #selector(DKCamera.switchCamera), forControlEvents: .TouchUpInside) + cameraSwitchButton.setImage(DKCameraResource.cameraSwitchImage(), forState: .Normal) + cameraSwitchButton.sizeToFit() + + return cameraSwitchButton + }() + + cameraSwitchButton.frame.origin = CGPoint(x: bottomView.bounds.width - cameraSwitchButton.bounds.width - 15, + y: (bottomView.bounds.height - cameraSwitchButton.bounds.height) / 2) + cameraSwitchButton.autoresizingMask = [.FlexibleLeftMargin, .FlexibleTopMargin, .FlexibleBottomMargin] + bottomView.addSubview(cameraSwitchButton) + self.cameraSwitchButton = cameraSwitchButton + + // capture button + let captureButton: UIButton = { + + class DKCaptureButton: UIButton { + private override func beginTrackingWithTouch(touch: UITouch, withEvent event: UIEvent?) -> Bool { + self.backgroundColor = UIColor.whiteColor() + return true + } + + private override func continueTrackingWithTouch(touch: UITouch, withEvent event: UIEvent?) -> Bool { + self.backgroundColor = UIColor.whiteColor() + return true + } + + private override func endTrackingWithTouch(touch: UITouch?, withEvent event: UIEvent?) { + self.backgroundColor = nil + } + + private override func cancelTrackingWithEvent(event: UIEvent?) { + self.backgroundColor = nil + } + } + + let captureButton = DKCaptureButton() + captureButton.addTarget(self, action: #selector(DKCamera.takePicture), forControlEvents: .TouchUpInside) + captureButton.bounds.size = CGSizeApplyAffineTransform(CGSize(width: bottomViewHeight, + height: bottomViewHeight), CGAffineTransformMakeScale(0.9, 0.9)) + captureButton.layer.cornerRadius = captureButton.bounds.height / 2 + captureButton.layer.borderColor = UIColor.whiteColor().CGColor + captureButton.layer.borderWidth = 2 + captureButton.layer.masksToBounds = true + + return captureButton + }() + + captureButton.center = CGPoint(x: bottomView.bounds.width / 2, y: bottomView.bounds.height / 2) + captureButton.autoresizingMask = [.FlexibleLeftMargin, .FlexibleRightMargin] + bottomView.addSubview(captureButton) + + // cancel button + let cancelButton: UIButton = { + let cancelButton = UIButton() + cancelButton.addTarget(self, action: #selector(DKCamera.dismiss), forControlEvents: .TouchUpInside) + cancelButton.setImage(DKCameraResource.cameraCancelImage(), forState: .Normal) + cancelButton.sizeToFit() + + return cancelButton + }() + + cancelButton.frame.origin = CGPoint(x: contentView.bounds.width - cancelButton.bounds.width - 15, y: 25) + cancelButton.autoresizingMask = [.FlexibleBottomMargin, .FlexibleLeftMargin] + contentView.addSubview(cancelButton) + + self.flashButton.frame.origin = CGPoint(x: 5, y: 15) + contentView.addSubview(self.flashButton) + + contentView.addGestureRecognizer(UIPinchGestureRecognizer(target: self, action: #selector(DKCamera.handleZoom(_:)))) + contentView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(DKCamera.handleFocus(_:)))) + } + + // MARK: - Callbacks + + internal func dismiss() { + self.didCancel?() + } + + public func takePicture() { + let authStatus = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo) + if authStatus == .Denied { + return + } + + if let stillImageOutput = self.stillImageOutput { + dispatch_async(dispatch_get_global_queue(0, 0), { + let connection = stillImageOutput.connectionWithMediaType(AVMediaTypeVideo) + if connection == nil { + return + } + + connection.videoOrientation = self.currentOrientation.toAVCaptureVideoOrientation() + connection.videoScaleAndCropFactor = self.zoomScale + + stillImageOutput.captureStillImageAsynchronouslyFromConnection(connection, completionHandler: { (imageDataSampleBuffer, error: NSError?) -> Void in + + if error == nil { + let imageData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(imageDataSampleBuffer) + + if let didFinishCapturingImage = self.didFinishCapturingImage, image = UIImage(data: imageData) { + didFinishCapturingImage(image: image) + } + } else { + print("error while capturing still image: \(error!.localizedDescription)", terminator: "") + } + }) + }) + } + + } + + // MARK: - Handles Zoom + + public func handleZoom(gesture: UIPinchGestureRecognizer) { + if gesture.state == .Began { + self.beginZoomScale = self.zoomScale + } else if gesture.state == .Changed { + self.zoomScale = min(4.0, max(1.0, self.beginZoomScale * gesture.scale)) + CATransaction.begin() + CATransaction.setAnimationDuration(0.025) + self.previewLayer.setAffineTransform(CGAffineTransformMakeScale(self.zoomScale, self.zoomScale)) + CATransaction.commit() + } + } + + // MARK: - Handles Focus + + public func handleFocus(gesture: UITapGestureRecognizer) { + if let currentDevice = self.currentDevice where currentDevice.focusPointOfInterestSupported { + let touchPoint = gesture.locationInView(self.view) + self.focusAtTouchPoint(touchPoint) + } + } + + // MARK: - Handles Switch Camera + + internal func switchCamera() { + self.currentDevice = self.currentDevice == self.captureDeviceBack ? + self.captureDeviceFront : self.captureDeviceBack + + self.setupCurrentDevice(); + } + + // MARK: - Handles Flash + + internal func switchFlashMode() { + switch self.flashMode! { + case .Auto: + self.flashMode = .Off + case .On: + self.flashMode = .Auto + case .Off: + self.flashMode = .On + } + } + + public func flashModeFromUserDefaults() -> AVCaptureFlashMode { + let rawValue = NSUserDefaults.standardUserDefaults().integerForKey("DKCamera.flashMode") + return AVCaptureFlashMode(rawValue: rawValue)! + } + + public func updateFlashModeToUserDefautls(flashMode: AVCaptureFlashMode) { + NSUserDefaults.standardUserDefaults().setInteger(flashMode.rawValue, forKey: "DKCamera.flashMode") + } + + public func updateFlashButton() { + struct FlashImage { + + static let images = [ + AVCaptureFlashMode.Auto : DKCameraResource.cameraFlashAutoImage(), + AVCaptureFlashMode.On : DKCameraResource.cameraFlashOnImage(), + AVCaptureFlashMode.Off : DKCameraResource.cameraFlashOffImage() + ] + + } + let flashImage: UIImage = FlashImage.images[self.flashMode]! + + self.flashButton.setImage(flashImage, forState: .Normal) + self.flashButton.sizeToFit() + } + + // MARK: - Capture Session + + public func beginSession() { + self.captureSession.sessionPreset = AVCaptureSessionPresetHigh + + self.setupCurrentDevice() + + let stillImageOutput = AVCaptureStillImageOutput() + if self.captureSession.canAddOutput(stillImageOutput) { + self.captureSession.addOutput(stillImageOutput) + self.stillImageOutput = stillImageOutput + } + + self.previewLayer = AVCaptureVideoPreviewLayer(session: self.captureSession) + self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspect + self.previewLayer.frame = self.view.bounds + + let rootLayer = self.view.layer + rootLayer.masksToBounds = true + rootLayer.insertSublayer(self.previewLayer, atIndex: 0) + } + + public func setupCurrentDevice() { + if let currentDevice = self.currentDevice { + + if currentDevice.flashAvailable { + self.flashButton.hidden = false + self.flashMode = self.flashModeFromUserDefaults() + } else { + self.flashButton.hidden = true + } + + for oldInput in self.captureSession.inputs as! [AVCaptureInput] { + self.captureSession.removeInput(oldInput) + } + + let frontInput = try? AVCaptureDeviceInput(device: self.currentDevice) + if self.captureSession.canAddInput(frontInput) { + self.captureSession.addInput(frontInput) + } + + try! currentDevice.lockForConfiguration() + if currentDevice.isFocusModeSupported(.ContinuousAutoFocus) { + currentDevice.focusMode = .ContinuousAutoFocus + } + + if currentDevice.isExposureModeSupported(.ContinuousAutoExposure) { + currentDevice.exposureMode = .ContinuousAutoExposure + } + + currentDevice.unlockForConfiguration() + } + } + + public func updateFlashMode() { + if let currentDevice = self.currentDevice + where currentDevice.flashAvailable { + try! currentDevice.lockForConfiguration() + currentDevice.flashMode = self.flashMode + currentDevice.unlockForConfiguration() + } + } + + public func focusAtTouchPoint(touchPoint: CGPoint) { + + func showFocusViewAtPoint(touchPoint: CGPoint) { + + struct FocusView { + static let focusView: UIView = { + let focusView = UIView() + let diameter: CGFloat = 100 + focusView.bounds.size = CGSize(width: diameter, height: diameter) + focusView.layer.borderWidth = 2 + focusView.layer.cornerRadius = diameter / 2 + focusView.layer.borderColor = UIColor.whiteColor().CGColor + + return focusView + }() + } + FocusView.focusView.transform = CGAffineTransformIdentity + FocusView.focusView.center = touchPoint + self.view.addSubview(FocusView.focusView) + UIView.animateWithDuration(0.7, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 1.1, + options: .CurveEaseInOut, animations: { () -> Void in + FocusView.focusView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.6, 0.6) + }) { (Bool) -> Void in + FocusView.focusView.removeFromSuperview() + } + } + + if self.currentDevice == nil || self.currentDevice?.flashAvailable == false { + return + } + + let focusPoint = self.previewLayer.captureDevicePointOfInterestForPoint(touchPoint) + + showFocusViewAtPoint(touchPoint) + + if let currentDevice = self.currentDevice { + try! currentDevice.lockForConfiguration() + currentDevice.focusPointOfInterest = focusPoint + currentDevice.exposurePointOfInterest = focusPoint + + currentDevice.focusMode = .ContinuousAutoFocus + + if currentDevice.isExposureModeSupported(.ContinuousAutoExposure) { + currentDevice.exposureMode = .ContinuousAutoExposure + } + + currentDevice.unlockForConfiguration() + } + + } + + // MARK: - Handles Orientation + + public override func shouldAutorotate() -> Bool { + return false + } + + public func setupMotionManager() { + self.motionManager.accelerometerUpdateInterval = 0.5 + self.motionManager.gyroUpdateInterval = 0.5 + } + + public func initialOriginalOrientationForOrientation() { + self.originalOrientation = UIApplication.sharedApplication().statusBarOrientation.toDeviceOrientation() + if let connection = self.previewLayer.connection { + connection.videoOrientation = self.originalOrientation.toAVCaptureVideoOrientation() + } + } + + public func updateContentLayoutForCurrentOrientation() { + let newAngle = self.currentOrientation.toAngleRelativeToPortrait() - self.originalOrientation.toAngleRelativeToPortrait() + + if self.allowsRotate { + var contentViewNewSize: CGSize! + let width = self.view.bounds.width + let height = self.view.bounds.height + if UIDeviceOrientationIsLandscape(self.currentOrientation) { + contentViewNewSize = CGSize(width: max(width, height), height: min(width, height)) + } else { + contentViewNewSize = CGSize(width: min(width, height), height: max(width, height)) + } + + UIView.animateWithDuration(0.2) { + self.contentView.bounds.size = contentViewNewSize + self.contentView.transform = CGAffineTransformMakeRotation(newAngle) + } + } else { + let rotateAffineTransform = CGAffineTransformRotate(CGAffineTransformIdentity, newAngle) + + UIView.animateWithDuration(0.2) { + self.flashButton.transform = rotateAffineTransform + self.cameraSwitchButton.transform = rotateAffineTransform + } + } + } + +} + +// MARK: - Utilities + +public extension UIInterfaceOrientation { + + func toDeviceOrientation() -> UIDeviceOrientation { + switch self { + case .Portrait: + return .Portrait + case .PortraitUpsideDown: + return .PortraitUpsideDown + case .LandscapeRight: + return .LandscapeLeft + case .LandscapeLeft: + return .LandscapeRight + default: + return .Portrait + } + } +} + +public extension UIDeviceOrientation { + + func toAVCaptureVideoOrientation() -> AVCaptureVideoOrientation { + switch self { + case .Portrait: + return .Portrait + case .PortraitUpsideDown: + return .PortraitUpsideDown + case .LandscapeRight: + return .LandscapeLeft + case .LandscapeLeft: + return .LandscapeRight + default: + return .Portrait + } + } + + func toInterfaceOrientationMask() -> UIInterfaceOrientationMask { + switch self { + case .Portrait: + return .Portrait + case .PortraitUpsideDown: + return .PortraitUpsideDown + case .LandscapeRight: + return .LandscapeLeft + case .LandscapeLeft: + return .LandscapeRight + default: + return .Portrait + } + } + + func toAngleRelativeToPortrait() -> CGFloat { + switch self { + case .Portrait: + return 0 + case .PortraitUpsideDown: + return CGFloat(M_PI) + case .LandscapeRight: + return CGFloat(-M_PI_2) + case .LandscapeLeft: + return CGFloat(M_PI_2) + default: + return 0 + } + } + +} + +public extension CMAcceleration { + func toDeviceOrientation() -> UIDeviceOrientation? { + if self.x >= 0.75 { + return .LandscapeRight + } else if self.x <= -0.75 { + return .LandscapeLeft + } else if self.y <= -0.75 { + return .Portrait + } else if self.y >= 0.75 { + return .PortraitUpsideDown + } else { + return nil + } + } +} + +// MARK: - Rersources + +public extension NSBundle { + + class func cameraBundle() -> NSBundle { + let assetPath = NSBundle(forClass: DKCameraResource.self).resourcePath! + return NSBundle(path: (assetPath as NSString).stringByAppendingPathComponent("DKCameraResource.bundle"))! + } + +} + +public class DKCameraResource { + + public class func imageForResource(name: String) -> UIImage { + let bundle = NSBundle.cameraBundle() + let imagePath = bundle.pathForResource(name, ofType: "png", inDirectory: "Images") + let image = UIImage(contentsOfFile: imagePath!) + return image! + } + + class func cameraCancelImage() -> UIImage { + return imageForResource("camera_cancel") + } + + class func cameraFlashOnImage() -> UIImage { + return imageForResource("camera_flash_on") + } + + class func cameraFlashAutoImage() -> UIImage { + return imageForResource("camera_flash_auto") + } + + class func cameraFlashOffImage() -> UIImage { + return imageForResource("camera_flash_off") + } + + class func cameraSwitchImage() -> UIImage { + return imageForResource("camera_switch") + } + +} + diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_cancel.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_cancel.png new file mode 100644 index 0000000..72eba5e Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_cancel.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_cancel@2x.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_cancel@2x.png new file mode 100644 index 0000000..81d1d27 Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_cancel@2x.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_cancel@3x.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_cancel@3x.png new file mode 100644 index 0000000..e172691 Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_cancel@3x.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_auto.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_auto.png new file mode 100644 index 0000000..a084317 Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_auto.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_auto@2x.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_auto@2x.png new file mode 100644 index 0000000..d7a8bb2 Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_auto@2x.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_auto@3x.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_auto@3x.png new file mode 100644 index 0000000..883b22a Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_auto@3x.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_off.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_off.png new file mode 100644 index 0000000..01d1e58 Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_off.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_off@2x.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_off@2x.png new file mode 100644 index 0000000..83c303d Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_off@2x.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_off@3x.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_off@3x.png new file mode 100644 index 0000000..bd2df9e Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_off@3x.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_on.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_on.png new file mode 100644 index 0000000..ad9a186 Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_on.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_on@2x.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_on@2x.png new file mode 100644 index 0000000..08d37a4 Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_on@2x.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_on@3x.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_on@3x.png new file mode 100644 index 0000000..cbf8563 Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_flash_on@3x.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_switch.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_switch.png new file mode 100644 index 0000000..3b4af0e Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_switch.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_switch@2x.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_switch@2x.png new file mode 100644 index 0000000..8224ee8 Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_switch@2x.png differ diff --git a/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_switch@3x.png b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_switch@3x.png new file mode 100644 index 0000000..d09c797 Binary files /dev/null and b/Pods/DKCamera/DKCamera/DKCameraResource.bundle/Images/camera_switch@3x.png differ diff --git a/Pods/DKCamera/LICENSE b/Pods/DKCamera/LICENSE new file mode 100644 index 0000000..29967db --- /dev/null +++ b/Pods/DKCamera/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Bannings + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/Pods/DKCamera/README.md b/Pods/DKCamera/README.md new file mode 100644 index 0000000..5386bbb --- /dev/null +++ b/Pods/DKCamera/README.md @@ -0,0 +1,82 @@ +DKCamera +======================= + + [![Build Status](https://secure.travis-ci.org/zhangao0086/DKCamera.svg)](http://travis-ci.org/zhangao0086/DKCamera) [![Version Status](http://img.shields.io/cocoapods/v/DKCamera.png)][docsLink] [![license MIT](http://img.shields.io/badge/license-MIT-orange.png)][mitLink] + +--- + +--- +## Description +A light weight & simple & easy camera for iOS by Swift. It uses `CoreMotion` framework to detect device orientation, so the screen-orientation lock will be ignored(*Perfect orientation handling*). And it has two other purposes: + +* Can be presenting or pushing or Integrating. +* Suppressing the warning **"Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates."**(It seems a bug in iOS 8). + +## Requirements +* iOS 7.1+ +* ARC + +## Installation +#### iOS 8 and newer +DKCamera is available on CocoaPods. Simply add the following line to your podfile: + +```ruby +# For latest release in cocoapods +pod 'DKCamera' +``` + +#### iOS 7.x +To use Swift libraries on apps that support iOS 7, you must manually copy the files into your application project. +[CocoaPods only supports Swift on OS X 10.9 and newer, and iOS 8 and newer.](https://github.com/CocoaPods/blog.cocoapods.org/commit/6933ae5ccfc1e0b39dd23f4ec67d7a083975836d) + +## Easy to use + +```swift +let camera = DKCamera() + +camera.didCancel = { () in + print("didCancel") + + self.dismissViewControllerAnimated(true, completion: nil) +} + +camera.didFinishCapturingImage = {(image: UIImage) in + print("didFinishCapturingImage") + print(image) + + self.dismissViewControllerAnimated(true, completion: nil) +} +self.presentViewController(camera, animated: true, completion: nil) + +```` + +### You also can use these APIs: + +```swift +public var cameraOverlayView: UIView? + +/// The flashModel will to be remembered to next use. +public var flashMode:AVCaptureFlashMode = .Auto + +public class func isAvailable() -> Bool + +/// Determines whether or not the rotation is enabled. +public var allowsRotate = false +``` + +> If you are going to add a full-screen view as `cameraOverlayView`, maybe you should use the `DKCameraPassthroughView` or its subclass that have overriden the `hitTest` method in order to the event passes through to the expected view. +```swift +// DKCamera.swift +public class DKCameraPassthroughView: UIView { + public override func hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? { + let hitTestingView = super.hitTest(point, withEvent: event) + return hitTestingView == self ? nil : hitTestingView + } +} +``` + +## License +DKCamera is released under the MIT license. See LICENSE for details. + +[docsLink]:http://cocoadocs.org/docsets/DKCamera +[mitLink]:http://opensource.org/licenses/MIT diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock new file mode 100644 index 0000000..a5d6616 --- /dev/null +++ b/Pods/Manifest.lock @@ -0,0 +1,15 @@ +PODS: + - CameraManager (2.2.4) + - DKCamera (1.2.9) + +DEPENDENCIES: + - CameraManager (~> 2.2) + - DKCamera + +SPEC CHECKSUMS: + CameraManager: 761f0d3dca325e8dabd46065f0b376798bca66bf + DKCamera: a070bfb4d4b1cafae3816270a35536ff61a9329a + +PODFILE CHECKSUM: e047c2ab0e5fdb550503f6f401e86d1a61e7ec70 + +COCOAPODS: 1.0.1 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8fe9590 --- /dev/null +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,716 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 0821C839B9D9116E03C0C9B51E136144 /* DKCamera-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 15D0215FCFEB74397404CA052060345C /* DKCamera-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 11417F7E0087C4BB8FC52A509FD63D32 /* DKCamera.swift in Sources */ = {isa = PBXBuildFile; fileRef = D85D4F63D5F33E4860BBA6FE3B841F0A /* DKCamera.swift */; }; + 249F49EB0C3FA3169F121332742466E9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2BC394B3E1DE5C0886B04D0E9C29020 /* Foundation.framework */; }; + 439D6AE635FEC171B5D3A5E7ED205154 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2BC394B3E1DE5C0886B04D0E9C29020 /* Foundation.framework */; }; + 755D27DCC46E3C4C63DA379BF7D27487 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC72C95DDC5703A67DA8DB5C57BF4C5D /* AVFoundation.framework */; }; + 7911E332FBF990ED422F3AF1A64EDC18 /* Pods-MapProj-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8CE6199AA3F0194A670CE250B551CD /* Pods-MapProj-dummy.m */; }; + 8BB94131FF51F686744BD0D2CC36D28C /* DKCameraResource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 175D7BE7B6A10EE83C4AE517AEF5FA67 /* DKCameraResource.bundle */; }; + A19EC195A24B7788935653C989BDB81A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6677370C58FC14BF5B45C8273DAC20F /* UIKit.framework */; }; + CB7193E4244317AFC796BB540A207B56 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2BC394B3E1DE5C0886B04D0E9C29020 /* Foundation.framework */; }; + D7F2E479B0D83262BAAE4343AA2E9611 /* Pods-MapProj-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = AC147CC81D2BC29EC99A0EF3F55D2013 /* Pods-MapProj-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D9AA4190BA6CB567F8087104C9B8D6CD /* DKCamera-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E356C03904355581B30E4FC0B127ACC1 /* DKCamera-dummy.m */; }; + DC178BDED25CC834988588370C9B8AB6 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA526B0D319CCD8F98FC7233B4942EE7 /* CoreMotion.framework */; }; + DD42352B5C03C87D2AF000F5FC8B36ED /* CameraManager-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 965F774500E06567BCB8B7DCDD4FAB14 /* CameraManager-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DE931211EF2B4A50DC6AF38F6D27E1EA /* CameraManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2A5D2782E0AEB3AC2CF463E05ACE388 /* CameraManager.swift */; }; + EDC504771867DAEBD8D80AD3EA2E6BFC /* CameraManager-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 496CD4ECE120258BAFD7204147493A30 /* CameraManager-dummy.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 43FEFAAD26DF478D751B99215A207A9D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 948A46EC641E4DA25A0C1AA1762AF963; + remoteInfo = DKCamera; + }; + 89CF9B9A09375C500AE429AE1834D0EF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4FEFFF8BCFFF25082AF4A867552C5F52; + remoteInfo = CameraManager; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 15D0215FCFEB74397404CA052060345C /* DKCamera-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "DKCamera-umbrella.h"; sourceTree = ""; }; + 175D7BE7B6A10EE83C4AE517AEF5FA67 /* DKCameraResource.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = DKCameraResource.bundle; path = DKCamera/DKCameraResource.bundle; sourceTree = ""; }; + 2186FB09E39A7290B01D7CBA24CDEFC0 /* DKCamera.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = DKCamera.modulemap; sourceTree = ""; }; + 2E8CE6199AA3F0194A670CE250B551CD /* Pods-MapProj-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-MapProj-dummy.m"; sourceTree = ""; }; + 43298A0848F5BB59958834207FC4A575 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 45799A18C185D1B0B6E06113ABB4C93C /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 496CD4ECE120258BAFD7204147493A30 /* CameraManager-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "CameraManager-dummy.m"; sourceTree = ""; }; + 5980591A41FB8935A009D3B49CB8BD50 /* Pods-MapProj.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MapProj.debug.xcconfig"; sourceTree = ""; }; + 5A2FF84E7FED2B05C0C590891D4F9726 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5E840D95452E063AB0879A2FE56EE784 /* Pods-MapProj-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MapProj-acknowledgements.plist"; sourceTree = ""; }; + 682947F0434A5581982073A5CAE88BE9 /* CameraManager-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "CameraManager-prefix.pch"; sourceTree = ""; }; + 6B8122515185F4AFB25E21056E1AE589 /* DKCamera-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "DKCamera-prefix.pch"; sourceTree = ""; }; + 75AAE2D86AA132494BE43F80270A4C57 /* Pods-MapProj-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-MapProj-acknowledgements.markdown"; sourceTree = ""; }; + 837149CED4BF7D274803182FA8500188 /* DKCamera.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DKCamera.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 965F774500E06567BCB8B7DCDD4FAB14 /* CameraManager-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "CameraManager-umbrella.h"; sourceTree = ""; }; + 9D079EFE5E031AF36272A944E48FF7F3 /* Pods_MapProj.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MapProj.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9F227686DB05CD234B36476FFA294FE5 /* Pods-MapProj.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-MapProj.modulemap"; sourceTree = ""; }; + 9F57DC691E21E3AFF8D3605E377B2528 /* CameraManager.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = CameraManager.xcconfig; sourceTree = ""; }; + A6677370C58FC14BF5B45C8273DAC20F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + AC147CC81D2BC29EC99A0EF3F55D2013 /* Pods-MapProj-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-MapProj-umbrella.h"; sourceTree = ""; }; + B2A5D2782E0AEB3AC2CF463E05ACE388 /* CameraManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CameraManager.swift; path = camera/CameraManager.swift; sourceTree = ""; }; + BAE00B4921B0A887F0CA5CC5B4699F23 /* DKCamera.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = DKCamera.xcconfig; sourceTree = ""; }; + BE5B212FDD35C324C3ECE0D736D5B63A /* Pods-MapProj-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MapProj-resources.sh"; sourceTree = ""; }; + CA526B0D319CCD8F98FC7233B4942EE7 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; }; + CCFB7D326F9EF8B7C798146A4B0CD579 /* CameraManager.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CameraManager.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D2C70514979120F84C109DE0572052F2 /* Pods-MapProj.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MapProj.release.xcconfig"; sourceTree = ""; }; + D3A87C95EA4542C8C4D0634A85A98CCE /* Pods-MapProj-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MapProj-frameworks.sh"; sourceTree = ""; }; + D85D4F63D5F33E4860BBA6FE3B841F0A /* DKCamera.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DKCamera.swift; path = DKCamera/DKCamera.swift; sourceTree = ""; }; + E356C03904355581B30E4FC0B127ACC1 /* DKCamera-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "DKCamera-dummy.m"; sourceTree = ""; }; + F2BC394B3E1DE5C0886B04D0E9C29020 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + F9C7FEEB8FE22182CC5F731440815217 /* CameraManager.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = CameraManager.modulemap; sourceTree = ""; }; + FC72C95DDC5703A67DA8DB5C57BF4C5D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3700EEB15CA0A539840DDB97213DEA85 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 249F49EB0C3FA3169F121332742466E9 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 686B7EBCE4CD7EE8695FE0004B2CE2BC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 755D27DCC46E3C4C63DA379BF7D27487 /* AVFoundation.framework in Frameworks */, + DC178BDED25CC834988588370C9B8AB6 /* CoreMotion.framework in Frameworks */, + 439D6AE635FEC171B5D3A5E7ED205154 /* Foundation.framework in Frameworks */, + A19EC195A24B7788935653C989BDB81A /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F8BC9BCCCE3FE129CF8EAEB5DDC54E49 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CB7193E4244317AFC796BB540A207B56 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 14B8B9B15ECBE87983FF987239AB2D7B /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6C6B47F0278F250814D006DAD71D3BAD /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + 454AFA13480837D0DAD564C2183F0F19 /* DKCamera */ = { + isa = PBXGroup; + children = ( + D85D4F63D5F33E4860BBA6FE3B841F0A /* DKCamera.swift */, + 57D305BF18D1214D50D1C91B7396AA1D /* Resources */, + E3C67913E61FFE9BC2D7F5412CE7883D /* Support Files */, + ); + path = DKCamera; + sourceTree = ""; + }; + 57D305BF18D1214D50D1C91B7396AA1D /* Resources */ = { + isa = PBXGroup; + children = ( + 175D7BE7B6A10EE83C4AE517AEF5FA67 /* DKCameraResource.bundle */, + ); + name = Resources; + sourceTree = ""; + }; + 6C6B47F0278F250814D006DAD71D3BAD /* iOS */ = { + isa = PBXGroup; + children = ( + FC72C95DDC5703A67DA8DB5C57BF4C5D /* AVFoundation.framework */, + CA526B0D319CCD8F98FC7233B4942EE7 /* CoreMotion.framework */, + F2BC394B3E1DE5C0886B04D0E9C29020 /* Foundation.framework */, + A6677370C58FC14BF5B45C8273DAC20F /* UIKit.framework */, + ); + name = iOS; + sourceTree = ""; + }; + 7374737518B9F651B9433F55A7EDDCE6 /* Pods-MapProj */ = { + isa = PBXGroup; + children = ( + 5A2FF84E7FED2B05C0C590891D4F9726 /* Info.plist */, + 9F227686DB05CD234B36476FFA294FE5 /* Pods-MapProj.modulemap */, + 75AAE2D86AA132494BE43F80270A4C57 /* Pods-MapProj-acknowledgements.markdown */, + 5E840D95452E063AB0879A2FE56EE784 /* Pods-MapProj-acknowledgements.plist */, + 2E8CE6199AA3F0194A670CE250B551CD /* Pods-MapProj-dummy.m */, + D3A87C95EA4542C8C4D0634A85A98CCE /* Pods-MapProj-frameworks.sh */, + BE5B212FDD35C324C3ECE0D736D5B63A /* Pods-MapProj-resources.sh */, + AC147CC81D2BC29EC99A0EF3F55D2013 /* Pods-MapProj-umbrella.h */, + 5980591A41FB8935A009D3B49CB8BD50 /* Pods-MapProj.debug.xcconfig */, + D2C70514979120F84C109DE0572052F2 /* Pods-MapProj.release.xcconfig */, + ); + name = "Pods-MapProj"; + path = "Target Support Files/Pods-MapProj"; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, + 14B8B9B15ECBE87983FF987239AB2D7B /* Frameworks */, + C7C635CBFA6A515D0005619179D5213F /* Pods */, + E34C58259CFB3F214F5C9350BC0ADFE0 /* Products */, + 98E75E39DE8EDDBEB23CB732AB89EA72 /* Targets Support Files */, + ); + sourceTree = ""; + }; + 98E75E39DE8EDDBEB23CB732AB89EA72 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 7374737518B9F651B9433F55A7EDDCE6 /* Pods-MapProj */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + C7C635CBFA6A515D0005619179D5213F /* Pods */ = { + isa = PBXGroup; + children = ( + EADE713A8B93E03E73F64E7DA6D102E9 /* CameraManager */, + 454AFA13480837D0DAD564C2183F0F19 /* DKCamera */, + ); + name = Pods; + sourceTree = ""; + }; + E34C58259CFB3F214F5C9350BC0ADFE0 /* Products */ = { + isa = PBXGroup; + children = ( + CCFB7D326F9EF8B7C798146A4B0CD579 /* CameraManager.framework */, + 837149CED4BF7D274803182FA8500188 /* DKCamera.framework */, + 9D079EFE5E031AF36272A944E48FF7F3 /* Pods_MapProj.framework */, + ); + name = Products; + sourceTree = ""; + }; + E3C67913E61FFE9BC2D7F5412CE7883D /* Support Files */ = { + isa = PBXGroup; + children = ( + 2186FB09E39A7290B01D7CBA24CDEFC0 /* DKCamera.modulemap */, + BAE00B4921B0A887F0CA5CC5B4699F23 /* DKCamera.xcconfig */, + E356C03904355581B30E4FC0B127ACC1 /* DKCamera-dummy.m */, + 6B8122515185F4AFB25E21056E1AE589 /* DKCamera-prefix.pch */, + 15D0215FCFEB74397404CA052060345C /* DKCamera-umbrella.h */, + 43298A0848F5BB59958834207FC4A575 /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/DKCamera"; + sourceTree = ""; + }; + E74AA635149969924767C673F85BC44D /* Support Files */ = { + isa = PBXGroup; + children = ( + F9C7FEEB8FE22182CC5F731440815217 /* CameraManager.modulemap */, + 9F57DC691E21E3AFF8D3605E377B2528 /* CameraManager.xcconfig */, + 496CD4ECE120258BAFD7204147493A30 /* CameraManager-dummy.m */, + 682947F0434A5581982073A5CAE88BE9 /* CameraManager-prefix.pch */, + 965F774500E06567BCB8B7DCDD4FAB14 /* CameraManager-umbrella.h */, + 45799A18C185D1B0B6E06113ABB4C93C /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/CameraManager"; + sourceTree = ""; + }; + EADE713A8B93E03E73F64E7DA6D102E9 /* CameraManager */ = { + isa = PBXGroup; + children = ( + B2A5D2782E0AEB3AC2CF463E05ACE388 /* CameraManager.swift */, + E74AA635149969924767C673F85BC44D /* Support Files */, + ); + path = CameraManager; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 5FA47AB33592E3C69BB5111ABE57F760 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 0821C839B9D9116E03C0C9B51E136144 /* DKCamera-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C65E4D2098B0E49A1B4ACF531F5D22A2 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + DD42352B5C03C87D2AF000F5FC8B36ED /* CameraManager-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D19084013850A625C694767280816FFA /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D7F2E479B0D83262BAAE4343AA2E9611 /* Pods-MapProj-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 4FEFFF8BCFFF25082AF4A867552C5F52 /* CameraManager */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9642486B80581C5D8B6F6D16911D852B /* Build configuration list for PBXNativeTarget "CameraManager" */; + buildPhases = ( + BFFD3F6B1F5C779FB91D0262D6F1E06A /* Sources */, + F8BC9BCCCE3FE129CF8EAEB5DDC54E49 /* Frameworks */, + C65E4D2098B0E49A1B4ACF531F5D22A2 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CameraManager; + productName = CameraManager; + productReference = CCFB7D326F9EF8B7C798146A4B0CD579 /* CameraManager.framework */; + productType = "com.apple.product-type.framework"; + }; + 948A46EC641E4DA25A0C1AA1762AF963 /* DKCamera */ = { + isa = PBXNativeTarget; + buildConfigurationList = B90C555B6E5832D73F97789C04CC0D9E /* Build configuration list for PBXNativeTarget "DKCamera" */; + buildPhases = ( + 42CED2E9A32615C0F1CE24780E7D0AE3 /* Sources */, + 686B7EBCE4CD7EE8695FE0004B2CE2BC /* Frameworks */, + B1FCDB45F8E1477BD0371F2B7B4C9448 /* Resources */, + 5FA47AB33592E3C69BB5111ABE57F760 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DKCamera; + productName = DKCamera; + productReference = 837149CED4BF7D274803182FA8500188 /* DKCamera.framework */; + productType = "com.apple.product-type.framework"; + }; + B7C393A810B58CDB50A9A01A77A75A97 /* Pods-MapProj */ = { + isa = PBXNativeTarget; + buildConfigurationList = A5696EFEBA63C53CD26CFDA197A9ED2E /* Build configuration list for PBXNativeTarget "Pods-MapProj" */; + buildPhases = ( + 1E3A7D8BC67A02301AAD0A58431CA975 /* Sources */, + 3700EEB15CA0A539840DDB97213DEA85 /* Frameworks */, + D19084013850A625C694767280816FFA /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 984D9DFDE8D441D96DF56FE8EEFC0BFF /* PBXTargetDependency */, + F696317F460A4E2E19CAFE8711783C8F /* PBXTargetDependency */, + ); + name = "Pods-MapProj"; + productName = "Pods-MapProj"; + productReference = 9D079EFE5E031AF36272A944E48FF7F3 /* Pods_MapProj.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0730; + LastUpgradeCheck = 0700; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = E34C58259CFB3F214F5C9350BC0ADFE0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 4FEFFF8BCFFF25082AF4A867552C5F52 /* CameraManager */, + 948A46EC641E4DA25A0C1AA1762AF963 /* DKCamera */, + B7C393A810B58CDB50A9A01A77A75A97 /* Pods-MapProj */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B1FCDB45F8E1477BD0371F2B7B4C9448 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BB94131FF51F686744BD0D2CC36D28C /* DKCameraResource.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1E3A7D8BC67A02301AAD0A58431CA975 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7911E332FBF990ED422F3AF1A64EDC18 /* Pods-MapProj-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42CED2E9A32615C0F1CE24780E7D0AE3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D9AA4190BA6CB567F8087104C9B8D6CD /* DKCamera-dummy.m in Sources */, + 11417F7E0087C4BB8FC52A509FD63D32 /* DKCamera.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BFFD3F6B1F5C779FB91D0262D6F1E06A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EDC504771867DAEBD8D80AD3EA2E6BFC /* CameraManager-dummy.m in Sources */, + DE931211EF2B4A50DC6AF38F6D27E1EA /* CameraManager.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 984D9DFDE8D441D96DF56FE8EEFC0BFF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = CameraManager; + target = 4FEFFF8BCFFF25082AF4A867552C5F52 /* CameraManager */; + targetProxy = 89CF9B9A09375C500AE429AE1834D0EF /* PBXContainerItemProxy */; + }; + F696317F460A4E2E19CAFE8711783C8F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = DKCamera; + target = 948A46EC641E4DA25A0C1AA1762AF963 /* DKCamera */; + targetProxy = 43FEFAAD26DF478D751B99215A207A9D /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1817E052639FE66C2D18B5467C64B4EB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9F57DC691E21E3AFF8D3605E377B2528 /* CameraManager.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/CameraManager/CameraManager-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/CameraManager/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/CameraManager/CameraManager.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = CameraManager; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 3B25A386D12711F9D063820821508EB9 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5980591A41FB8935A009D3B49CB8BD50 /* Pods-MapProj.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-MapProj/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-MapProj/Pods-MapProj.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_MapProj; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 3C15B164C0C301A833ACA3FE70DCE773 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D2C70514979120F84C109DE0572052F2 /* Pods-MapProj.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-MapProj/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-MapProj/Pods-MapProj.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_MapProj; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 3FA451D268613890FA8A5A03801E11D5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + 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 = 9.3; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 4F71734E1F98418A1BD755B65AC5458F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9F57DC691E21E3AFF8D3605E377B2528 /* CameraManager.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/CameraManager/CameraManager-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/CameraManager/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/CameraManager/CameraManager.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = CameraManager; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 5E62115DE8C09934BF8D2FE5D15FED1E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + 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 = 9.3; + ONLY_ACTIVE_ARCH = YES; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + 8319BB9CE047CAFC39EBD9F18D577F4C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BAE00B4921B0A887F0CA5CC5B4699F23 /* DKCamera.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/DKCamera/DKCamera-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/DKCamera/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/DKCamera/DKCamera.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = DKCamera; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 860D69E2F7BE147BA25A84B3A879EF95 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BAE00B4921B0A887F0CA5CC5B4699F23 /* DKCamera.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/DKCamera/DKCamera-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/DKCamera/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/DKCamera/DKCamera.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = DKCamera; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5E62115DE8C09934BF8D2FE5D15FED1E /* Debug */, + 3FA451D268613890FA8A5A03801E11D5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9642486B80581C5D8B6F6D16911D852B /* Build configuration list for PBXNativeTarget "CameraManager" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4F71734E1F98418A1BD755B65AC5458F /* Debug */, + 1817E052639FE66C2D18B5467C64B4EB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A5696EFEBA63C53CD26CFDA197A9ED2E /* Build configuration list for PBXNativeTarget "Pods-MapProj" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3B25A386D12711F9D063820821508EB9 /* Debug */, + 3C15B164C0C301A833ACA3FE70DCE773 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B90C555B6E5832D73F97789C04CC0D9E /* Build configuration list for PBXNativeTarget "DKCamera" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 860D69E2F7BE147BA25A84B3A879EF95 /* Debug */, + 8319BB9CE047CAFC39EBD9F18D577F4C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/CameraManager.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/CameraManager.xcscheme new file mode 100644 index 0000000..564448a --- /dev/null +++ b/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/CameraManager.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/DKCamera.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/DKCamera.xcscheme new file mode 100644 index 0000000..27a02ea --- /dev/null +++ b/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/DKCamera.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/Pods-MapProj.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/Pods-MapProj.xcscheme new file mode 100644 index 0000000..887e3f5 --- /dev/null +++ b/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/Pods-MapProj.xcscheme @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/xcschememanagement.plist b/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..5b53670 --- /dev/null +++ b/Pods/Pods.xcodeproj/xcuserdata/Jordan.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,42 @@ + + + + + SchemeUserState + + CameraManager.xcscheme + + isShown + + + DKCamera.xcscheme + + isShown + + + Pods-MapProj.xcscheme + + isShown + + + + SuppressBuildableAutocreation + + 4FEFFF8BCFFF25082AF4A867552C5F52 + + primary + + + 948A46EC641E4DA25A0C1AA1762AF963 + + primary + + + B7C393A810B58CDB50A9A01A77A75A97 + + primary + + + + + diff --git a/Pods/Target Support Files/CameraManager/CameraManager-dummy.m b/Pods/Target Support Files/CameraManager/CameraManager-dummy.m new file mode 100644 index 0000000..87b5834 --- /dev/null +++ b/Pods/Target Support Files/CameraManager/CameraManager-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_CameraManager : NSObject +@end +@implementation PodsDummy_CameraManager +@end diff --git a/Pods/Target Support Files/CameraManager/CameraManager-prefix.pch b/Pods/Target Support Files/CameraManager/CameraManager-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Pods/Target Support Files/CameraManager/CameraManager-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Pods/Target Support Files/CameraManager/CameraManager-umbrella.h b/Pods/Target Support Files/CameraManager/CameraManager-umbrella.h new file mode 100644 index 0000000..260fefe --- /dev/null +++ b/Pods/Target Support Files/CameraManager/CameraManager-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double CameraManagerVersionNumber; +FOUNDATION_EXPORT const unsigned char CameraManagerVersionString[]; + diff --git a/Pods/Target Support Files/CameraManager/CameraManager.modulemap b/Pods/Target Support Files/CameraManager/CameraManager.modulemap new file mode 100644 index 0000000..ea79d05 --- /dev/null +++ b/Pods/Target Support Files/CameraManager/CameraManager.modulemap @@ -0,0 +1,6 @@ +framework module CameraManager { + umbrella header "CameraManager-umbrella.h" + + export * + module * { export * } +} diff --git a/Pods/Target Support Files/CameraManager/CameraManager.xcconfig b/Pods/Target Support Files/CameraManager/CameraManager.xcconfig new file mode 100644 index 0000000..0df9b21 --- /dev/null +++ b/Pods/Target Support Files/CameraManager/CameraManager.xcconfig @@ -0,0 +1,9 @@ +CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/CameraManager +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Pods/Target Support Files/CameraManager/Info.plist b/Pods/Target Support Files/CameraManager/Info.plist new file mode 100644 index 0000000..bb11c61 --- /dev/null +++ b/Pods/Target Support Files/CameraManager/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.2.4 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Pods/Target Support Files/DKCamera/DKCamera-dummy.m b/Pods/Target Support Files/DKCamera/DKCamera-dummy.m new file mode 100644 index 0000000..21e0f7e --- /dev/null +++ b/Pods/Target Support Files/DKCamera/DKCamera-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_DKCamera : NSObject +@end +@implementation PodsDummy_DKCamera +@end diff --git a/Pods/Target Support Files/DKCamera/DKCamera-prefix.pch b/Pods/Target Support Files/DKCamera/DKCamera-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Pods/Target Support Files/DKCamera/DKCamera-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Pods/Target Support Files/DKCamera/DKCamera-umbrella.h b/Pods/Target Support Files/DKCamera/DKCamera-umbrella.h new file mode 100644 index 0000000..3956123 --- /dev/null +++ b/Pods/Target Support Files/DKCamera/DKCamera-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double DKCameraVersionNumber; +FOUNDATION_EXPORT const unsigned char DKCameraVersionString[]; + diff --git a/Pods/Target Support Files/DKCamera/DKCamera.modulemap b/Pods/Target Support Files/DKCamera/DKCamera.modulemap new file mode 100644 index 0000000..6627c5e --- /dev/null +++ b/Pods/Target Support Files/DKCamera/DKCamera.modulemap @@ -0,0 +1,6 @@ +framework module DKCamera { + umbrella header "DKCamera-umbrella.h" + + export * + module * { export * } +} diff --git a/Pods/Target Support Files/DKCamera/DKCamera.xcconfig b/Pods/Target Support Files/DKCamera/DKCamera.xcconfig new file mode 100644 index 0000000..7e9e723 --- /dev/null +++ b/Pods/Target Support Files/DKCamera/DKCamera.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/DKCamera +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "AVFoundation" -framework "CoreMotion" -framework "Foundation" -framework "UIKit" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Pods/Target Support Files/DKCamera/Info.plist b/Pods/Target Support Files/DKCamera/Info.plist new file mode 100644 index 0000000..57e52a1 --- /dev/null +++ b/Pods/Target Support Files/DKCamera/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.2.9 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Pods/Target Support Files/Pods-MapProj/Info.plist b/Pods/Target Support Files/Pods-MapProj/Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Pods/Target Support Files/Pods-MapProj/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-acknowledgements.markdown b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-acknowledgements.markdown new file mode 100644 index 0000000..c8e089a --- /dev/null +++ b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-acknowledgements.markdown @@ -0,0 +1,50 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## CameraManager + +Camera Manager + +Copyright (c) 2014 ImaginaryCloud, imaginarycloud.com. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +## DKCamera + +The MIT License (MIT) + +Copyright (c) 2014 Bannings + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +Generated by CocoaPods - https://cocoapods.org diff --git a/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-acknowledgements.plist b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-acknowledgements.plist new file mode 100644 index 0000000..c979a0c --- /dev/null +++ b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-acknowledgements.plist @@ -0,0 +1,84 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Camera Manager + +Copyright (c) 2014 ImaginaryCloud, imaginarycloud.com. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + Title + CameraManager + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2014 Bannings + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + Title + DKCamera + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-dummy.m b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-dummy.m new file mode 100644 index 0000000..475debb --- /dev/null +++ b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_MapProj : NSObject +@end +@implementation PodsDummy_Pods_MapProj +@end diff --git a/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-frameworks.sh b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-frameworks.sh new file mode 100755 index 0000000..272e662 --- /dev/null +++ b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-frameworks.sh @@ -0,0 +1,93 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "$BUILT_PRODUCTS_DIR/CameraManager/CameraManager.framework" + install_framework "$BUILT_PRODUCTS_DIR/DKCamera/DKCamera.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "$BUILT_PRODUCTS_DIR/CameraManager/CameraManager.framework" + install_framework "$BUILT_PRODUCTS_DIR/DKCamera/DKCamera.framework" +fi diff --git a/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-resources.sh b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-resources.sh new file mode 100755 index 0000000..0a15615 --- /dev/null +++ b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-resources.sh @@ -0,0 +1,102 @@ +#!/bin/sh +set -e + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +realpath() { + DIRECTORY="$(cd "${1%/*}" && pwd)" + FILENAME="${1##*/}" + echo "$DIRECTORY/$FILENAME" +} + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-umbrella.h b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-umbrella.h new file mode 100644 index 0000000..88af75e --- /dev/null +++ b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double Pods_MapProjVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_MapProjVersionString[]; + diff --git a/Pods/Target Support Files/Pods-MapProj/Pods-MapProj.debug.xcconfig b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj.debug.xcconfig new file mode 100644 index 0000000..e8785b4 --- /dev/null +++ b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj.debug.xcconfig @@ -0,0 +1,10 @@ +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CameraManager" "$PODS_CONFIGURATION_BUILD_DIR/DKCamera" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CameraManager/CameraManager.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/DKCamera/DKCamera.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "CameraManager" -framework "DKCamera" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Pods/Target Support Files/Pods-MapProj/Pods-MapProj.modulemap b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj.modulemap new file mode 100644 index 0000000..b81fcb9 --- /dev/null +++ b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj.modulemap @@ -0,0 +1,6 @@ +framework module Pods_MapProj { + umbrella header "Pods-MapProj-umbrella.h" + + export * + module * { export * } +} diff --git a/Pods/Target Support Files/Pods-MapProj/Pods-MapProj.release.xcconfig b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj.release.xcconfig new file mode 100644 index 0000000..e8785b4 --- /dev/null +++ b/Pods/Target Support Files/Pods-MapProj/Pods-MapProj.release.xcconfig @@ -0,0 +1,10 @@ +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CameraManager" "$PODS_CONFIGURATION_BUILD_DIR/DKCamera" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CameraManager/CameraManager.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/DKCamera/DKCamera.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "CameraManager" -framework "DKCamera" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT}/Pods diff --git a/README.md b/README.md index dc7acda..ec65056 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,8 @@ Keep track of helpful resources/tutorials here: Camera: +SO - Overlay a Sticker in Camera +RW - UIGestureRecognizer (Swift 1) + +Text Overlay On Image diff --git a/TakeAPicture.swift b/TakeAPicture.swift new file mode 100644 index 0000000..ff688ed --- /dev/null +++ b/TakeAPicture.swift @@ -0,0 +1,31 @@ +// +// TakeAPictureWithARedPanda.swift +// MapProj +// +// Created by Jordan Kiley on 7/13/16. +// Copyright © 2016 Flatiron School. All rights reserved. +// + +import Foundation +import UIKit +import MobileCoreServices + +class TakeAPicture : UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { + + @IBOutlet weak var currentImage: UIImageView! + + + override func viewDidLoad() { + super.viewDidLoad() + + print("Hi!") + } + + + + + // func getPicture() + +} + +