From 9b2d0cbf13009b7fe7866140442298051a7d1bb9 Mon Sep 17 00:00:00 2001 From: Lex Tang Date: Thu, 9 Apr 2015 17:19:36 +0800 Subject: [PATCH] Now we can install this lib with Carthage. --- CameraManager/CameraManager.h | 19 ++ CameraManager/Info.plist | 26 +++ README.md | 33 ++-- camera.xcodeproj/project.pbxproj | 171 ++++++++++++++++++ .../xcschemes/CameraManager.xcscheme | 77 ++++++++ 5 files changed, 314 insertions(+), 12 deletions(-) create mode 100644 CameraManager/CameraManager.h create mode 100644 CameraManager/Info.plist create mode 100644 camera.xcodeproj/xcshareddata/xcschemes/CameraManager.xcscheme diff --git a/CameraManager/CameraManager.h b/CameraManager/CameraManager.h new file mode 100644 index 0000000..0a3ea86 --- /dev/null +++ b/CameraManager/CameraManager.h @@ -0,0 +1,19 @@ +// +// CameraManager.h +// CameraManager +// +// Created by Lex Tang on 4/9/15. +// Copyright (c) 2015 imaginaryCloud. All rights reserved. +// + +#import + +//! Project version number for CameraManager. +FOUNDATION_EXPORT double CameraManagerVersionNumber; + +//! Project version string for CameraManager. +FOUNDATION_EXPORT const unsigned char CameraManagerVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/CameraManager/Info.plist b/CameraManager/Info.plist new file mode 100644 index 0000000..cde50a8 --- /dev/null +++ b/CameraManager/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.imaginarycloud.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/README.md b/README.md index f24fa06..722e643 100755 --- a/README.md +++ b/README.md @@ -1,18 +1,16 @@ -####Camera Manager +# 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) -V1.0.12 (23-Mar-2015) - -####About -This is a simple swift class to provide all the configurations you need to create custom camera view in your app. +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, different flash modes, inputs and outputs. Just drag, drop and use. -####Installation with CocoaPods +## Installation with CocoaPods The easiest way to install the CameraManager is with: [CocoaPods](http://cocoapods.org) -## Podfile +### Podfile ```ruby use_frameworks! @@ -20,7 +18,18 @@ use_frameworks! pod 'CameraManager', '~> 1.0' ``` -####How to use +## Installation with Carthage + +[Carthage](https://github.com/Carthage/Carthage) is another dependency management tool written in Swift. + +Add the following line to your Cartfile: + +``` +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 assess to it. ```swift CameraManager.sharedInstance.addPreeviewLayerToView(self.cameraView) @@ -95,10 +104,10 @@ CameraManager.sharedInstance.stopRecordingVideo({ (videoURL, error) -> Void in }) ``` -####Support +## Support -Supports iOS 8 and above +Supports iOS 8 and above. Xcode 6.3 is required to build the latest code written in Swift 1.2. -####License +## License -Copyright © 2014 ImaginaryCloud, imaginarycloud.com. This library is licensed under the MIT license. +Copyright © 2015 ImaginaryCloud, imaginarycloud.com. This library is licensed under the MIT license. diff --git a/camera.xcodeproj/project.pbxproj b/camera.xcodeproj/project.pbxproj index 3d97e15..4df0edf 100644 --- a/camera.xcodeproj/project.pbxproj +++ b/camera.xcodeproj/project.pbxproj @@ -14,8 +14,36 @@ 454C1F5119E82E2500C81915 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 454C1F4F19E82E2500C81915 /* LaunchScreen.xib */; }; 454C1F6719E8316A00C81915 /* CameraManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 454C1F6619E8316A00C81915 /* CameraManager.swift */; }; 45A23C181A656BDC00FB48F3 /* ImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45A23C171A656BDC00FB48F3 /* ImageViewController.swift */; }; + D71DE8861AD677A7001E62F1 /* CameraManager.h in Headers */ = {isa = PBXBuildFile; fileRef = D71DE8851AD677A7001E62F1 /* CameraManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D71DE8981AD677A8001E62F1 /* CameraManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D71DE8811AD677A7001E62F1 /* CameraManager.framework */; }; + D71DE8991AD677A8001E62F1 /* CameraManager.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D71DE8811AD677A7001E62F1 /* CameraManager.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + D71DE8A11AD677EF001E62F1 /* CameraManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 454C1F6619E8316A00C81915 /* CameraManager.swift */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + D71DE8961AD677A8001E62F1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 454C1F3919E82E2500C81915 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D71DE8801AD677A7001E62F1; + remoteInfo = CameraManager; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + D71DE89D1AD677A8001E62F1 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + D71DE8991AD677A8001E62F1 /* CameraManager.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 454C1F4119E82E2500C81915 /* camera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = camera.app; sourceTree = BUILT_PRODUCTS_DIR; }; 454C1F4519E82E2500C81915 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -26,10 +54,21 @@ 454C1F5019E82E2500C81915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 454C1F6619E8316A00C81915 /* CameraManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraManager.swift; sourceTree = ""; }; 45A23C171A656BDC00FB48F3 /* ImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageViewController.swift; sourceTree = ""; }; + D71DE8811AD677A7001E62F1 /* CameraManager.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CameraManager.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D71DE8841AD677A7001E62F1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D71DE8851AD677A7001E62F1 /* CameraManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CameraManager.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 454C1F3E19E82E2500C81915 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D71DE8981AD677A8001E62F1 /* CameraManager.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D71DE87D1AD677A7001E62F1 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -43,6 +82,7 @@ isa = PBXGroup; children = ( 454C1F4319E82E2500C81915 /* camera */, + D71DE8821AD677A7001E62F1 /* CameraManager */, 454C1F4219E82E2500C81915 /* Products */, ); sourceTree = ""; @@ -51,6 +91,7 @@ isa = PBXGroup; children = ( 454C1F4119E82E2500C81915 /* camera.app */, + D71DE8811AD677A7001E62F1 /* CameraManager.framework */, ); name = Products; sourceTree = ""; @@ -86,8 +127,36 @@ name = "Example app view controllers"; sourceTree = ""; }; + D71DE8821AD677A7001E62F1 /* CameraManager */ = { + isa = PBXGroup; + children = ( + D71DE8851AD677A7001E62F1 /* CameraManager.h */, + D71DE8831AD677A7001E62F1 /* Supporting Files */, + ); + path = CameraManager; + sourceTree = ""; + }; + D71DE8831AD677A7001E62F1 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + D71DE8841AD677A7001E62F1 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + D71DE87E1AD677A7001E62F1 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D71DE8861AD677A7001E62F1 /* CameraManager.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ 454C1F4019E82E2500C81915 /* camera */ = { isa = PBXNativeTarget; @@ -96,16 +165,36 @@ 454C1F3D19E82E2500C81915 /* Sources */, 454C1F3E19E82E2500C81915 /* Frameworks */, 454C1F3F19E82E2500C81915 /* Resources */, + D71DE89D1AD677A8001E62F1 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( + D71DE8971AD677A8001E62F1 /* PBXTargetDependency */, ); name = camera; productName = camera; productReference = 454C1F4119E82E2500C81915 /* camera.app */; productType = "com.apple.product-type.application"; }; + D71DE8801AD677A7001E62F1 /* CameraManager */ = { + isa = PBXNativeTarget; + buildConfigurationList = D71DE89A1AD677A8001E62F1 /* Build configuration list for PBXNativeTarget "CameraManager" */; + buildPhases = ( + D71DE87C1AD677A7001E62F1 /* Sources */, + D71DE87D1AD677A7001E62F1 /* Frameworks */, + D71DE87E1AD677A7001E62F1 /* Headers */, + D71DE87F1AD677A7001E62F1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CameraManager; + productName = CameraManager; + productReference = D71DE8811AD677A7001E62F1 /* CameraManager.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -118,6 +207,9 @@ 454C1F4019E82E2500C81915 = { CreatedOnToolsVersion = 6.0.1; }; + D71DE8801AD677A7001E62F1 = { + CreatedOnToolsVersion = 6.3; + }; }; }; buildConfigurationList = 454C1F3C19E82E2500C81915 /* Build configuration list for PBXProject "camera" */; @@ -134,6 +226,7 @@ projectRoot = ""; targets = ( 454C1F4019E82E2500C81915 /* camera */, + D71DE8801AD677A7001E62F1 /* CameraManager */, ); }; /* End PBXProject section */ @@ -149,6 +242,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D71DE87F1AD677A7001E62F1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -163,8 +263,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D71DE87C1AD677A7001E62F1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D71DE8A11AD677EF001E62F1 /* CameraManager.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + D71DE8971AD677A8001E62F1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D71DE8801AD677A7001E62F1 /* CameraManager */; + targetProxy = D71DE8961AD677A8001E62F1 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 454C1F4A19E82E2500C81915 /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -287,6 +403,53 @@ }; name = Release; }; + D71DE89B1AD677A8001E62F1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + 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"; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = 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"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + D71DE89C1AD677A8001E62F1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + 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"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = 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"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -308,6 +471,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D71DE89A1AD677A8001E62F1 /* Build configuration list for PBXNativeTarget "CameraManager" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D71DE89B1AD677A8001E62F1 /* Debug */, + D71DE89C1AD677A8001E62F1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; /* End XCConfigurationList section */ }; rootObject = 454C1F3919E82E2500C81915 /* Project object */; diff --git a/camera.xcodeproj/xcshareddata/xcschemes/CameraManager.xcscheme b/camera.xcodeproj/xcshareddata/xcschemes/CameraManager.xcscheme new file mode 100644 index 0000000..d5d217f --- /dev/null +++ b/camera.xcodeproj/xcshareddata/xcschemes/CameraManager.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +