Now we can install this lib with Carthage.

This commit is contained in:
Lex Tang 2015-04-09 17:19:36 +08:00
parent 2d6c7be2b1
commit 9b2d0cbf13
5 changed files with 314 additions and 12 deletions

View File

@ -0,0 +1,19 @@
//
// CameraManager.h
// CameraManager
//
// Created by Lex Tang on 4/9/15.
// Copyright (c) 2015 imaginaryCloud. All rights reserved.
//
#import <UIKit/UIKit.h>
//! 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 <CameraManager/PublicHeader.h>

26
CameraManager/Info.plist Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.imaginarycloud.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -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.

View File

@ -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 = "<group>"; };
@ -26,10 +54,21 @@
454C1F5019E82E2500C81915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
454C1F6619E8316A00C81915 /* CameraManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraManager.swift; sourceTree = "<group>"; };
45A23C171A656BDC00FB48F3 /* ImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageViewController.swift; sourceTree = "<group>"; };
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 = "<group>"; };
D71DE8851AD677A7001E62F1 /* CameraManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CameraManager.h; sourceTree = "<group>"; };
/* 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 = "<group>";
@ -51,6 +91,7 @@
isa = PBXGroup;
children = (
454C1F4119E82E2500C81915 /* camera.app */,
D71DE8811AD677A7001E62F1 /* CameraManager.framework */,
);
name = Products;
sourceTree = "<group>";
@ -86,8 +127,36 @@
name = "Example app view controllers";
sourceTree = "<group>";
};
D71DE8821AD677A7001E62F1 /* CameraManager */ = {
isa = PBXGroup;
children = (
D71DE8851AD677A7001E62F1 /* CameraManager.h */,
D71DE8831AD677A7001E62F1 /* Supporting Files */,
);
path = CameraManager;
sourceTree = "<group>";
};
D71DE8831AD677A7001E62F1 /* Supporting Files */ = {
isa = PBXGroup;
children = (
D71DE8841AD677A7001E62F1 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* 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 */;

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D71DE8801AD677A7001E62F1"
BuildableName = "CameraManager.framework"
BlueprintName = "CameraManager"
ReferencedContainer = "container:camera.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D71DE8801AD677A7001E62F1"
BuildableName = "CameraManager.framework"
BlueprintName = "CameraManager"
ReferencedContainer = "container:camera.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D71DE8801AD677A7001E62F1"
BuildableName = "CameraManager.framework"
BlueprintName = "CameraManager"
ReferencedContainer = "container:camera.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>