这是一个视图,让您能够控制iOS摄像头的许多方面。
该项目需要Xcode 7来运行,并使用swift 2.2进行编译。
import Celluloid
class ViewController: UIViewController {
let cameraView = CelluloidView()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(cameraView)
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
do {
try cameraView.startCamera() { success in }
} catch {
}
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
cameraView.frame = view.bounds
}
}
Celluloid在MIT许可下可用。请参阅LICENSE文件获取更多信息。