Compare commits

..

No commits in common. "master" and "1.0.9" have entirely different histories.

22 changed files with 701 additions and 1764 deletions

43
.gitignore vendored
View File

@ -1,43 +0,0 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build

View File

@ -1,214 +0,0 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [3.0.0](https://github.com/imaginary-cloud/CameraManager/tree/3.0.0) - 2016-09-16
### Changed
- Syntax update for Swift 3.0.
## [2.2.4](https://github.com/imaginary-cloud/CameraManager/tree/2.2.4) - 2016-07-06
### Added
- Add error checking.
### Changed
- Fixes completion typos and suggests renamed functions.
## [2.2.3](https://github.com/imaginary-cloud/CameraManager/tree/2.2.3) - 2016-05-12
### Changed
- Fixed zoom in StillImage Mode.
- Minor refactoring
## [2.2.2](https://github.com/imaginary-cloud/CameraManager/tree/2.2.2) - 2016-03-07
### Added
- `CHANGELOG.md` file.
## [2.2.1](https://github.com/imaginary-cloud/CameraManager/tree/2.2.1) - 2016-03-02
### Added
- Initial support for the Swift Package Manager.
## [2.2.0](https://github.com/imaginary-cloud/CameraManager/tree/2.2.0) - 2016-02-19
### Added
- Zoom support.
### Changed
- Fixed spelling of `embeddingView`.
## [2.1.3](https://github.com/imaginary-cloud/CameraManager/tree/2.1.3) - 2016-01-08
### Changed
- No sound in video with more than 10 seconds fixed.
- Fixed `NewCameraOutputMode` not passed during init.
## [2.1.2](https://github.com/imaginary-cloud/CameraManager/tree/2.1.2) - 2015-12-24
### Added
- Property `cameraIsReady`.
- Completion block `addPreviewLayerToView`.
## [2.1.1](https://github.com/imaginary-cloud/CameraManager/tree/2.1.1) - 2015-12-11
### Added
- Ability to disable responding to device orientation changes.
## [2.1.0](https://github.com/imaginary-cloud/CameraManager/tree/2.1) - 2015-11-20
### Added
- Properties `recordedDuration` and `recordedFileSize`.
## [2.0.2](https://github.com/imaginary-cloud/CameraManager/tree/2.0.2) - 2015-11-17
### Fixed
- iOS 9.0.1 bug.
## [2.0.1](https://github.com/imaginary-cloud/CameraManager/tree/2.0.1) - 2015-09-17
### Changed
- Syntax updates.
## [2.0.0](https://github.com/imaginary-cloud/CameraManager/tree/2.0.0) - 2015-07-30
### Changed
- Syntax update for Swift 2.0.
## [1.0.14](https://github.com/imaginary-cloud/CameraManager/tree/1.0.14) - 2015-07-17
### Changed
- Small fixes.
## [1.0.13](https://github.com/imaginary-cloud/CameraManager/tree/1.0.13) - 2015-05-12
### Added
- Support for installing via Carthage.
- Property `hasFlash`.
### Changed
- Syntax update for Swift 1.2.
## [1.0.12](https://github.com/imaginary-cloud/CameraManager/tree/1.0.12) - 2015-03-23
### Added
- Incremental flash mode.
- Content localization.
### Changed
- Torch is set to correct state according to the current flash mode.
- `README.md` update.
## [1.0.11](https://github.com/imaginary-cloud/CameraManager/tree/1.0.11) - 2015-03-20
### Added
- Property `showAccessPermissionPopupAutomatically`, to determine if you want the user to be asked about camera permissions automatically or manually.
- Error handling in capture completion blocks.
## [1.0.10](https://github.com/imaginary-cloud/CameraManager/tree/1.0.10) - 2015-03-19
### Added
- Camera state returned when adding the preview layer.
### Changed
- `README.md` update.
## [1.0.9](https://github.com/imaginary-cloud/CameraManager/tree/1.0.9) - 2015-03-10
### Changed
- CameraManager class made public.
## [1.0.8](https://github.com/imaginary-cloud/CameraManager/tree/1.0.8) - 2015-02-24
### Fixed
- Wrong orientation when camera preview starts in landscape mode.
- Crash when trying to capture a still image.
- Orientation detection failure after stop and resume of a capture session.
- Bug which prevented from recording audio.
## [1.0.7](https://github.com/imaginary-cloud/CameraManager/tree/1.0.7) - 2014-10-30
### Added
- Version compatible with XCode 6.1.
### Changed
- `README.md` update.
- Swift syntax updates to resolve compile errors.
## [1.0.6](https://github.com/imaginary-cloud/CameraManager/tree/1.0.6) - 2014-10-28
### Added
- Check for valid capture session.
### Changed
- Fixed video orientation change.
## [1.0.5](https://github.com/imaginary-cloud/CameraManager/tree/1.0.5) - 2014-10-22
### Changed
- Enhanced Camera lifecyle.
- Orientation observers only added if needed.
## [1.0.4](https://github.com/imaginary-cloud/CameraManager/tree/1.0.4) - 2014-10-16
### Added
- Restart session.
### Changed
- `README.md` update.
## [1.0.3](https://github.com/imaginary-cloud/CameraManager/tree/1.0.3) - 2014-10-15
### Added
- Property `writeFilesToPhoneLibrary` to conditionally write to user library.
### Changed
- Resources only recreated when needed.
- `README.md` update.
## [1.0.2](https://github.com/imaginary-cloud/CameraManager/tree/1.0.2) - 2014-10-15
### Added
- `CameraManager.podspec` file.
## [1.0.1](https://github.com/imaginary-cloud/CameraManager/tree/1.0.1) - 2014-10-15
### Changed
- Optional initializer for `addPreviewLayerToView`.
## [1.0.0](https://github.com/imaginary-cloud/CameraManager/tree/1.0.0) - 2014-10-15
### Added
- Front and back camera selection.
- Support for multiple flash modes.
- Video recording, with or without mic.
- Support for multiple camera output quality.
- Preview layer follows interface orientation changes.

View File

@ -1,13 +1,13 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "CameraManager" s.name = "CameraManager"
s.version = "3.0.0" s.version = "1.0.9"
s.summary = "This is a simple Swift class to provide all the configurations you need to create custom camera view in your app. Just drag, drop and use." s.summary = "This is a simple Swift class to provide all the configurations you need to create custom camera view in your app. Just drag, drop and use."
s.requires_arc = true
s.homepage = "https://github.com/imaginary-cloud/CameraManager" s.homepage = "https://github.com/imaginary-cloud/CameraManager"
s.license = 'MIT' s.license = 'MIT'
s.author = { "torrao" => "rtorrao@imaginarycloud.com" } s.author = { "nelanelanela" => "nterlecka@imaginarycloud.com" }
s.source = { :git => "https://github.com/imaginary-cloud/CameraManager.git", :tag => "3.0.0" } s.source = { :git => "https://github.com/imaginary-cloud/CameraManager.git", :tag => "1.0.9" }
s.social_media_url = 'http://www.imaginarycloud.com/' s.social_media_url = 'http://www.imaginarycloud.com/'
s.platform = :ios, '8.0' s.platform = :ios, '8.0'
s.requires_arc = true
s.source_files = 'camera/CameraManager.swift' s.source_files = 'camera/CameraManager.swift'
end end

View File

@ -1,19 +0,0 @@
//
// 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>

View File

@ -1,26 +0,0 @@
<?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>$(PRODUCT_BUNDLE_IDENTIFIER)</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,12 +0,0 @@
// Package.swift
//
// Copyright © 2016 ImaginaryCloud, imaginarycloud.com. This library is licensed under the MIT license.
import PackageDescription
let package = Package(
name: "CameraManager",
targets: [
Target(name: "camera", dependencies: [.Target(name: "CameraManager")])
]
)

3
Podfile Normal file
View File

@ -0,0 +1,3 @@
platform :ios, '7.1'
pod 'CameraManager', :git => 'https://gist.github.com/2204678.git'

160
README.md
View File

@ -1,177 +1,87 @@
# 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)
This is a simple Swift class to provide all the configurations you need to create custom camera view in your app. V1.0.9 (6-Mar-2015)
It follows orientation change and updates UI accordingly, supports front and rear camera selection, pinch to zoom, different flash modes, inputs and outputs.
####About
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. 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
## Installation with CocoaPods
The easiest way to install the CameraManager is with: [CocoaPods](http://cocoapods.org) The easiest way to install the CameraManager is with: [CocoaPods](http://cocoapods.org)
### Podfile ## Podfile
If you want Swift 3.0 syntax use:
```ruby ```ruby
use_frameworks! platform :ios, '7.0'
pod 'CameraManager', '~> 1.0'
pod 'CameraManager', '~> 3.0'
``` ```
If you want Swift 2.0 syntax use: ####How to use
To use it you just add the preview layer to your desired view
```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 3.0 syntax use:
```
github "imaginary-cloud/CameraManager" >= 3.0
```
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 ```swift
let cameraManager = CameraManager() CameraManager.sharedInstance.addPreeviewLayerToView(self.cameraView)
cameraManager.addPreviewLayerToView(self.cameraView)
``` ```
You can set input device to front or back camera: You can set input device to front or back camera:
```swift ```swift
cameraManager.cameraDevice = .Front CameraManager.sharedInstance.cameraDevice = .Front
cameraManager.cameraDevice = .Back CameraManager.sharedInstance.cameraDevice = .Back
``` ```
You can set output format to Image, video or video with audio: You can set output format to Image, video or video with audio:
```swift ```swift
cameraManager.cameraOutputMode = .StillImage CameraManager.sharedInstance.cameraOutputMode = .StillImage
cameraManager.cameraOutputMode = .VideoWithMic CameraManager.sharedInstance.cameraOutputMode = .VideoWithMic
cameraManager.cameraOutputMode = .VideoOnly CameraManager.sharedInstance.cameraOutputMode = .VideoOnly
``` ```
You can set the quality: You can set the quality:
```swift ```swift
cameraManager.cameraOutputQuality = .Low CameraManager.sharedInstance.cameraOutputQuality = .Low
cameraManager.cameraOutputQuality = .Medium CameraManager.sharedInstance.cameraOutputQuality = .Medium
cameraManager.cameraOutputQuality = .High CameraManager.sharedInstance.cameraOutputQuality = .High
``` ```
And flash mode (it will also set corresponding torch mode for video shoot): And flash mode:
```swift ```swift
cameraManager.flashMode = .Off CameraManager.sharedInstance.flashMode = .Off
cameraManager.flashMode = .On CameraManager.sharedInstance.flashMode = .On
cameraManager.flashMode = .Auto CameraManager.sharedInstance.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: You can specify if you want to save the files to phone library:
```swift ```swift
cameraManager.writeFilesToPhoneLibrary = true CameraManager.sharedInstance.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: 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 ```swift
cameraManager.showErrorBlock = { (erTitle: String, erMessage: String) -> Void in CameraManager.sharedInstance.showErrorBlock = { (erTitle: String, erMessage: String) -> Void in
var alertController = UIAlertController(title: erTitle, message: erMessage, preferredStyle: .Alert) UIAlertView(title: erTitle, message: erMessage, delegate: nil, cancelButtonTitle: "OK").show()
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: To shoot image all you need to do is call:
```swift ```swift
cameraManager.capturePictureWithCompletion({ (image, error) -> Void in CameraManager.sharedInstance.capturePictureWithCompletition({ (image) -> Void in
self.myImage = image self.myImage = image
}) })
``` ```
To record video you do: To record video you do:
```swift ```swift
cameraManager.startRecordingVideo() CameraManager.sharedInstance.startRecordingVideo()
cameraManager.stopVideoRecording({ (videoURL, error) -> Void in CameraManager.sharedInstance.stopRecordingVideo({ (videoURL) -> Void in
NSFileManager.defaultManager().copyItemAtURL(videoURL, toURL: self.myVideoURL, error: &error) NSFileManager.defaultManager().copyItemAtURL(videoURL, toURL: self.myVideoURL, error: &error)
}) })
``` ```
## Support ####Support
Supports iOS 8 and above. Xcode 7.0 is required to build the latest code written in Swift 2.0. Supports iOS 7 and above
## License ####License
Copyright © 2016 ImaginaryCloud, imaginarycloud.com. This library is licensed under the MIT license. Copyright © 2014 ImaginaryCloud, imaginarycloud.com. This library is licensed under the MIT license.

View File

@ -12,37 +12,10 @@
454C1F4C19E82E2500C81915 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 454C1F4A19E82E2500C81915 /* Main.storyboard */; }; 454C1F4C19E82E2500C81915 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 454C1F4A19E82E2500C81915 /* Main.storyboard */; };
454C1F4E19E82E2500C81915 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 454C1F4D19E82E2500C81915 /* Images.xcassets */; }; 454C1F4E19E82E2500C81915 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 454C1F4D19E82E2500C81915 /* Images.xcassets */; };
454C1F5119E82E2500C81915 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 454C1F4F19E82E2500C81915 /* LaunchScreen.xib */; }; 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 */; }; 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 */ /* 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 */ /* Begin PBXFileReference section */
454C1F4119E82E2500C81915 /* camera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = camera.app; sourceTree = BUILT_PRODUCTS_DIR; }; 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>"; }; 454C1F4519E82E2500C81915 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@ -51,23 +24,12 @@
454C1F4B19E82E2500C81915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 454C1F4B19E82E2500C81915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
454C1F4D19E82E2500C81915 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; 454C1F4D19E82E2500C81915 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
454C1F5019E82E2500C81915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; }; 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; name = CameraManager.swift; path = ../camera/CameraManager.swift; 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>"; }; 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 */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
454C1F3E19E82E2500C81915 /* Frameworks */ = { 454C1F3E19E82E2500C81915 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D71DE8981AD677A8001E62F1 /* CameraManager.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D71DE87D1AD677A7001E62F1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
@ -81,7 +43,6 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
454C1F4319E82E2500C81915 /* camera */, 454C1F4319E82E2500C81915 /* camera */,
D71DE8821AD677A7001E62F1 /* CameraManager */,
454C1F4219E82E2500C81915 /* Products */, 454C1F4219E82E2500C81915 /* Products */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
@ -90,7 +51,6 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
454C1F4119E82E2500C81915 /* camera.app */, 454C1F4119E82E2500C81915 /* camera.app */,
D71DE8811AD677A7001E62F1 /* CameraManager.framework */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
@ -100,6 +60,7 @@
children = ( children = (
454C1F4619E82E2500C81915 /* AppDelegate.swift */, 454C1F4619E82E2500C81915 /* AppDelegate.swift */,
45A23C191A656BE600FB48F3 /* Example app view controllers */, 45A23C191A656BE600FB48F3 /* Example app view controllers */,
454C1F6619E8316A00C81915 /* CameraManager.swift */,
454C1F4A19E82E2500C81915 /* Main.storyboard */, 454C1F4A19E82E2500C81915 /* Main.storyboard */,
454C1F4D19E82E2500C81915 /* Images.xcassets */, 454C1F4D19E82E2500C81915 /* Images.xcassets */,
454C1F4F19E82E2500C81915 /* LaunchScreen.xib */, 454C1F4F19E82E2500C81915 /* LaunchScreen.xib */,
@ -125,37 +86,8 @@
name = "Example app view controllers"; name = "Example app view controllers";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
D71DE8821AD677A7001E62F1 /* CameraManager */ = {
isa = PBXGroup;
children = (
D71DE8851AD677A7001E62F1 /* CameraManager.h */,
454C1F6619E8316A00C81915 /* CameraManager.swift */,
D71DE8831AD677A7001E62F1 /* Supporting Files */,
);
path = CameraManager;
sourceTree = "<group>";
};
D71DE8831AD677A7001E62F1 /* Supporting Files */ = {
isa = PBXGroup;
children = (
D71DE8841AD677A7001E62F1 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */ /* 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 */ /* Begin PBXNativeTarget section */
454C1F4019E82E2500C81915 /* camera */ = { 454C1F4019E82E2500C81915 /* camera */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
@ -164,54 +96,27 @@
454C1F3D19E82E2500C81915 /* Sources */, 454C1F3D19E82E2500C81915 /* Sources */,
454C1F3E19E82E2500C81915 /* Frameworks */, 454C1F3E19E82E2500C81915 /* Frameworks */,
454C1F3F19E82E2500C81915 /* Resources */, 454C1F3F19E82E2500C81915 /* Resources */,
D71DE89D1AD677A8001E62F1 /* Embed Frameworks */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
D71DE8971AD677A8001E62F1 /* PBXTargetDependency */,
); );
name = camera; name = camera;
productName = camera; productName = camera;
productReference = 454C1F4119E82E2500C81915 /* camera.app */; productReference = 454C1F4119E82E2500C81915 /* camera.app */;
productType = "com.apple.product-type.application"; 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 */ /* End PBXNativeTarget section */
/* Begin PBXProject section */ /* Begin PBXProject section */
454C1F3919E82E2500C81915 /* Project object */ = { 454C1F3919E82E2500C81915 /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0600;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = imaginaryCloud; ORGANIZATIONNAME = imaginaryCloud;
TargetAttributes = { TargetAttributes = {
454C1F4019E82E2500C81915 = { 454C1F4019E82E2500C81915 = {
CreatedOnToolsVersion = 6.0.1; CreatedOnToolsVersion = 6.0.1;
DevelopmentTeam = QM7HJTY23M;
LastSwiftMigration = 0800;
};
D71DE8801AD677A7001E62F1 = {
CreatedOnToolsVersion = 6.3;
LastSwiftMigration = 0800;
}; };
}; };
}; };
@ -229,7 +134,6 @@
projectRoot = ""; projectRoot = "";
targets = ( targets = (
454C1F4019E82E2500C81915 /* camera */, 454C1F4019E82E2500C81915 /* camera */,
D71DE8801AD677A7001E62F1 /* CameraManager */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
@ -245,13 +149,6 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
D71DE87F1AD677A7001E62F1 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
@ -260,29 +157,14 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
454C1F4919E82E2500C81915 /* ViewController.swift in Sources */, 454C1F4919E82E2500C81915 /* ViewController.swift in Sources */,
454C1F6719E8316A00C81915 /* CameraManager.swift in Sources */,
45A23C181A656BDC00FB48F3 /* ImageViewController.swift in Sources */, 45A23C181A656BDC00FB48F3 /* ImageViewController.swift in Sources */,
454C1F4719E82E2500C81915 /* AppDelegate.swift in Sources */, 454C1F4719E82E2500C81915 /* AppDelegate.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
D71DE87C1AD677A7001E62F1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D71DE8A11AD677EF001E62F1 /* CameraManager.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
D71DE8971AD677A8001E62F1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = D71DE8801AD677A7001E62F1 /* CameraManager */;
targetProxy = D71DE8961AD677A8001E62F1 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
454C1F4A19E82E2500C81915 /* Main.storyboard */ = { 454C1F4A19E82E2500C81915 /* Main.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
@ -316,20 +198,16 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = ""; CODE_SIGN_IDENTITY = "iPhone Developer: Luis Diniz (HUX544ZBSL)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO; GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0; GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1", "DEBUG=1",
@ -342,9 +220,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
PROVISIONING_PROFILE = "4d0a483e-6fa4-454e-a019-6ce6d8c6f307";
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -364,10 +243,8 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@ -375,17 +252,16 @@
ENABLE_NS_ASSERTIONS = NO; ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
PROVISIONING_PROFILE = "4d0a483e-6fa4-454e-a019-6ce6d8c6f307";
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
@ -395,13 +271,12 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = ""; CODE_SIGN_IDENTITY = "";
INFOPLIST_FILE = camera/Info.plist; INFOPLIST_FILE = camera/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = cameraDemo;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0; PROVISIONING_PROFILE = "";
}; };
name = Debug; name = Debug;
}; };
@ -409,66 +284,12 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
INFOPLIST_FILE = camera/Info.plist; INFOPLIST_FILE = camera/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = cameraDemo;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0; PROVISIONING_PROFILE = "";
};
name = Release;
};
D71DE89B1AD677A8001E62F1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
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_BUNDLE_IDENTIFIER = "com.imaginarycloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
D71DE89C1AD677A8001E62F1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
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_BUNDLE_IDENTIFIER = "com.imaginarycloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
}; };
name = Release; name = Release;
}; };
@ -493,15 +314,6 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
D71DE89A1AD677A8001E62F1 /* Build configuration list for PBXNativeTarget "CameraManager" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D71DE89B1AD677A8001E62F1 /* Debug */,
D71DE89C1AD677A8001E62F1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */ /* End XCConfigurationList section */
}; };
rootObject = 454C1F3919E82E2500C81915 /* Project object */; rootObject = 454C1F3919E82E2500C81915 /* Project object */;

View File

@ -34,7 +34,7 @@
<key>IDESourceControlWCCIdentifierKey</key> <key>IDESourceControlWCCIdentifierKey</key>
<string>E1D0A3AE6B49B031DF6A25973E5414F28D2A575A</string> <string>E1D0A3AE6B49B031DF6A25973E5414F28D2A575A</string>
<key>IDESourceControlWCCName</key> <key>IDESourceControlWCCName</key>
<string>CameraManager</string> <string>camera</string>
</dict> </dict>
</array> </array>
</dict> </dict>

View File

@ -1,80 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
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
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D71DE8801AD677A7001E62F1"
BuildableName = "CameraManager.framework"
BlueprintName = "CameraManager"
ReferencedContainer = "container:camera.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
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>

View File

@ -2,4 +2,22 @@
<Bucket <Bucket
type = "1" type = "1"
version = "2.0"> version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "camera/ViewController.swift"
timestampString = "447356735.111942"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "93"
endingLineNumber = "93"
landmarkName = "outputModeButtonTapped(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket> </Bucket>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0700" LastUpgradeVersion = "0600"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@ -62,8 +62,6 @@
ReferencedContainer = "container:camera.xcodeproj"> ReferencedContainer = "container:camera.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
@ -73,10 +71,8 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES" debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"> allowLocationSimulation = "YES">
<BuildableProductRunnable <BuildableProductRunnable>
runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "454C1F4019E82E2500C81915" BlueprintIdentifier = "454C1F4019E82E2500C81915"
@ -94,8 +90,7 @@
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
buildConfiguration = "Release" buildConfiguration = "Release"
debugDocumentVersioning = "YES"> debugDocumentVersioning = "YES">
<BuildableProductRunnable <BuildableProductRunnable>
runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "454C1F4019E82E2500C81915" BlueprintIdentifier = "454C1F4019E82E2500C81915"

View File

@ -12,11 +12,6 @@
</dict> </dict>
<key>SuppressBuildableAutocreation</key> <key>SuppressBuildableAutocreation</key>
<dict> <dict>
<key>453228F21AC2AD9A00A7EE76</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>454C1F4019E82E2500C81915</key> <key>454C1F4019E82E2500C81915</key>
<dict> <dict>
<key>primary</key> <key>primary</key>
@ -27,11 +22,6 @@
<key>primary</key> <key>primary</key>
<true/> <true/>
</dict> </dict>
<key>D71DE8801AD677A7001E62F1</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict> </dict>
</dict> </dict>
</plist> </plist>

View File

@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
return true return true
} }
func applicationWillResignActive(_ application: UIApplication) { func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
} }
func applicationDidEnterBackground(_ application: UIApplication) { func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
} }
func applicationWillEnterForeground(_ application: UIApplication) { func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
} }
func applicationDidBecomeActive(_ application: UIApplication) { func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
} }
func applicationWillTerminate(_ application: UIApplication) { func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
} }

View File

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies> </dependencies>
<objects> <objects>
@ -12,16 +11,16 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/> <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2016 imaginaryCloud. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2014 imaginaryCloud. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/> <rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="camera" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="camera" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/> <rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
</subviews> </subviews>

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="bhK-VL-qY4"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="bhK-VL-qY4">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--Camera--> <!--Camera-->
@ -23,6 +22,34 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="tintColor" red="0.54901963470000004" green="0.77647066119999997" blue="0.2470588386" alpha="1" colorSpace="deviceRGB"/> <color key="tintColor" red="0.54901963470000004" green="0.77647066119999997" blue="0.2470588386" alpha="1" colorSpace="deviceRGB"/>
</view> </view>
<imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="yyS-3g-UqL">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sT4-CC-oh5">
<rect key="frame" x="496" y="20" width="88" height="33"/>
<color key="backgroundColor" red="0.98039221759999995" green="0.0078431377190000002" blue="0.52156865600000002" alpha="1" colorSpace="deviceRGB"/>
<state key="normal" title="Front">
<color key="titleColor" red="1" green="0.87630701789999998" blue="0.35755069969999997" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="changeCameraDevice:" destination="BYZ-38-t0r" eventType="touchUpInside" id="KDu-mr-jHd"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="19j-xT-Ttb">
<rect key="frame" x="16" y="20" width="88" height="33"/>
<color key="backgroundColor" red="0.54901963470000004" green="0.77647066119999997" blue="0.2470588386" alpha="1" colorSpace="deviceRGB"/>
<constraints>
<constraint firstAttribute="width" constant="88" id="7mm-eo-7Ng"/>
<constraint firstAttribute="height" constant="33" id="jff-rD-TUp"/>
</constraints>
<state key="normal" title="Flash off">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="changeFlashMode:" destination="BYZ-38-t0r" eventType="touchUpInside" id="e2b-Lg-iqO"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FSo-n8-ZwV"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FSo-n8-ZwV">
<rect key="frame" x="275" y="530" width="50" height="50"/> <rect key="frame" x="275" y="530" width="50" height="50"/>
<color key="backgroundColor" red="0.54901963470000004" green="0.77647066119999997" blue="0.2470588386" alpha="1" colorSpace="deviceRGB"/> <color key="backgroundColor" red="0.54901963470000004" green="0.77647066119999997" blue="0.2470588386" alpha="1" colorSpace="deviceRGB"/>
@ -43,124 +70,48 @@
<action selector="recordButtonTapped:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Ggq-m1-AQB"/> <action selector="recordButtonTapped:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Ggq-m1-AQB"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rd3-ei-B9P"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3WP-Xo-FaJ">
<rect key="frame" x="4" y="84" width="592" height="512"/> <rect key="frame" x="256" y="20" width="88" height="33"/>
<color key="backgroundColor" red="1" green="0.0" blue="0.46666669849999998" alpha="0.5" colorSpace="deviceRGB"/> <color key="backgroundColor" red="1" green="0.87630701789999998" blue="0.35755069969999997" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="27"/> <state key="normal" title="Image">
<state key="normal">
<color key="titleColor" red="0.36078432199999999" green="0.36078432199999999" blue="0.36078432199999999" alpha="1" colorSpace="deviceRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state> </state>
<connections> <connections>
<action selector="askForCameraPermissions:" destination="BYZ-38-t0r" eventType="touchUpInside" id="gbn-Ql-Lnv"/> <action selector="outputModeButtonTapped:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Bgy-rQ-cfF"/>
</connections> </connections>
</button> </button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jaF-q9-Eli">
<rect key="frame" x="0.0" y="20" width="600" height="60"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="19j-xT-Ttb">
<rect key="frame" x="0.0" y="0.0" width="150" height="60"/>
<color key="backgroundColor" red="0.67058825489999996" green="0.67058825489999996" blue="0.67058825489999996" alpha="0.70000000000000007" colorSpace="deviceRGB"/>
<state key="normal" title="Flash off">
<color key="titleColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="changeFlashMode:" destination="BYZ-38-t0r" eventType="touchUpInside" id="e2b-Lg-iqO"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3WP-Xo-FaJ">
<rect key="frame" x="150" y="0.0" width="150" height="60"/>
<color key="backgroundColor" red="1" green="0.0" blue="0.46666669849999998" alpha="0.70000000000000007" colorSpace="deviceRGB"/>
<state key="normal" title="Video">
<color key="titleColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="outputModeButtonTapped:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Bgy-rQ-cfF"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sT4-CC-oh5">
<rect key="frame" x="300" y="0.0" width="150" height="60"/>
<color key="backgroundColor" red="0.67058825489999996" green="0.67058825489999996" blue="0.67058825489999996" alpha="0.70000000000000007" colorSpace="deviceRGB"/>
<state key="normal" title="Back">
<color key="titleColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="changeCameraDevice:" destination="BYZ-38-t0r" eventType="touchUpInside" id="KDu-mr-jHd"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JCk-74-YkH">
<rect key="frame" x="450" y="0.0" width="150" height="60"/>
<color key="backgroundColor" red="1" green="0.0" blue="0.46666669849999998" alpha="0.70000000000000007" colorSpace="deviceRGB"/>
<state key="normal" title="High">
<color key="titleColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="changeCameraQuality:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Bt4-RC-Mrl"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="19j-xT-Ttb" firstAttribute="width" secondItem="3WP-Xo-FaJ" secondAttribute="width" id="0JS-OH-a4X"/>
<constraint firstItem="3WP-Xo-FaJ" firstAttribute="leading" secondItem="19j-xT-Ttb" secondAttribute="trailing" id="7Y0-vo-2GG"/>
<constraint firstItem="sT4-CC-oh5" firstAttribute="width" secondItem="3WP-Xo-FaJ" secondAttribute="width" id="Anx-2O-O5g"/>
<constraint firstItem="19j-xT-Ttb" firstAttribute="top" secondItem="jaF-q9-Eli" secondAttribute="top" id="Faq-Kx-fdW"/>
<constraint firstAttribute="bottom" secondItem="3WP-Xo-FaJ" secondAttribute="bottom" id="Jk9-HY-RKV"/>
<constraint firstItem="JCk-74-YkH" firstAttribute="top" secondItem="jaF-q9-Eli" secondAttribute="top" id="Jxn-jp-3u1"/>
<constraint firstItem="19j-xT-Ttb" firstAttribute="width" secondItem="jaF-q9-Eli" secondAttribute="width" multiplier="1:4" id="R5r-hS-YXf"/>
<constraint firstAttribute="trailing" secondItem="JCk-74-YkH" secondAttribute="trailing" id="U8V-vs-AHd"/>
<constraint firstAttribute="bottom" secondItem="sT4-CC-oh5" secondAttribute="bottom" id="X9n-5F-9S6"/>
<constraint firstAttribute="bottom" secondItem="19j-xT-Ttb" secondAttribute="bottom" id="XIm-83-qDg"/>
<constraint firstItem="19j-xT-Ttb" firstAttribute="leading" secondItem="jaF-q9-Eli" secondAttribute="leading" id="YKC-TE-A4C"/>
<constraint firstItem="sT4-CC-oh5" firstAttribute="top" secondItem="jaF-q9-Eli" secondAttribute="top" id="dt8-f3-OG0"/>
<constraint firstItem="sT4-CC-oh5" firstAttribute="leading" secondItem="3WP-Xo-FaJ" secondAttribute="trailing" id="f9i-42-p49"/>
<constraint firstAttribute="bottom" secondItem="JCk-74-YkH" secondAttribute="bottom" id="jye-Mv-9Rq"/>
<constraint firstItem="JCk-74-YkH" firstAttribute="leading" secondItem="sT4-CC-oh5" secondAttribute="trailing" id="mhQ-5m-h5c"/>
<constraint firstAttribute="height" constant="60" id="mlL-sQ-rnK"/>
<constraint firstItem="3WP-Xo-FaJ" firstAttribute="top" secondItem="jaF-q9-Eli" secondAttribute="top" id="oeK-QK-BDl"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tap here to enable camera access and take great pictures" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2bK-wq-6Rf">
<rect key="frame" x="4" y="84" width="592" height="512"/>
<fontDescription key="fontDescription" type="system" pointSize="25"/>
<color key="textColor" red="0.36078432199999999" green="0.36078432199999999" blue="0.36078432199999999" alpha="1" colorSpace="deviceRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<gestureRecognizers/> <gestureRecognizers/>
<constraints> <constraints>
<constraint firstItem="2bK-wq-6Rf" firstAttribute="top" secondItem="rd3-ei-B9P" secondAttribute="top" id="0KQ-L2-vRf"/> <constraint firstItem="yyS-3g-UqL" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="2RH-Jf-TPm"/>
<constraint firstAttribute="trailing" secondItem="jaF-q9-Eli" secondAttribute="trailing" id="2fZ-BE-g5j"/> <constraint firstItem="19j-xT-Ttb" firstAttribute="height" secondItem="3WP-Xo-FaJ" secondAttribute="height" id="3Fa-ID-yp6"/>
<constraint firstItem="2bK-wq-6Rf" firstAttribute="top" secondItem="jaF-q9-Eli" secondAttribute="bottom" constant="4" id="8fE-gJ-Hi7"/> <constraint firstItem="19j-xT-Ttb" firstAttribute="width" secondItem="3WP-Xo-FaJ" secondAttribute="width" id="8aO-Xm-KH2"/>
<constraint firstItem="EI2-CK-oqA" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="E1I-Yh-igT"/> <constraint firstItem="EI2-CK-oqA" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="E1I-Yh-igT"/>
<constraint firstItem="rd3-ei-B9P" firstAttribute="bottom" secondItem="EI2-CK-oqA" secondAttribute="bottom" constant="-4" id="GKS-w4-B8J"/> <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="yyS-3g-UqL" secondAttribute="bottom" id="INX-TM-tak"/>
<constraint firstItem="2bK-wq-6Rf" firstAttribute="bottom" secondItem="rd3-ei-B9P" secondAttribute="bottom" id="J9p-Wn-xC4"/> <constraint firstAttribute="trailing" secondItem="yyS-3g-UqL" secondAttribute="trailing" id="JEu-x6-qah"/>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="EI2-CK-oqA" secondAttribute="bottom" id="JW8-WC-69E"/> <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="EI2-CK-oqA" secondAttribute="bottom" id="JW8-WC-69E"/>
<constraint firstItem="19j-xT-Ttb" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" id="K6V-FG-8Ms"/>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="FSo-n8-ZwV" secondAttribute="bottom" constant="20" id="KgN-t9-iTh"/> <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="FSo-n8-ZwV" secondAttribute="bottom" constant="20" id="KgN-t9-iTh"/>
<constraint firstItem="jaF-q9-Eli" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" constant="20" id="Tv6-Ak-cSA"/> <constraint firstAttribute="trailing" secondItem="sT4-CC-oh5" secondAttribute="trailing" constant="16" id="Q92-5b-7Z7"/>
<constraint firstItem="yyS-3g-UqL" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="SyJ-SX-ooI"/>
<constraint firstItem="EI2-CK-oqA" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="Y9T-eB-SQS"/> <constraint firstItem="EI2-CK-oqA" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="Y9T-eB-SQS"/>
<constraint firstItem="2bK-wq-6Rf" firstAttribute="trailing" secondItem="rd3-ei-B9P" secondAttribute="trailing" id="add-TX-ds6"/> <constraint firstItem="3WP-Xo-FaJ" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" id="aur-kS-Ri3"/>
<constraint firstAttribute="trailing" secondItem="rd3-ei-B9P" secondAttribute="trailing" constant="4" id="dJE-jw-ZNY"/> <constraint firstAttribute="centerX" secondItem="3WP-Xo-FaJ" secondAttribute="centerX" id="c8T-oR-vKi"/>
<constraint firstAttribute="centerX" secondItem="FSo-n8-ZwV" secondAttribute="centerX" id="dQf-Ne-km4"/> <constraint firstAttribute="centerX" secondItem="FSo-n8-ZwV" secondAttribute="centerX" id="dQf-Ne-km4"/>
<constraint firstItem="jaF-q9-Eli" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="eAr-PL-deK"/> <constraint firstItem="19j-xT-Ttb" firstAttribute="width" secondItem="sT4-CC-oh5" secondAttribute="width" id="dei-D3-qWh"/>
<constraint firstItem="sT4-CC-oh5" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" id="i1Z-3m-ytG"/>
<constraint firstAttribute="trailing" secondItem="EI2-CK-oqA" secondAttribute="trailing" id="m1R-4g-dGU"/> <constraint firstAttribute="trailing" secondItem="EI2-CK-oqA" secondAttribute="trailing" id="m1R-4g-dGU"/>
<constraint firstItem="rd3-ei-B9P" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="4" id="n5z-dZ-b1l"/> <constraint firstItem="19j-xT-Ttb" firstAttribute="height" secondItem="sT4-CC-oh5" secondAttribute="height" id="mpG-Ir-vxB"/>
<constraint firstItem="2bK-wq-6Rf" firstAttribute="leading" secondItem="rd3-ei-B9P" secondAttribute="leading" id="vNM-yq-5jd"/> <constraint firstItem="19j-xT-Ttb" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="16" id="uuM-vU-IPX"/>
</constraints> </constraints>
</view> </view>
<navigationItem key="navigationItem" id="EiR-i7-mkA"/> <navigationItem key="navigationItem" id="EiR-i7-mkA"/>
<nil key="simulatedTopBarMetrics"/> <nil key="simulatedTopBarMetrics"/>
<connections> <connections>
<outlet property="askForPermissionsButton" destination="rd3-ei-B9P" id="Itb-t1-HpD"/>
<outlet property="askForPermissionsLabel" destination="2bK-wq-6Rf" id="GdV-Gq-uSS"/>
<outlet property="cameraButton" destination="FSo-n8-ZwV" id="ITk-de-2LY"/> <outlet property="cameraButton" destination="FSo-n8-ZwV" id="ITk-de-2LY"/>
<outlet property="cameraView" destination="EI2-CK-oqA" id="bUS-Rk-omr"/> <outlet property="cameraView" destination="EI2-CK-oqA" id="bUS-Rk-omr"/>
<outlet property="flashModeButton" destination="19j-xT-Ttb" id="hjy-cj-bcm"/> <outlet property="imageView" destination="yyS-3g-UqL" id="CZo-cW-NXH"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
@ -179,7 +130,7 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="v1g-94-paQ"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="v1g-94-paQ">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
</imageView> </imageView>
</subviews> </subviews>

File diff suppressed because it is too large Load Diff

View File

@ -15,9 +15,9 @@ class ImageViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.navigationController?.navigationBar.isHidden = false self.navigationController?.navigationBar.hidden = false
if let validImage = self.image { if let validImage = self.image? {
self.imageView.image = validImage self.imageView.image = validImage
} }
} }

View File

@ -2,18 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSPhotoLibraryUsageDescription</key>
<string>CameraManager will access your photo library to save pictures/video.</string>
<key>NSMicrophoneUsageDescription</key>
<string>CameraManager will use your microphone to record audio for videos.</string>
<key>NSCameraUsageDescription</key>
<string>CameraManager will use your camera to take pictures/video.</string>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string></string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@ -21,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0.14</string> <string>1.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>

View File

@ -7,171 +7,108 @@
// //
import UIKit import UIKit
import CameraManager
class ViewController: UIViewController { class ViewController: UIViewController {
// MARK: - Constants // MARK: - Constants
let cameraManager = CameraManager() let cameraManager = CameraManager.sharedInstance
// MARK: - @IBOutlets // MARK: - @IBOutlets
@IBOutlet weak var cameraView: UIView! @IBOutlet weak var cameraView: UIView!
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var cameraButton: UIButton! @IBOutlet weak var cameraButton: UIButton!
@IBOutlet weak var flashModeButton: UIButton!
@IBOutlet weak var askForPermissionsButton: UIButton!
@IBOutlet weak var askForPermissionsLabel: UILabel!
// MARK: - UIViewController // MARK: - UIViewController
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.cameraManager.addPreviewLayerToView(self.cameraView, newCameraOutputMode: CameraOutputMode.StillImage)
cameraManager.showAccessPermissionPopupAutomatically = false self.cameraManager.cameraDevice = .Front
self.imageView.hidden = true
askForPermissionsButton.isHidden = true CameraManager.sharedInstance.showErrorBlock = { (erTitle: String, erMessage: String) -> Void in
askForPermissionsLabel.isHidden = true UIAlertView(title: erTitle, message: erMessage, delegate: nil, cancelButtonTitle: "OK").show()
let currentCameraState = cameraManager.currentCameraStatus()
if currentCameraState == .notDetermined {
askForPermissionsButton.isHidden = false
askForPermissionsLabel.isHidden = false
} else if (currentCameraState == .ready) {
addCameraToView()
} }
if !cameraManager.hasFlash {
flashModeButton.isEnabled = false
flashModeButton.setTitle("No flash", for: UIControlState())
}
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(animated: Bool)
{
super.viewWillAppear(animated) super.viewWillAppear(animated)
navigationController?.navigationBar.isHidden = true self.navigationController?.navigationBar.hidden = true
cameraManager.resumeCaptureSession() self.cameraManager.resumeCaptureSession()
} }
override func viewWillDisappear(_ animated: Bool) { override func viewWillDisappear(animated: Bool)
super.viewWillDisappear(animated)
cameraManager.stopCaptureSession()
}
// MARK: - ViewController
fileprivate func addCameraToView()
{ {
cameraManager.addPreviewLayerToView(cameraView, newCameraOutputMode: CameraOutputMode.videoWithMic) super.viewWillDisappear(animated)
cameraManager.showErrorBlock = { [weak self] (erTitle: String, erMessage: String) -> Void in self.cameraManager.stopCaptureSession()
let alertController = UIAlertController(title: erTitle, message: erMessage, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: { (alertAction) -> Void in }))
self?.present(alertController, animated: true, completion: nil)
}
} }
// MARK: - @IBActions // MARK: - @IBActions
@IBAction func changeFlashMode(_ sender: UIButton) @IBAction func changeFlashMode(sender: UIButton)
{ {
switch (cameraManager.changeFlashMode()) { self.cameraManager.flashMode = CameraFlashMode(rawValue: (self.cameraManager.flashMode.rawValue+1)%3)!
case .off: switch (self.cameraManager.flashMode) {
sender.setTitle("Flash Off", for: UIControlState()) case .Off:
case .on: sender.setTitle("Flash Off", forState: UIControlState.Normal)
sender.setTitle("Flash On", for: UIControlState()) case .On:
case .auto: sender.setTitle("Flash On", forState: UIControlState.Normal)
sender.setTitle("Flash Auto", for: UIControlState()) case .Auto:
sender.setTitle("Flash Auto", forState: UIControlState.Normal)
} }
} }
@IBAction func recordButtonTapped(_ sender: UIButton) { @IBAction func recordButtonTapped(sender: UIButton)
{
switch (cameraManager.cameraOutputMode) { switch (self.cameraManager.cameraOutputMode) {
case .stillImage: case .StillImage:
cameraManager.capturePictureWithCompletion({ (image, error) -> Void in self.cameraManager.capturePictureWithCompletition({ (image) -> Void in
if let errorOccured = error { let vc: ImageViewController? = self.storyboard?.instantiateViewControllerWithIdentifier("ImageVC") as? ImageViewController
self.cameraManager.showErrorBlock("Error occurred", errorOccured.localizedDescription) if let validVC: ImageViewController = vc {
} validVC.image = image
else { self.navigationController?.pushViewController(validVC, animated: true)
let vc: ImageViewController? = self.storyboard?.instantiateViewController(withIdentifier: "ImageVC") as? ImageViewController
if let validVC: ImageViewController = vc {
if let capturedImage = image {
validVC.image = capturedImage
self.navigationController?.pushViewController(validVC, animated: true)
}
}
} }
}) })
case .videoWithMic, .videoOnly: case .VideoWithMic, .VideoOnly:
sender.isSelected = !sender.isSelected sender.selected = !sender.selected
sender.setTitle(" ", for: UIControlState.selected) sender.setTitle(" ", forState: UIControlState.Selected)
sender.backgroundColor = sender.isSelected ? UIColor.red : UIColor.green sender.backgroundColor = sender.selected ? UIColor.redColor() : UIColor.greenColor()
if sender.isSelected { if sender.selected {
cameraManager.startRecordingVideo() self.cameraManager.startRecordingVideo()
} else { } else {
cameraManager.stopVideoRecording({ (videoURL, error) -> Void in self.cameraManager.stopRecordingVideo({ (videoURL) -> Void in
if let errorOccured = error { println(videoURL)
self.cameraManager.showErrorBlock("Error occurred", errorOccured.localizedDescription)
}
}) })
} }
} }
} }
@IBAction func outputModeButtonTapped(_ sender: UIButton) { @IBAction func outputModeButtonTapped(sender: UIButton)
{
cameraManager.cameraOutputMode = cameraManager.cameraOutputMode == CameraOutputMode.videoWithMic ? CameraOutputMode.stillImage : CameraOutputMode.videoWithMic self.cameraManager.cameraOutputMode = self.cameraManager.cameraOutputMode == CameraOutputMode.VideoWithMic ? CameraOutputMode.StillImage : CameraOutputMode.VideoWithMic
switch (cameraManager.cameraOutputMode) { switch (self.cameraManager.cameraOutputMode) {
case .stillImage: case .StillImage:
cameraButton.isSelected = false self.cameraButton.selected = false
cameraButton.backgroundColor = UIColor.green self.cameraButton.backgroundColor = UIColor.greenColor()
sender.setTitle("Image", for: UIControlState()) sender.setTitle("Image", forState: UIControlState.Normal)
case .videoWithMic, .videoOnly: case .VideoWithMic, .VideoOnly:
sender.setTitle("Video", for: UIControlState()) sender.setTitle("Video", forState: UIControlState.Normal)
} }
} }
@IBAction func changeCameraDevice(_ sender: UIButton) { @IBAction func changeCameraDevice(sender: UIButton)
{
cameraManager.cameraDevice = cameraManager.cameraDevice == CameraDevice.front ? CameraDevice.back : CameraDevice.front self.cameraManager.cameraDevice = self.cameraManager.cameraDevice == CameraDevice.Front ? CameraDevice.Back : CameraDevice.Front
switch (cameraManager.cameraDevice) { switch (self.cameraManager.cameraDevice) {
case .front: case .Front:
sender.setTitle("Front", for: UIControlState()) sender.setTitle("Front", forState: UIControlState.Normal)
case .back: case .Back:
sender.setTitle("Back", for: UIControlState()) sender.setTitle("Back", forState: UIControlState.Normal)
}
}
@IBAction func askForCameraPermissions(_ sender: UIButton) {
cameraManager.askUserForCameraPermission({ permissionGranted in
self.askForPermissionsButton.isHidden = true
self.askForPermissionsLabel.isHidden = true
self.askForPermissionsButton.alpha = 0
self.askForPermissionsLabel.alpha = 0
if permissionGranted {
self.addCameraToView()
}
})
}
@IBAction func changeCameraQuality(_ sender: UIButton) {
switch (cameraManager.changeQualityMode()) {
case .high:
sender.setTitle("High", for: UIControlState())
case .low:
sender.setTitle("Low", for: UIControlState())
case .medium:
sender.setTitle("Medium", for: UIControlState())
} }
} }
} }