- Swift 3.2 or later
- iOS 8.0 or later
- Insert
github "DarkySwift/LittleOwl" ~> 1.0
to your Cartfile. - Run
carthage update
. - Link your app with
LittleOwl
inCarthage/Build
.
- Insert
pod 'LittleOwl', '~> 1.0'
to your Podfile. - Run
pod install
.
As of iOS 10, Apple requires the additon of the NSCameraUsageDescription
and NSMicrophoneUsageDescription
strings to the info.plist of your application. Example:
<key>NSCameraUsageDescription</key>
<string>To Take Photos and Video</string>
<key>NSMicrophoneUsageDescription</key>
<string>To Record Audio With Video</string>
If you install SwiftyCam from Cocoapods, be sure to import the module into your View Controller:
import LittleOwl
LittleOwl is a drop-in convenience framework. To create a Camera instance, just add this:
let cameraController = CameraViewController(type: .video(10))
cameraController.didSelectVideo = { url in
cameraController.dismiss(animated: true, completion: nil)
}
or
let cameraController = CameraViewController(type: .photo)
cameraController.didSelectPhoto = { image in
cameraController.dismiss(animated: true, completion: nil)
}
That is all that is required to setup the AVSession for photo and video capture. LittleOwl will prompt the user for permission to use the camera/microphone, and configure both the device inputs and outputs.
Carlos Duclós
LittleOwl is available under the MIT license. See the LICENSE file for more info.