Cam
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Installation
Cam is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Cam', '1.0.0'
Quick Usage
- Import the library
import UIKit
import Cam
- Create a Cam object
let camera = Cam()
- Call Display
cam.display(on: self) { (photo) in
}
- Process Photo
cam.display(on: self) { (photo) in
if let photo = photo {
// Example: displaying image on an imageview for 2 seconds
let imageView = UIImageView(frame: self.view.frame)
imageView.contentMode = .scaleAspectFit
imageView.image = photo.image
self.view.addSubview(imageView)
DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: {
imageView.removeFromSuperview()
})
}
}
Author
amirshayegh, [email protected]
License
Cam is available under the MIT license. See the LICENSE file for more info.