Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zonghongyan/evncamera
📷custom camera
https://github.com/zonghongyan/evncamera
camera cocoapods ios objective-c swift
Last synced: 2 months ago
JSON representation
📷custom camera
- Host: GitHub
- URL: https://github.com/zonghongyan/evncamera
- Owner: zonghongyan
- License: mit
- Created: 2017-06-09T01:10:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-03T05:21:06.000Z (over 4 years ago)
- Last Synced: 2024-12-01T14:17:18.526Z (2 months ago)
- Topics: camera, cocoapods, ios, objective-c, swift
- Language: Objective-C
- Homepage:
- Size: 4.75 MB
- Stars: 25
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## EVNCamera
[![Build Status](https://travis-ci.org/zonghongyan/EVNCamera.svg?branch=master)](https://travis-ci.org/zonghongyan/EVNTouchIDDemo)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/EVNCamera.svg)](https://img.shields.io/cocoapods/v/EVNCamera.svg)
[![License](https://img.shields.io/github/license/zonghongyan/EVNCamera.svg?style=flat)](https://github.com/zonghongyan/EVNCamera/blob/master/LICENSE)## Installation
### CocoaPods
[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
```bash
$ gem install cocoapods
```> CocoaPods 1.1.0+ is required to build EVNCamera.
To integrate EVNCamera into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
#use_frameworks!target '' do
pod 'EVNCamera', '~> 1.0.0'
end
```Then, run the following command:
```bash
$ pod install
```## Use
#### Use in swift
```
class ViewController: UIViewController, EVNCameraControllerDelegate // To follow the protocol EVNCameraControllerDelegate
......let cameraController:EVNCameraController = EVNCameraController.init()
cameraController.cameraControllerDelegate = self;
self.present(cameraController, animated: true, completion: nil)
func cameraController(_ cameraController: EVNCameraController!, didFinishShootWithCameraImage cameraImage: UIImage!) {
self.previewImageView.image = cameraImage
cameraController.dismiss(animated: true) {
};
}func cameraController(_ cameraController: EVNCameraController!, didFinishVideo videoURL: URL!) {
// 视频路径
print("\(videoURL.path)")
}
```#### Use in Objective-C
```
@import EVNCamera; // Or #import "EVNCameraController.h"@interface ViewController ()
......EVNCameraController *cameraController = [[EVNCameraController alloc] init];
cameraController.cameraControllerDelegate = self;
[self presentViewController:cameraController animated:YES completion:nil];
#pragma mark: EVNCameraControllerDelegate method
/// 拍照之使用图片回调
/// @param cameraController 相机对象
/// @param cameraImage 图片
- (void)cameraController:(EVNCameraController *)cameraController didFinishShootWithCameraImage:(UIImage *)cameraImage/// 录制之使用视频
/// @param cameraController 摄像机对象
/// @param videoURL 视频暂存本地的路径
- (void)cameraController:(EVNCameraController *)cameraController didFinishVideo:(NSURL *)videoURL
```### 预览图
![]()