You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a simple Swift class to provide all the configurations you need to create custom camera view in your app.
@@ -15,8 +15,8 @@ The easiest way to install the CameraManager is with [CocoaPods](http://cocoapod
15
15
```ruby
16
16
use_frameworks!
17
17
18
-
pod 'CameraManager', '~> 4.3'
19
-
```
18
+
pod 'CameraManager', '~> 4.4'
19
+
```
20
20
21
21
## Installation with Swift Package Manager
22
22
@@ -41,27 +41,36 @@ let package = Package(
41
41
Add the following line to your Cartfile:
42
42
43
43
```
44
-
github "imaginary-cloud/CameraManager" >= 4.3
44
+
github "imaginary-cloud/CameraManager" >= 4.4
45
45
```
46
46
47
47
And run `carthage update` to build the dynamic framework.
48
48
49
49
## How to use
50
+
50
51
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.
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. `(Default: true)`
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:
193
+
171
194
```swift
172
195
cameraManager.changeFlashMode()
173
196
```
174
197
175
198
You can even setUp your custom block to handle error messages:
176
199
It can be customized to be presented on the Window root view controller, for example.
Supports iOS 9 and above. Xcode 10.0 is required to build the latest code written in Swift 4.2.
197
221
198
-
199
222
Now it's compatible with latest Swift syntax, so if you're using any Swift version prior to 4.2 make sure to use one of the previously tagged releases:
200
223
201
-
- for Swift 4.0 see: [v4.3.0](https://github.com/imaginary-cloud/CameraManager/tree/4.3.0))
224
+
- for Swift 4.0 see: [v4.4.0](https://github.com/imaginary-cloud/CameraManager/tree/4.4.0))
202
225
203
226
- for Swift 3.0 see: [v3.2.0](https://github.com/imaginary-cloud/CameraManager/tree/3.2.0)).
0 commit comments