├── LICENSE ├── README.md ├── YCameraView.podspec ├── YCameraViewController ├── UI │ ├── flash-auto.png │ ├── flash-auto@2x.png │ ├── flash-off.png │ ├── flash-off@2x.png │ ├── flash.png │ ├── flash@2x.png │ ├── focus-crosshair.png │ ├── focus-crosshair@2x.png │ ├── front-camera.png │ ├── front-camera@2x.png │ ├── grid-icon.png │ ├── grid-icon@2x.png │ ├── grid.png │ ├── grid@2x.png │ ├── library.png │ ├── library@2x.png │ ├── micro_carbon.png │ ├── micro_carbon@2x.png │ ├── take-snap.png │ └── take-snap@2x.png ├── YCameraViewController.h ├── YCameraViewController.m └── YCameraViewController.xib └── YCameraViewDemo ├── Podfile ├── YCameraViewDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── YCameraViewDemo.xccheckout │ └── xcuserdata │ │ └── vijaysales.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── vijaysales.xcuserdatad │ └── xcschemes │ ├── YCameraViewDemo.xcscheme │ └── xcschememanagement.plist ├── YCameraViewDemo ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m └── YCameraViewDemoTests ├── Info.plist └── YCameraViewDemoTests.m /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Yuvrajsinh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | YCameraView 2 | =========== 3 | 4 | ![Version](https://img.shields.io/badge/pod-v1.1.0-green.svg) ![License](http://img.shields.io/badge/license-MIT-orange.png) 5 | 6 | Custom Camera Controller 7 | 8 | YCameraviewController is a custom Image picker controller that allows you to quickly switch between Camera and iPhone Photo Library. 9 | This Controller only useful for capturing Square Image. 10 | 11 | Required Framework 12 | ================== 13 | 14 | AVFoundation.framework 15 | 16 | ImageIO.framework 17 | 18 | CoreMotion.framework 19 | 20 | ## Installation 21 | 22 | #### [CocoaPods](http://cocoapods.org) 23 | 24 | ```objc 25 | pod 'YCameraView', '~> 1.1.0' 26 | ```` 27 | 28 | How to Use it 29 | ============= 30 | 31 | Import "YCameraViewController.h" in your ViewController.h file where you want to use this. 32 | ```objc 33 | #import "YCameraViewController.h" 34 | 35 | @interface ViewController : UIViewController 36 | 37 | @end 38 | ``` 39 | In ViewController.m file 40 | 41 | To open YCameraViewController 42 | ```objc 43 | YCameraViewController *camController = [[YCameraViewController alloc] initWithNibName:@"YCameraViewController" bundle:nil]; 44 | camController.delegate=self; 45 | [self presentViewController:camController animated:YES completion:^{ 46 | // completion code 47 | }]; 48 | ``` 49 | Using YCameraViewControllerDelegate 50 | ```objc 51 | -(void)didFinishPickingImage:(UIImage *)image{ 52 | // Use image as per your need 53 | } 54 | -(void)yCameraControllerdidSkipped{ 55 | // Called when user clicks on Skip button on YCameraViewController view 56 | } 57 | -(void)yCameraControllerDidCancel{ 58 | // Called when user clicks on "X" button to close YCameraViewController 59 | } 60 | ``` 61 | 62 | [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TLYC7S2GS34A4&os0=Coffe) 63 | -------------------------------------------------------------------------------- /YCameraView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint YCameraView.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | 7 | Pod::Spec.new do |s| 8 | s.name = "YCameraView" 9 | s.version = "1.1.0" 10 | 11 | s.summary = "Custom Camera Controller similar to the camera View on Instagram." 12 | 13 | s.description = <<-DESC 14 | YCameraViewController is a custom Image picker controller that allows you to quickly switch between Camera and iPhone Photo Library. This Controller only useful for capturing Square Image. 15 | DESC 16 | 17 | s.homepage = "https://github.com/yuvirajsinh/YCameraView" 18 | s.license = { :type => "MIT", :file => "LICENSE" } 19 | s.author = "yuvirajsinh" 20 | s.platform = :ios, '7.0' 21 | s.source = { :git => "https://github.com/yuvirajsinh/YCameraView.git", :tag => s.version.to_s } 22 | s.source_files = "YCameraViewController/**/*.{h,m}" 23 | 24 | s.resources = ["YCameraViewController/UI/**/*.png", "YCameraViewController/YCameraViewController.xib"] 25 | 26 | s.frameworks = "AVFoundation", "ImageIO", "CoreMotion" 27 | s.requires_arc = true 28 | 29 | end 30 | -------------------------------------------------------------------------------- /YCameraViewController/UI/flash-auto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/flash-auto.png -------------------------------------------------------------------------------- /YCameraViewController/UI/flash-auto@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/flash-auto@2x.png -------------------------------------------------------------------------------- /YCameraViewController/UI/flash-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/flash-off.png -------------------------------------------------------------------------------- /YCameraViewController/UI/flash-off@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/flash-off@2x.png -------------------------------------------------------------------------------- /YCameraViewController/UI/flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/flash.png -------------------------------------------------------------------------------- /YCameraViewController/UI/flash@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/flash@2x.png -------------------------------------------------------------------------------- /YCameraViewController/UI/focus-crosshair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/focus-crosshair.png -------------------------------------------------------------------------------- /YCameraViewController/UI/focus-crosshair@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/focus-crosshair@2x.png -------------------------------------------------------------------------------- /YCameraViewController/UI/front-camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/front-camera.png -------------------------------------------------------------------------------- /YCameraViewController/UI/front-camera@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/front-camera@2x.png -------------------------------------------------------------------------------- /YCameraViewController/UI/grid-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/grid-icon.png -------------------------------------------------------------------------------- /YCameraViewController/UI/grid-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/grid-icon@2x.png -------------------------------------------------------------------------------- /YCameraViewController/UI/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/grid.png -------------------------------------------------------------------------------- /YCameraViewController/UI/grid@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/grid@2x.png -------------------------------------------------------------------------------- /YCameraViewController/UI/library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/library.png -------------------------------------------------------------------------------- /YCameraViewController/UI/library@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/library@2x.png -------------------------------------------------------------------------------- /YCameraViewController/UI/micro_carbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/micro_carbon.png -------------------------------------------------------------------------------- /YCameraViewController/UI/micro_carbon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/micro_carbon@2x.png -------------------------------------------------------------------------------- /YCameraViewController/UI/take-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/take-snap.png -------------------------------------------------------------------------------- /YCameraViewController/UI/take-snap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewController/UI/take-snap@2x.png -------------------------------------------------------------------------------- /YCameraViewController/YCameraViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PhotoShapViewController.h 3 | // NoshedItStaging 4 | // 5 | // Created by yuvraj on 08/01/14. 6 | // Copyright (c) 2014 yuviraj.jadeja@gmail.com. All rights reserved. 7 | // 8 | 9 | // 10 | // ARC Helper 11 | #ifndef ah_retain 12 | #if __has_feature(objc_arc) 13 | #define ah_retain self 14 | #define ah_dealloc self 15 | #define release self 16 | #define autorelease self 17 | #else 18 | #define ah_retain retain 19 | #define ah_dealloc dealloc 20 | #define __bridge 21 | #endif 22 | #endif 23 | 24 | // ARC Helper ends 25 | 26 | #import 27 | #import 28 | #import 29 | 30 | @protocol YCameraViewControllerDelegate; 31 | 32 | @interface YCameraViewController : UIViewController { 33 | 34 | UIImagePickerController *imgPicker; 35 | BOOL pickerDidShow; 36 | 37 | //Today Implementation 38 | BOOL FrontCamera; 39 | BOOL haveImage; 40 | BOOL initializeCamera, photoFromCam; 41 | AVCaptureSession *session; 42 | AVCaptureVideoPreviewLayer *captureVideoPreviewLayer; 43 | AVCaptureStillImageOutput *stillImageOutput; 44 | UIImage *croppedImageWithoutOrientation; 45 | } 46 | @property (nonatomic, readwrite) BOOL dontAllowResetRestaurant; 47 | @property (nonatomic, assign) id delegate; 48 | 49 | #pragma mark - 50 | @property (nonatomic, strong) IBOutlet UIButton *photoCaptureButton; 51 | @property (nonatomic, strong) IBOutlet UIButton *cancelButton; 52 | @property (nonatomic, strong) IBOutlet UIButton *cameraToggleButton; 53 | @property (nonatomic, strong) IBOutlet UIButton *libraryToggleButton; 54 | @property (nonatomic, strong) IBOutlet UIButton *flashToggleButton; 55 | @property (retain, nonatomic) IBOutlet UIImageView *ImgViewGrid; 56 | @property (nonatomic, strong) IBOutlet UIView *photoBar; 57 | @property (nonatomic, strong) IBOutlet UIView *topBar; 58 | @property (retain, nonatomic) IBOutlet UIView *imagePreview; 59 | @property (retain, nonatomic) IBOutlet UIImageView *captureImage; 60 | 61 | @end 62 | 63 | @protocol YCameraViewControllerDelegate 64 | - (void)didFinishPickingImage:(UIImage *)image; 65 | - (void)yCameraControllerDidCancel; 66 | - (void)yCameraControllerdidSkipped; 67 | @end 68 | -------------------------------------------------------------------------------- /YCameraViewController/YCameraViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PhotoShapViewController.m 3 | // NoshedItStaging 4 | // 5 | // Created by yuvraj on 08/01/14. 6 | // Copyright (c) 2014 yuviraj.jadeja@gmail.com. All rights reserved. 7 | // 8 | 9 | #import "YCameraViewController.h" 10 | #import 11 | 12 | #define DegreesToRadians(x) ((x) * M_PI / 180.0) 13 | 14 | @interface YCameraViewController (){ 15 | UIInterfaceOrientation orientationLast, orientationAfterProcess; 16 | CMMotionManager *motionManager; 17 | } 18 | @end 19 | 20 | @implementation YCameraViewController 21 | @synthesize delegate; 22 | 23 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 24 | { 25 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 26 | if (self) { 27 | // Custom initialization 28 | } 29 | return self; 30 | } 31 | 32 | - (void)viewDidLoad 33 | { 34 | [super viewDidLoad]; 35 | 36 | // if ([self respondsToSelector:@selector(edgesForExtendedLayout)]){ 37 | // self.edgesForExtendedLayout = UIRectEdgeNone; 38 | // } 39 | 40 | self.navigationController.navigationBarHidden = YES; 41 | [self.navigationController setNavigationBarHidden:YES]; 42 | 43 | // Do any additional setup after loading the view. 44 | pickerDidShow = NO; 45 | 46 | FrontCamera = NO; 47 | self.captureImage.hidden = YES; 48 | 49 | // Setup UIImagePicker Controller 50 | imgPicker = [[UIImagePickerController alloc] init]; 51 | imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 52 | imgPicker.delegate = self; 53 | imgPicker.allowsEditing = YES; 54 | 55 | croppedImageWithoutOrientation = [[UIImage alloc] init]; 56 | 57 | initializeCamera = YES; 58 | photoFromCam = YES; 59 | 60 | // Set auto-flash initially 61 | self.flashToggleButton.tag = AVCaptureFlashModeAuto; 62 | 63 | // Initialize Motion Manager 64 | [self initializeMotionManager]; 65 | } 66 | 67 | - (void)viewWillAppear:(BOOL)animated{ 68 | [super viewWillAppear:animated]; 69 | [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; 70 | } 71 | 72 | - (void)viewDidAppear:(BOOL)animated{ 73 | [super viewDidAppear:animated]; 74 | 75 | if (initializeCamera){ 76 | initializeCamera = NO; 77 | 78 | // Initialize camera 79 | [self initializeCamera]; 80 | } 81 | 82 | } 83 | 84 | - (void)viewWillDisappear:(BOOL)animated{ 85 | [super viewWillDisappear:animated]; 86 | [session stopRunning]; 87 | // [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide]; 88 | // [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 89 | } 90 | 91 | - (void)didReceiveMemoryWarning 92 | { 93 | [super didReceiveMemoryWarning]; 94 | // Dispose of any resources that can be recreated. 95 | } 96 | 97 | -(void) dealloc 98 | { 99 | [_imagePreview release]; 100 | [_captureImage release]; 101 | [imgPicker release]; 102 | imgPicker = nil; 103 | 104 | if (session) 105 | [session release], session=nil; 106 | 107 | if (captureVideoPreviewLayer) 108 | [captureVideoPreviewLayer release], captureVideoPreviewLayer=nil; 109 | 110 | if (stillImageOutput) 111 | [stillImageOutput release], stillImageOutput=nil; 112 | } 113 | 114 | #pragma mark - CoreMotion Task 115 | - (void)initializeMotionManager{ 116 | motionManager = [[CMMotionManager alloc] init]; 117 | motionManager.accelerometerUpdateInterval = .2; 118 | motionManager.gyroUpdateInterval = .2; 119 | 120 | [motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue currentQueue] 121 | withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) { 122 | if (!error) { 123 | [self outputAccelertionData:accelerometerData.acceleration]; 124 | } 125 | else{ 126 | NSLog(@"%@", error); 127 | } 128 | }]; 129 | } 130 | 131 | #pragma mark - UIAccelerometer callback 132 | 133 | - (void)outputAccelertionData:(CMAcceleration)acceleration{ 134 | UIInterfaceOrientation orientationNew; 135 | 136 | if (acceleration.x >= 0.75) { 137 | orientationNew = UIInterfaceOrientationLandscapeLeft; 138 | } 139 | else if (acceleration.x <= -0.75) { 140 | orientationNew = UIInterfaceOrientationLandscapeRight; 141 | } 142 | else if (acceleration.y <= -0.75) { 143 | orientationNew = UIInterfaceOrientationPortrait; 144 | } 145 | else if (acceleration.y >= 0.75) { 146 | orientationNew = UIInterfaceOrientationPortraitUpsideDown; 147 | } 148 | else { 149 | // Consider same as last time 150 | return; 151 | } 152 | 153 | if (orientationNew == orientationLast) 154 | return; 155 | 156 | // NSLog(@"Going from %@ to %@!", [[self class] orientationToText:orientationLast], [[self class] orientationToText:orientationNew]); 157 | 158 | orientationLast = orientationNew; 159 | } 160 | 161 | #ifdef DEBUG 162 | +(NSString*)orientationToText:(const UIInterfaceOrientation)ORIENTATION { 163 | switch (ORIENTATION) { 164 | case UIInterfaceOrientationPortrait: 165 | return @"UIInterfaceOrientationPortrait"; 166 | case UIInterfaceOrientationPortraitUpsideDown: 167 | return @"UIInterfaceOrientationPortraitUpsideDown"; 168 | case UIInterfaceOrientationLandscapeLeft: 169 | return @"UIInterfaceOrientationLandscapeLeft"; 170 | case UIInterfaceOrientationLandscapeRight: 171 | return @"UIInterfaceOrientationLandscapeRight"; 172 | case UIInterfaceOrientationUnknown: 173 | return @"UIInterfaceOrientationUnknown"; 174 | } 175 | return @"Unknown orientation!"; 176 | } 177 | #endif 178 | 179 | #pragma mark - Camera Initialization 180 | 181 | //AVCaptureSession to show live video feed in view 182 | - (void) initializeCamera { 183 | if (session) 184 | [session release], session=nil; 185 | 186 | session = [[AVCaptureSession alloc] init]; 187 | session.sessionPreset = AVCaptureSessionPresetPhoto; 188 | 189 | if (captureVideoPreviewLayer) 190 | [captureVideoPreviewLayer release], captureVideoPreviewLayer=nil; 191 | 192 | captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session]; 193 | [captureVideoPreviewLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill]; 194 | 195 | captureVideoPreviewLayer.frame = self.imagePreview.bounds; 196 | [self.imagePreview.layer addSublayer:captureVideoPreviewLayer]; 197 | 198 | UIView *view = [self imagePreview]; 199 | CALayer *viewLayer = [view layer]; 200 | [viewLayer setMasksToBounds:YES]; 201 | 202 | CGRect bounds = [view bounds]; 203 | [captureVideoPreviewLayer setFrame:bounds]; 204 | 205 | NSArray *devices = [AVCaptureDevice devices]; 206 | AVCaptureDevice *frontCamera=nil; 207 | AVCaptureDevice *backCamera=nil; 208 | 209 | // check if device available 210 | if (devices.count==0) { 211 | NSLog(@"No Camera Available"); 212 | [self disableCameraDeviceControls]; 213 | return; 214 | } 215 | 216 | for (AVCaptureDevice *device in devices) { 217 | 218 | NSLog(@"Device name: %@", [device localizedName]); 219 | 220 | if ([device hasMediaType:AVMediaTypeVideo]) { 221 | 222 | if ([device position] == AVCaptureDevicePositionBack) { 223 | NSLog(@"Device position : back"); 224 | backCamera = device; 225 | } 226 | else { 227 | NSLog(@"Device position : front"); 228 | frontCamera = device; 229 | } 230 | } 231 | } 232 | 233 | if (!FrontCamera) { 234 | 235 | if ([backCamera hasFlash]){ 236 | [backCamera lockForConfiguration:nil]; 237 | if (self.flashToggleButton.tag==AVCaptureFlashModeAuto){ 238 | [backCamera setFlashMode:AVCaptureFlashModeAuto]; 239 | } 240 | else if(self.flashToggleButton.tag==AVCaptureFlashModeOn){ 241 | [backCamera setFlashMode:AVCaptureFlashModeOn]; 242 | } 243 | else{ 244 | [backCamera setFlashMode:AVCaptureFlashModeOff]; 245 | } 246 | [backCamera unlockForConfiguration]; 247 | 248 | [self.flashToggleButton setEnabled:YES]; 249 | } 250 | else{ 251 | if ([backCamera isFlashModeSupported:AVCaptureFlashModeOff]) { 252 | [backCamera lockForConfiguration:nil]; 253 | [backCamera setFlashMode:AVCaptureFlashModeOff]; 254 | [backCamera unlockForConfiguration]; 255 | } 256 | [self.flashToggleButton setEnabled:NO]; 257 | } 258 | 259 | NSError *error = nil; 260 | AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:backCamera error:&error]; 261 | if (error) { 262 | NSLog(@"ERROR: trying to open camera: %@", error); 263 | [[[UIAlertView alloc] initWithTitle:error.localizedDescription 264 | message:error.localizedFailureReason 265 | delegate:nil 266 | cancelButtonTitle:@"OK" 267 | otherButtonTitles:nil] show]; 268 | [self cancel:self.cancelButton]; 269 | return; 270 | } 271 | [session addInput:input]; 272 | } 273 | 274 | if (FrontCamera) { 275 | [self.flashToggleButton setEnabled:NO]; 276 | NSError *error = nil; 277 | AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:frontCamera error:&error]; 278 | if (!input) { 279 | NSLog(@"ERROR: trying to open camera: %@", error); 280 | } 281 | [session addInput:input]; 282 | } 283 | 284 | if (stillImageOutput) 285 | [stillImageOutput release], stillImageOutput=nil; 286 | 287 | stillImageOutput = [[AVCaptureStillImageOutput alloc] init]; 288 | NSDictionary *outputSettings = [[[NSDictionary alloc] initWithObjectsAndKeys: AVVideoCodecJPEG, AVVideoCodecKey, nil] autorelease]; 289 | [stillImageOutput setOutputSettings:outputSettings]; 290 | 291 | [session addOutput:stillImageOutput]; 292 | 293 | [session startRunning]; 294 | } 295 | 296 | - (IBAction)snapImage:(id)sender { 297 | [self.photoCaptureButton setEnabled:NO]; 298 | 299 | if (!haveImage) { 300 | self.captureImage.image = nil; //remove old image from view 301 | self.captureImage.hidden = NO; //show the captured image view 302 | self.imagePreview.hidden = YES; //hide the live video feed 303 | [self capImage]; 304 | } 305 | else { 306 | self.captureImage.hidden = YES; 307 | self.imagePreview.hidden = NO; 308 | haveImage = NO; 309 | } 310 | } 311 | 312 | - (void) capImage { //method to capture image from AVCaptureSession video feed 313 | AVCaptureConnection *videoConnection = nil; 314 | for (AVCaptureConnection *connection in stillImageOutput.connections) { 315 | 316 | for (AVCaptureInputPort *port in [connection inputPorts]) { 317 | 318 | if ([[port mediaType] isEqual:AVMediaTypeVideo] ) { 319 | videoConnection = connection; 320 | break; 321 | } 322 | } 323 | 324 | if (videoConnection) { 325 | break; 326 | } 327 | } 328 | 329 | NSLog(@"about to request a capture from: %@", stillImageOutput); 330 | [stillImageOutput captureStillImageAsynchronouslyFromConnection:videoConnection completionHandler: ^(CMSampleBufferRef imageSampleBuffer, NSError *error) { 331 | 332 | if (imageSampleBuffer != NULL) { 333 | 334 | NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer]; 335 | [self processImage:[UIImage imageWithData:imageData]]; 336 | } 337 | }]; 338 | } 339 | 340 | - (UIImage*)imageWithImage:(UIImage *)sourceImage scaledToWidth:(float) i_width 341 | { 342 | float oldWidth = sourceImage.size.width; 343 | float scaleFactor = i_width / oldWidth; 344 | 345 | float newHeight = sourceImage.size.height * scaleFactor; 346 | float newWidth = oldWidth * scaleFactor; 347 | 348 | UIGraphicsBeginImageContext(CGSizeMake(newWidth, newHeight)); 349 | [sourceImage drawInRect:CGRectMake(0, 0, newWidth, newHeight)]; 350 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 351 | UIGraphicsEndImageContext(); 352 | return newImage; 353 | } 354 | 355 | - (void) processImage:(UIImage *)image { //process captured image, crop, resize and rotate 356 | haveImage = YES; 357 | photoFromCam = YES; 358 | 359 | // Resize image to 640x640 360 | // Resize image 361 | // NSLog(@"Image size %@",NSStringFromCGSize(image.size)); 362 | 363 | UIImage *smallImage = [self imageWithImage:image scaledToWidth:640.0f]; //UIGraphicsGetImageFromCurrentImageContext(); 364 | 365 | CGRect cropRect = CGRectMake(0, 105, 640, 640); 366 | CGImageRef imageRef = CGImageCreateWithImageInRect([smallImage CGImage], cropRect); 367 | 368 | croppedImageWithoutOrientation = [[UIImage imageWithCGImage:imageRef] copy]; 369 | 370 | UIImage *croppedImage = nil; 371 | // assetOrientation = ALAssetOrientationUp; 372 | 373 | // adjust image orientation 374 | NSLog(@"orientation: %ld",orientationLast); 375 | orientationAfterProcess = orientationLast; 376 | switch (orientationLast) { 377 | case UIInterfaceOrientationPortrait: 378 | NSLog(@"UIInterfaceOrientationPortrait"); 379 | croppedImage = [UIImage imageWithCGImage:imageRef]; 380 | break; 381 | 382 | case UIInterfaceOrientationPortraitUpsideDown: 383 | NSLog(@"UIInterfaceOrientationPortraitUpsideDown"); 384 | croppedImage = [[[UIImage alloc] initWithCGImage: imageRef 385 | scale: 1.0 386 | orientation: UIImageOrientationDown] autorelease]; 387 | break; 388 | 389 | case UIInterfaceOrientationLandscapeLeft: 390 | NSLog(@"UIInterfaceOrientationLandscapeLeft"); 391 | croppedImage = [[[UIImage alloc] initWithCGImage: imageRef 392 | scale: 1.0 393 | orientation: UIImageOrientationRight] autorelease]; 394 | break; 395 | 396 | case UIInterfaceOrientationLandscapeRight: 397 | NSLog(@"UIInterfaceOrientationLandscapeRight"); 398 | croppedImage = [[[UIImage alloc] initWithCGImage: imageRef 399 | scale: 1.0 400 | orientation: UIImageOrientationLeft] autorelease]; 401 | break; 402 | 403 | default: 404 | croppedImage = [UIImage imageWithCGImage:imageRef]; 405 | break; 406 | } 407 | 408 | CGImageRelease(imageRef); 409 | 410 | [self.captureImage setImage:croppedImage]; 411 | 412 | [self setCapturedImage]; 413 | } 414 | 415 | - (void)setCapturedImage{ 416 | // Stop capturing image 417 | [session stopRunning]; 418 | 419 | // Hide Top/Bottom controller after taking photo for editing 420 | [self hideControllers]; 421 | } 422 | 423 | #pragma mark - Device Availability Controls 424 | - (void)disableCameraDeviceControls{ 425 | self.cameraToggleButton.enabled = NO; 426 | self.flashToggleButton.enabled = NO; 427 | self.photoCaptureButton.enabled = NO; 428 | } 429 | 430 | #pragma mark - UIImagePicker Delegate 431 | - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ 432 | if (info) { 433 | photoFromCam = NO; 434 | 435 | UIImage* outputImage = [info objectForKey:UIImagePickerControllerEditedImage]; 436 | if (outputImage == nil) { 437 | outputImage = [info objectForKey:UIImagePickerControllerOriginalImage]; 438 | } 439 | 440 | if (outputImage) { 441 | self.captureImage.hidden = NO; 442 | self.captureImage.image=outputImage; 443 | 444 | [self dismissViewControllerAnimated:YES completion:nil]; 445 | 446 | // Hide Top/Bottom controller after taking photo for editing 447 | [self hideControllers]; 448 | } 449 | } 450 | } 451 | 452 | - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{ 453 | initializeCamera = YES; 454 | [picker dismissViewControllerAnimated:YES completion:nil]; 455 | } 456 | 457 | #pragma mark - Button clicks 458 | - (IBAction)gridToogle:(UIButton *)sender{ 459 | if (sender.selected) { 460 | sender.selected = NO; 461 | [UIView animateWithDuration:0.2 delay:0.0 options:0 animations:^{ 462 | self.ImgViewGrid.alpha = 1.0f; 463 | } completion:nil]; 464 | } 465 | else{ 466 | sender.selected = YES; 467 | [UIView animateWithDuration:0.2 delay:0.0 options:0 animations:^{ 468 | self.ImgViewGrid.alpha = 0.0f; 469 | } completion:nil]; 470 | } 471 | } 472 | 473 | -(IBAction)switchToLibrary:(id)sender { 474 | 475 | if (session) { 476 | [session stopRunning]; 477 | } 478 | 479 | // self.captureImage = nil; 480 | 481 | // UIImagePickerController* imagePickerController = [[UIImagePickerController alloc] init]; 482 | // imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 483 | // imagePickerController.delegate = self; 484 | // imagePickerController.allowsEditing = YES; 485 | [self presentViewController:imgPicker animated:YES completion:NULL]; 486 | } 487 | 488 | - (IBAction)skipped:(id)sender{ 489 | 490 | if ([delegate respondsToSelector:@selector(yCameraControllerdidSkipped)]) { 491 | [delegate yCameraControllerdidSkipped]; 492 | } 493 | 494 | // Dismiss self view controller 495 | [self dismissViewControllerAnimated:YES completion:nil]; 496 | } 497 | 498 | - (IBAction)cancel:(id)sender { 499 | if ([delegate respondsToSelector:@selector(yCameraControllerDidCancel)]) { 500 | [delegate yCameraControllerDidCancel]; 501 | } 502 | 503 | // Dismiss self view controller 504 | [self dismissViewControllerAnimated:YES completion:nil]; 505 | } 506 | 507 | - (IBAction)donePhotoCapture:(id)sender{ 508 | 509 | if ([delegate respondsToSelector:@selector(didFinishPickingImage:)]) { 510 | [delegate didFinishPickingImage:self.captureImage.image]; 511 | } 512 | 513 | // Dismiss self view controller 514 | [self dismissViewControllerAnimated:YES completion:nil]; 515 | } 516 | 517 | - (IBAction)retakePhoto:(id)sender{ 518 | [self.photoCaptureButton setEnabled:YES]; 519 | self.captureImage.image = nil; 520 | self.imagePreview.hidden = NO; 521 | // Show Camera device controls 522 | [self showControllers]; 523 | 524 | haveImage=NO; 525 | FrontCamera = NO; 526 | // [self performSelector:@selector(initializeCamera) withObject:nil afterDelay:0.001]; 527 | [session startRunning]; 528 | } 529 | 530 | - (IBAction)switchCamera:(UIButton *)sender { //switch cameras front and rear cameras 531 | // Stop current recording process 532 | [session stopRunning]; 533 | 534 | if (sender.selected) { // Switch to Back camera 535 | sender.selected = NO; 536 | FrontCamera = NO; 537 | [self performSelector:@selector(initializeCamera) withObject:nil afterDelay:0.001]; 538 | } 539 | else { // Switch to Front camera 540 | sender.selected = YES; 541 | FrontCamera = YES; 542 | [self performSelector:@selector(initializeCamera) withObject:nil afterDelay:0.001]; 543 | } 544 | } 545 | 546 | - (IBAction)toogleFlash:(UIButton *)sender{ 547 | if (!FrontCamera) { 548 | 549 | NSArray *devices = [AVCaptureDevice devices]; 550 | for (AVCaptureDevice *device in devices) { 551 | 552 | NSLog(@"Device name: %@", [device localizedName]); 553 | 554 | if ([device hasMediaType:AVMediaTypeVideo]) { 555 | 556 | if ([device position] == AVCaptureDevicePositionBack) { 557 | NSLog(@"Device position : back"); 558 | if ([device hasFlash]){ 559 | 560 | [device lockForConfiguration:nil]; 561 | 562 | if (sender.tag==AVCaptureFlashModeAuto) { // Current flash mode is Auto, set it to On 563 | [device setFlashMode:AVCaptureFlashModeOn]; 564 | sender.tag = AVCaptureFlashModeOn; 565 | [sender setImage:[UIImage imageNamed:@"flash"] forState:UIControlStateNormal]; 566 | } 567 | else if (sender.tag==AVCaptureFlashModeOn){ // Current flash mode is On, set it to Off 568 | [device setFlashMode:AVCaptureFlashModeOff]; 569 | sender.tag = AVCaptureFlashModeOff; 570 | [sender setImage:[UIImage imageNamed:@"flash-off"] forState:UIControlStateNormal]; 571 | } 572 | else{ // Current flash mode is Off, set it to Auto 573 | [device setFlashMode:AVCaptureFlashModeAuto]; 574 | sender.tag = AVCaptureFlashModeAuto; 575 | [sender setImage:[UIImage imageNamed:@"flash-auto"] forState:UIControlStateNormal]; 576 | } 577 | 578 | [device unlockForConfiguration]; 579 | 580 | break; 581 | } 582 | } 583 | } 584 | } 585 | } 586 | } 587 | 588 | #pragma mark - UI Control Helpers 589 | - (void)hideControllers{ 590 | [UIView animateWithDuration:0.2 animations:^{ 591 | //1)animate them out of screen 592 | self.photoBar.center = CGPointMake(self.photoBar.center.x, self.photoBar.center.y+116.0); 593 | self.topBar.center = CGPointMake(self.topBar.center.x, self.topBar.center.y-44.0); 594 | 595 | //2)actually hide them 596 | self.photoBar.alpha = 0.0; 597 | self.topBar.alpha = 0.0; 598 | 599 | } completion:nil]; 600 | } 601 | 602 | - (void)showControllers{ 603 | [UIView animateWithDuration:0.2 animations:^{ 604 | //1)animate them into screen 605 | self.photoBar.center = CGPointMake(self.photoBar.center.x, self.photoBar.center.y-116.0); 606 | self.topBar.center = CGPointMake(self.topBar.center.x, self.topBar.center.y+44.0); 607 | 608 | //2)actually show them 609 | self.photoBar.alpha = 1.0; 610 | self.topBar.alpha = 1.0; 611 | 612 | } completion:nil]; 613 | } 614 | 615 | @end 616 | -------------------------------------------------------------------------------- /YCameraViewController/YCameraViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 104 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 220 | 256 | 291 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 423 | 457 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | -------------------------------------------------------------------------------- /YCameraViewDemo/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '7.0' 3 | xcodeproj 'YCameraViewDemo.xcodeproj' 4 | pod 'YCameraView', '1.1.0' -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5ACA58FCFA53C3615F62FADB /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FAC89F6F07C5B384857B17C /* libPods.a */; }; 11 | 8B153F4B1B66498C00DF40C2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B153F4A1B66498C00DF40C2 /* main.m */; }; 12 | 8B153F4E1B66498C00DF40C2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B153F4D1B66498C00DF40C2 /* AppDelegate.m */; }; 13 | 8B153F511B66498D00DF40C2 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B153F501B66498D00DF40C2 /* ViewController.m */; }; 14 | 8B153F541B66498D00DF40C2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8B153F521B66498D00DF40C2 /* Main.storyboard */; }; 15 | 8B153F561B66498D00DF40C2 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8B153F551B66498D00DF40C2 /* Images.xcassets */; }; 16 | 8B153F591B66498D00DF40C2 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8B153F571B66498D00DF40C2 /* LaunchScreen.xib */; }; 17 | 8B153F651B66498E00DF40C2 /* YCameraViewDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B153F641B66498E00DF40C2 /* YCameraViewDemoTests.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 8B153F5F1B66498D00DF40C2 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 8B153F3D1B66498C00DF40C2 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 8B153F441B66498C00DF40C2; 26 | remoteInfo = YCameraViewDemo; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 0FAC89F6F07C5B384857B17C /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 703A1D4DCE568BDC972C3C44 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 33 | 8B153F451B66498C00DF40C2 /* YCameraViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YCameraViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 8B153F491B66498C00DF40C2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 8B153F4A1B66498C00DF40C2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 36 | 8B153F4C1B66498C00DF40C2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 37 | 8B153F4D1B66498C00DF40C2 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 38 | 8B153F4F1B66498C00DF40C2 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 39 | 8B153F501B66498D00DF40C2 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 40 | 8B153F531B66498D00DF40C2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 41 | 8B153F551B66498D00DF40C2 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 42 | 8B153F581B66498D00DF40C2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 43 | 8B153F5E1B66498D00DF40C2 /* YCameraViewDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YCameraViewDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 8B153F631B66498E00DF40C2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | 8B153F641B66498E00DF40C2 /* YCameraViewDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YCameraViewDemoTests.m; sourceTree = ""; }; 46 | E1359BD6450748C682697A6D /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | 8B153F421B66498C00DF40C2 /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | 5ACA58FCFA53C3615F62FADB /* libPods.a in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | 8B153F5B1B66498D00DF40C2 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 8B153F3C1B66498C00DF40C2 = { 69 | isa = PBXGroup; 70 | children = ( 71 | 8B153F471B66498C00DF40C2 /* YCameraViewDemo */, 72 | 8B153F611B66498D00DF40C2 /* YCameraViewDemoTests */, 73 | 8B153F461B66498C00DF40C2 /* Products */, 74 | F806647EF750EE6DF34ACD08 /* Pods */, 75 | C00CF9669EDDC000D6E2E2C5 /* Frameworks */, 76 | ); 77 | sourceTree = ""; 78 | }; 79 | 8B153F461B66498C00DF40C2 /* Products */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 8B153F451B66498C00DF40C2 /* YCameraViewDemo.app */, 83 | 8B153F5E1B66498D00DF40C2 /* YCameraViewDemoTests.xctest */, 84 | ); 85 | name = Products; 86 | sourceTree = ""; 87 | }; 88 | 8B153F471B66498C00DF40C2 /* YCameraViewDemo */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 8B153F4C1B66498C00DF40C2 /* AppDelegate.h */, 92 | 8B153F4D1B66498C00DF40C2 /* AppDelegate.m */, 93 | 8B153F4F1B66498C00DF40C2 /* ViewController.h */, 94 | 8B153F501B66498D00DF40C2 /* ViewController.m */, 95 | 8B153F521B66498D00DF40C2 /* Main.storyboard */, 96 | 8B153F551B66498D00DF40C2 /* Images.xcassets */, 97 | 8B153F571B66498D00DF40C2 /* LaunchScreen.xib */, 98 | 8B153F481B66498C00DF40C2 /* Supporting Files */, 99 | ); 100 | path = YCameraViewDemo; 101 | sourceTree = ""; 102 | }; 103 | 8B153F481B66498C00DF40C2 /* Supporting Files */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 8B153F491B66498C00DF40C2 /* Info.plist */, 107 | 8B153F4A1B66498C00DF40C2 /* main.m */, 108 | ); 109 | name = "Supporting Files"; 110 | sourceTree = ""; 111 | }; 112 | 8B153F611B66498D00DF40C2 /* YCameraViewDemoTests */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 8B153F641B66498E00DF40C2 /* YCameraViewDemoTests.m */, 116 | 8B153F621B66498E00DF40C2 /* Supporting Files */, 117 | ); 118 | path = YCameraViewDemoTests; 119 | sourceTree = ""; 120 | }; 121 | 8B153F621B66498E00DF40C2 /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 8B153F631B66498E00DF40C2 /* Info.plist */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | C00CF9669EDDC000D6E2E2C5 /* Frameworks */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 0FAC89F6F07C5B384857B17C /* libPods.a */, 133 | ); 134 | name = Frameworks; 135 | sourceTree = ""; 136 | }; 137 | F806647EF750EE6DF34ACD08 /* Pods */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 703A1D4DCE568BDC972C3C44 /* Pods.debug.xcconfig */, 141 | E1359BD6450748C682697A6D /* Pods.release.xcconfig */, 142 | ); 143 | name = Pods; 144 | sourceTree = ""; 145 | }; 146 | /* End PBXGroup section */ 147 | 148 | /* Begin PBXNativeTarget section */ 149 | 8B153F441B66498C00DF40C2 /* YCameraViewDemo */ = { 150 | isa = PBXNativeTarget; 151 | buildConfigurationList = 8B153F681B66498E00DF40C2 /* Build configuration list for PBXNativeTarget "YCameraViewDemo" */; 152 | buildPhases = ( 153 | 0DF5A173665FD3CC65873A23 /* Check Pods Manifest.lock */, 154 | 8B153F411B66498C00DF40C2 /* Sources */, 155 | 8B153F421B66498C00DF40C2 /* Frameworks */, 156 | 8B153F431B66498C00DF40C2 /* Resources */, 157 | FA176C6552634EDF58F80FBE /* Copy Pods Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | ); 163 | name = YCameraViewDemo; 164 | productName = YCameraViewDemo; 165 | productReference = 8B153F451B66498C00DF40C2 /* YCameraViewDemo.app */; 166 | productType = "com.apple.product-type.application"; 167 | }; 168 | 8B153F5D1B66498D00DF40C2 /* YCameraViewDemoTests */ = { 169 | isa = PBXNativeTarget; 170 | buildConfigurationList = 8B153F6B1B66498E00DF40C2 /* Build configuration list for PBXNativeTarget "YCameraViewDemoTests" */; 171 | buildPhases = ( 172 | 8B153F5A1B66498D00DF40C2 /* Sources */, 173 | 8B153F5B1B66498D00DF40C2 /* Frameworks */, 174 | 8B153F5C1B66498D00DF40C2 /* Resources */, 175 | ); 176 | buildRules = ( 177 | ); 178 | dependencies = ( 179 | 8B153F601B66498D00DF40C2 /* PBXTargetDependency */, 180 | ); 181 | name = YCameraViewDemoTests; 182 | productName = YCameraViewDemoTests; 183 | productReference = 8B153F5E1B66498D00DF40C2 /* YCameraViewDemoTests.xctest */; 184 | productType = "com.apple.product-type.bundle.unit-test"; 185 | }; 186 | /* End PBXNativeTarget section */ 187 | 188 | /* Begin PBXProject section */ 189 | 8B153F3D1B66498C00DF40C2 /* Project object */ = { 190 | isa = PBXProject; 191 | attributes = { 192 | LastUpgradeCheck = 0620; 193 | ORGANIZATIONNAME = yuvrajsinh; 194 | TargetAttributes = { 195 | 8B153F441B66498C00DF40C2 = { 196 | CreatedOnToolsVersion = 6.2; 197 | }; 198 | 8B153F5D1B66498D00DF40C2 = { 199 | CreatedOnToolsVersion = 6.2; 200 | TestTargetID = 8B153F441B66498C00DF40C2; 201 | }; 202 | }; 203 | }; 204 | buildConfigurationList = 8B153F401B66498C00DF40C2 /* Build configuration list for PBXProject "YCameraViewDemo" */; 205 | compatibilityVersion = "Xcode 3.2"; 206 | developmentRegion = English; 207 | hasScannedForEncodings = 0; 208 | knownRegions = ( 209 | en, 210 | Base, 211 | ); 212 | mainGroup = 8B153F3C1B66498C00DF40C2; 213 | productRefGroup = 8B153F461B66498C00DF40C2 /* Products */; 214 | projectDirPath = ""; 215 | projectRoot = ""; 216 | targets = ( 217 | 8B153F441B66498C00DF40C2 /* YCameraViewDemo */, 218 | 8B153F5D1B66498D00DF40C2 /* YCameraViewDemoTests */, 219 | ); 220 | }; 221 | /* End PBXProject section */ 222 | 223 | /* Begin PBXResourcesBuildPhase section */ 224 | 8B153F431B66498C00DF40C2 /* Resources */ = { 225 | isa = PBXResourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | 8B153F541B66498D00DF40C2 /* Main.storyboard in Resources */, 229 | 8B153F591B66498D00DF40C2 /* LaunchScreen.xib in Resources */, 230 | 8B153F561B66498D00DF40C2 /* Images.xcassets in Resources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | 8B153F5C1B66498D00DF40C2 /* Resources */ = { 235 | isa = PBXResourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | /* End PBXResourcesBuildPhase section */ 242 | 243 | /* Begin PBXShellScriptBuildPhase section */ 244 | 0DF5A173665FD3CC65873A23 /* Check Pods Manifest.lock */ = { 245 | isa = PBXShellScriptBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | ); 249 | inputPaths = ( 250 | ); 251 | name = "Check Pods Manifest.lock"; 252 | outputPaths = ( 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | shellPath = /bin/sh; 256 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 257 | showEnvVarsInLog = 0; 258 | }; 259 | FA176C6552634EDF58F80FBE /* Copy Pods Resources */ = { 260 | isa = PBXShellScriptBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | ); 264 | inputPaths = ( 265 | ); 266 | name = "Copy Pods Resources"; 267 | outputPaths = ( 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | shellPath = /bin/sh; 271 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; 272 | showEnvVarsInLog = 0; 273 | }; 274 | /* End PBXShellScriptBuildPhase section */ 275 | 276 | /* Begin PBXSourcesBuildPhase section */ 277 | 8B153F411B66498C00DF40C2 /* Sources */ = { 278 | isa = PBXSourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | 8B153F511B66498D00DF40C2 /* ViewController.m in Sources */, 282 | 8B153F4E1B66498C00DF40C2 /* AppDelegate.m in Sources */, 283 | 8B153F4B1B66498C00DF40C2 /* main.m in Sources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | 8B153F5A1B66498D00DF40C2 /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | 8B153F651B66498E00DF40C2 /* YCameraViewDemoTests.m in Sources */, 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | }; 295 | /* End PBXSourcesBuildPhase section */ 296 | 297 | /* Begin PBXTargetDependency section */ 298 | 8B153F601B66498D00DF40C2 /* PBXTargetDependency */ = { 299 | isa = PBXTargetDependency; 300 | target = 8B153F441B66498C00DF40C2 /* YCameraViewDemo */; 301 | targetProxy = 8B153F5F1B66498D00DF40C2 /* PBXContainerItemProxy */; 302 | }; 303 | /* End PBXTargetDependency section */ 304 | 305 | /* Begin PBXVariantGroup section */ 306 | 8B153F521B66498D00DF40C2 /* Main.storyboard */ = { 307 | isa = PBXVariantGroup; 308 | children = ( 309 | 8B153F531B66498D00DF40C2 /* Base */, 310 | ); 311 | name = Main.storyboard; 312 | sourceTree = ""; 313 | }; 314 | 8B153F571B66498D00DF40C2 /* LaunchScreen.xib */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | 8B153F581B66498D00DF40C2 /* Base */, 318 | ); 319 | name = LaunchScreen.xib; 320 | sourceTree = ""; 321 | }; 322 | /* End PBXVariantGroup section */ 323 | 324 | /* Begin XCBuildConfiguration section */ 325 | 8B153F661B66498E00DF40C2 /* Debug */ = { 326 | isa = XCBuildConfiguration; 327 | buildSettings = { 328 | ALWAYS_SEARCH_USER_PATHS = NO; 329 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 330 | CLANG_CXX_LIBRARY = "libc++"; 331 | CLANG_ENABLE_MODULES = YES; 332 | CLANG_ENABLE_OBJC_ARC = YES; 333 | CLANG_WARN_BOOL_CONVERSION = YES; 334 | CLANG_WARN_CONSTANT_CONVERSION = YES; 335 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 336 | CLANG_WARN_EMPTY_BODY = YES; 337 | CLANG_WARN_ENUM_CONVERSION = YES; 338 | CLANG_WARN_INT_CONVERSION = YES; 339 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 340 | CLANG_WARN_UNREACHABLE_CODE = YES; 341 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 342 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 343 | COPY_PHASE_STRIP = NO; 344 | ENABLE_STRICT_OBJC_MSGSEND = YES; 345 | GCC_C_LANGUAGE_STANDARD = gnu99; 346 | GCC_DYNAMIC_NO_PIC = NO; 347 | GCC_OPTIMIZATION_LEVEL = 0; 348 | GCC_PREPROCESSOR_DEFINITIONS = ( 349 | "DEBUG=1", 350 | "$(inherited)", 351 | ); 352 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 353 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 354 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 355 | GCC_WARN_UNDECLARED_SELECTOR = YES; 356 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 357 | GCC_WARN_UNUSED_FUNCTION = YES; 358 | GCC_WARN_UNUSED_VARIABLE = YES; 359 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 360 | MTL_ENABLE_DEBUG_INFO = YES; 361 | ONLY_ACTIVE_ARCH = YES; 362 | SDKROOT = iphoneos; 363 | }; 364 | name = Debug; 365 | }; 366 | 8B153F671B66498E00DF40C2 /* Release */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | ALWAYS_SEARCH_USER_PATHS = NO; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BOOL_CONVERSION = YES; 375 | CLANG_WARN_CONSTANT_CONVERSION = YES; 376 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 377 | CLANG_WARN_EMPTY_BODY = YES; 378 | CLANG_WARN_ENUM_CONVERSION = YES; 379 | CLANG_WARN_INT_CONVERSION = YES; 380 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 381 | CLANG_WARN_UNREACHABLE_CODE = YES; 382 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 383 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 384 | COPY_PHASE_STRIP = NO; 385 | ENABLE_NS_ASSERTIONS = NO; 386 | ENABLE_STRICT_OBJC_MSGSEND = YES; 387 | GCC_C_LANGUAGE_STANDARD = gnu99; 388 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 389 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 390 | GCC_WARN_UNDECLARED_SELECTOR = YES; 391 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 392 | GCC_WARN_UNUSED_FUNCTION = YES; 393 | GCC_WARN_UNUSED_VARIABLE = YES; 394 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 395 | MTL_ENABLE_DEBUG_INFO = NO; 396 | SDKROOT = iphoneos; 397 | VALIDATE_PRODUCT = YES; 398 | }; 399 | name = Release; 400 | }; 401 | 8B153F691B66498E00DF40C2 /* Debug */ = { 402 | isa = XCBuildConfiguration; 403 | baseConfigurationReference = 703A1D4DCE568BDC972C3C44 /* Pods.debug.xcconfig */; 404 | buildSettings = { 405 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 406 | INFOPLIST_FILE = YCameraViewDemo/Info.plist; 407 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 408 | PRODUCT_NAME = "$(TARGET_NAME)"; 409 | TARGETED_DEVICE_FAMILY = "1,2"; 410 | }; 411 | name = Debug; 412 | }; 413 | 8B153F6A1B66498E00DF40C2 /* Release */ = { 414 | isa = XCBuildConfiguration; 415 | baseConfigurationReference = E1359BD6450748C682697A6D /* Pods.release.xcconfig */; 416 | buildSettings = { 417 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 418 | INFOPLIST_FILE = YCameraViewDemo/Info.plist; 419 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | TARGETED_DEVICE_FAMILY = "1,2"; 422 | }; 423 | name = Release; 424 | }; 425 | 8B153F6C1B66498E00DF40C2 /* Debug */ = { 426 | isa = XCBuildConfiguration; 427 | buildSettings = { 428 | BUNDLE_LOADER = "$(TEST_HOST)"; 429 | FRAMEWORK_SEARCH_PATHS = ( 430 | "$(SDKROOT)/Developer/Library/Frameworks", 431 | "$(inherited)", 432 | ); 433 | GCC_PREPROCESSOR_DEFINITIONS = ( 434 | "DEBUG=1", 435 | "$(inherited)", 436 | ); 437 | INFOPLIST_FILE = YCameraViewDemoTests/Info.plist; 438 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YCameraViewDemo.app/YCameraViewDemo"; 441 | }; 442 | name = Debug; 443 | }; 444 | 8B153F6D1B66498E00DF40C2 /* Release */ = { 445 | isa = XCBuildConfiguration; 446 | buildSettings = { 447 | BUNDLE_LOADER = "$(TEST_HOST)"; 448 | FRAMEWORK_SEARCH_PATHS = ( 449 | "$(SDKROOT)/Developer/Library/Frameworks", 450 | "$(inherited)", 451 | ); 452 | INFOPLIST_FILE = YCameraViewDemoTests/Info.plist; 453 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 454 | PRODUCT_NAME = "$(TARGET_NAME)"; 455 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YCameraViewDemo.app/YCameraViewDemo"; 456 | }; 457 | name = Release; 458 | }; 459 | /* End XCBuildConfiguration section */ 460 | 461 | /* Begin XCConfigurationList section */ 462 | 8B153F401B66498C00DF40C2 /* Build configuration list for PBXProject "YCameraViewDemo" */ = { 463 | isa = XCConfigurationList; 464 | buildConfigurations = ( 465 | 8B153F661B66498E00DF40C2 /* Debug */, 466 | 8B153F671B66498E00DF40C2 /* Release */, 467 | ); 468 | defaultConfigurationIsVisible = 0; 469 | defaultConfigurationName = Release; 470 | }; 471 | 8B153F681B66498E00DF40C2 /* Build configuration list for PBXNativeTarget "YCameraViewDemo" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | 8B153F691B66498E00DF40C2 /* Debug */, 475 | 8B153F6A1B66498E00DF40C2 /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | defaultConfigurationName = Release; 479 | }; 480 | 8B153F6B1B66498E00DF40C2 /* Build configuration list for PBXNativeTarget "YCameraViewDemoTests" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | 8B153F6C1B66498E00DF40C2 /* Debug */, 484 | 8B153F6D1B66498E00DF40C2 /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | /* End XCConfigurationList section */ 490 | }; 491 | rootObject = 8B153F3D1B66498C00DF40C2 /* Project object */; 492 | } 493 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo.xcodeproj/project.xcworkspace/xcshareddata/YCameraViewDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 85780480-3DC2-4B29-B44A-EE67CFCCE970 9 | IDESourceControlProjectName 10 | YCameraViewDemo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 8AC7DCC1500A3C980EA9F06651B3B3E046C3714E 14 | https://github.com/yuvirajsinh/YCameraView.git 15 | 16 | IDESourceControlProjectPath 17 | YCameraViewDemo/YCameraViewDemo.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 8AC7DCC1500A3C980EA9F06651B3B3E046C3714E 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/yuvirajsinh/YCameraView.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 8AC7DCC1500A3C980EA9F06651B3B3E046C3714E 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 8AC7DCC1500A3C980EA9F06651B3B3E046C3714E 36 | IDESourceControlWCCName 37 | YCameraView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo.xcodeproj/project.xcworkspace/xcuserdata/vijaysales.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuvirajsinh/YCameraView/a3e726f165f0fea19969d43e40e3a20333ff211a/YCameraViewDemo/YCameraViewDemo.xcodeproj/project.xcworkspace/xcuserdata/vijaysales.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo.xcodeproj/xcuserdata/vijaysales.xcuserdatad/xcschemes/YCameraViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo.xcodeproj/xcuserdata/vijaysales.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | YCameraViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8B153F441B66498C00DF40C2 16 | 17 | primary 18 | 19 | 20 | 8B153F5D1B66498D00DF40C2 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // YCameraViewDemo 4 | // 5 | // Created by yuvraj on 08/01/14. 6 | // Copyright (c) 2014 yuviraj.jadeja@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // YCameraViewDemo 4 | // 5 | // Created by yuvraj on 08/01/14. 6 | // Copyright (c) 2014 yuviraj.jadeja@gmail.com. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.company.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // YCameraViewDemo 4 | // 5 | // Created by yuvraj on 08/01/14. 6 | // Copyright (c) 2014 yuviraj.jadeja@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ViewController : UIViewController 13 | 14 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // YCameraViewDemo 4 | // 5 | // Created by yuvraj on 08/01/14. 6 | // Copyright (c) 2014 yuviraj.jadeja@gmail.com. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | #pragma mark - Button clicks 28 | 29 | - (IBAction)takePhoto:(id)sender{ 30 | YCameraViewController *camController = [[YCameraViewController alloc] initWithNibName:@"YCameraViewController" bundle:nil]; 31 | camController.delegate=self; 32 | [self presentViewController:camController animated:YES completion:^{ 33 | // completion code 34 | }]; 35 | } 36 | 37 | 38 | #pragma mark - YCameraViewController Delegate 39 | - (void)didFinishPickingImage:(UIImage *)image{ 40 | [self.imageView setImage:image]; 41 | } 42 | 43 | - (void)yCameraControllerdidSkipped{ 44 | [self.imageView setImage:nil]; 45 | } 46 | 47 | - (void)yCameraControllerDidCancel{ 48 | 49 | } 50 | @end 51 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // YCameraViewDemo 4 | // 5 | // Created by yuvraj on 08/01/14. 6 | // Copyright (c) 2014 yuviraj.jadeja@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.rapidops.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /YCameraViewDemo/YCameraViewDemoTests/YCameraViewDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // YCameraViewDemoTests.m 3 | // YCameraViewDemoTests 4 | // 5 | // Created by yuvraj on 08/01/14. 6 | // Copyright (c) 2014 yuviraj.jadeja@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface YCameraViewDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation YCameraViewDemoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------