项目作者: FreshworksStudio

项目描述 :
An in-app Camera compatible with iPhone and iPads.
高级语言: Swift
项目地址: git://github.com/FreshworksStudio/Cam.git
创建时间: 2018-09-21T17:44:06Z
项目社区:https://github.com/FreshworksStudio/Cam

开源协议:MIT License

下载


Cam

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Alt Text

Installation

Cam is available through CocoaPods. To install
it, simply add the following line to your Podfile:

  1. pod 'Cam', '1.0.0'

Quick Usage

1) Import the library

  1. import UIKit
  2. import Cam

2) Create a Cam object

  1. let camera = Cam()

3) Call Display

  1. cam.display(on: self) { (photo) in
  2. }

4) Process Photo

  1. cam.display(on: self) { (photo) in
  2. if let photo = photo {
  3. // Example: displaying image on an imageview for 2 seconds
  4. let imageView = UIImageView(frame: self.view.frame)
  5. imageView.contentMode = .scaleAspectFit
  6. imageView.image = photo.image
  7. self.view.addSubview(imageView)
  8. DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: {
  9. imageView.removeFromSuperview()
  10. })
  11. }
  12. }

Alt Text

Author

amirshayegh, shayegh@me.com

License

Cam is available under the MIT license. See the LICENSE file for more info.