Initial support for Swift Package Manager
This commit is contained in:
parent
8fb105dec2
commit
fb22e0478f
|
|
@ -0,0 +1,9 @@
|
|||
// Package.swift
|
||||
//
|
||||
// Copyright © 2016 ImaginaryCloud, imaginarycloud.com. This library is licensed under the MIT license.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "CameraManager"
|
||||
)
|
||||
32
README.md
32
README.md
|
|
@ -2,15 +2,15 @@
|
|||
# Camera Manager
|
||||
[](https://github.com/imaginary-cloud/CameraManager) [](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.
|
||||
This is a simple Swift class to provide all the configurations you need to create custom camera view in your app.
|
||||
It follows orientation change and updates UI accordingly, supports front and rear camera selection, pinch to zoom, different flash modes, inputs and outputs.
|
||||
Just drag, drop and use.
|
||||
Just drag, drop and use.
|
||||
|
||||
Now it's compatibile 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.
|
||||
Now it's compatible with latest Swift syntax if you're using any Swift version prior to 2.0 make sure to use one of the previously tagged releases.
|
||||
|
||||
## Installation with CocoaPods
|
||||
|
||||
The easiest way to install the CameraManager is with: [CocoaPods](http://cocoapods.org)
|
||||
The easiest way to install the CameraManager is with: [CocoaPods](http://cocoapods.org)
|
||||
|
||||
### Podfile
|
||||
|
||||
|
|
@ -30,6 +30,20 @@ use_frameworks!
|
|||
pod 'CameraManager', '~> 1.0.14'
|
||||
```
|
||||
|
||||
## Installation with Swift Package Manager
|
||||
|
||||
[Swift Package Manager](https://swift.org/package-manager/) The Swift Package Manager is a tool for managing the distribution of Swift code.
|
||||
|
||||
```
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
dependencies: [
|
||||
.Package(url: "https://github.com/imaginary-cloud/CameraManager", majorVersion: 2, minor: 0)
|
||||
]
|
||||
)
|
||||
```
|
||||
|
||||
## Installation with Carthage
|
||||
|
||||
[Carthage](https://github.com/Carthage/Carthage) is another dependency management tool written in Swift.
|
||||
|
|
@ -58,8 +72,8 @@ cameraManager.addPreviewLayerToView(self.cameraView)
|
|||
```
|
||||
You can set input device to front or back camera:
|
||||
```swift
|
||||
cameraManager.cameraDevice = .Front
|
||||
cameraManager.cameraDevice = .Back
|
||||
cameraManager.cameraDevice = .Front
|
||||
cameraManager.cameraDevice = .Back
|
||||
```
|
||||
|
||||
You can set output format to Image, video or video with audio:
|
||||
|
|
@ -105,15 +119,15 @@ cameraManager.showAccessPermissionPopupAutomatically = false
|
|||
```
|
||||
|
||||
You can even setUp your custom block to handle error messages:
|
||||
It can be customised to be presented on the Window root view controller, for example.
|
||||
It can be customized to be presented on the Window root view controller, for example.
|
||||
```swift
|
||||
cameraManager.showErrorBlock = { (erTitle: String, erMessage: String) -> Void in
|
||||
var alertController = UIAlertController(title: erTitle, message: erMessage, preferredStyle: .Alert)
|
||||
alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (alertAction) -> Void in
|
||||
}))
|
||||
|
||||
|
||||
let topController = UIApplication.sharedApplication().keyWindow?.rootViewController
|
||||
|
||||
|
||||
if (topController != nil) {
|
||||
topController?.presentViewController(alertController, animated: true, completion: { () -> Void in
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<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">
|
||||
<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">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
|
@ -11,16 +12,16 @@
|
|||
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<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">
|
||||
<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">
|
||||
<rect key="frame" x="20" y="439" width="441" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</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">
|
||||
<rect key="frame" x="20" y="140" width="441" height="43"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
|
|||
Loading…
Reference in New Issue