File tree Expand file tree Collapse file tree 2 files changed +51
-167
lines changed Expand file tree Collapse file tree 2 files changed +51
-167
lines changed Original file line number Diff line number Diff line change 1- # Camera
2- A custom camera, the core function a little click to take pictures, long press the video
1+ # RunsCamera
2+ ###A custom camera, the core function a little click to take pictures, long press the video
3+
4+ # From CocoaPods
5+
6+ ``` java
7+ pod ' RunsCamera' , ' ~> 1.0.3'
8+ ```
9+
10+ ``` swift
11+ #import " ViewController.h"
12+ #import " RunsCameraViewController.h"
13+
14+ @interface ViewController ()< RunsCameraControllerDelegate>
15+
16+ @end
17+
18+ @implementation ViewController
19+
20+ - (void)viewDidLoad {
21+ [super viewDidLoad];
22+ }
23+
24+ - (void)viewWillAppear: (BOOL)animated {
25+ [super viewWillAppear: animated];
26+ }
27+
28+ - (void)touchesBegan: (NSSet< UITouch *> * )touches withEvent: (UIEvent * )event {
29+ RunsCameraViewController * cameraViewController = [RunsCameraViewController new];
30+ cameraViewController.delegate = self ;
31+ [self presentViewController: cameraViewController animated: YES completion: nil ];
32+ }
33+
34+ #pragma mark -- RunsCameraControllerDelegate
35+
36+ - (void)cameraViewControllerDidDismissed: (UIViewController * )controller {
37+ }
38+
39+ - (void)cameraViewControllerDidSelectedAlnbum: (UIViewController * )controller {
40+ }
41+
42+ - (void)cameraViewController: (UIViewController * )controller captureStillImage: (UIImage * )image {
43+ [controller dismissViewControllerAnimated: YES completion: nil ];
44+ }
45+
46+ - (void)cameraViewController: (UIViewController * )controller captureVideoAsset: (RunsVideoAsset * )asset {
47+ [controller dismissViewControllerAnimated: YES completion: nil ];
48+ }
49+
50+ @end
51+ ```
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments