uiimagepickercontroller - how to create a camera overlay view that recognized swipe gestures? -
i trying create camera overlay can recognize swipe gestures push other views.
i wondering if can still use uiimagepicker or if have use avcapturesessionmanager.
also prefer create overlay view in story board there way that? can select view inside storyboard controller camera overlay , present uiimagepicker on view did load?
i've never used storyboard create camera overlay, have created xib works fine. can create overlay viewcontroller in normal (xib) way, complete gesture recognizers, can handle them directly in vc or use delegate (most vc presented camera).
some code -
-(void)setupcamera { self.picker = [[uiimagepickercontroller alloc] init]; _picker.sourcetype = uiimagepickercontrollersourcetypecamera; _picker.cameracapturemode = uiimagepickercontrollercameracapturemodephoto; self.overlay = [[overlayviewcontroller alloc] init]; _overlay.delegate = self; _picker.cameraoverlayview = _overlay.view; _picker.delegate = self; [self presentviewcontroller:self.picker animated:yes completion:nil]; }
the overlay -
-(id)init { self = [super initwithnibname:@"overlayviewcontroller" bundle:nil]; if (self) { // set stuff } return self; }
... & code handles swipe -
-(ibaction)swipe:(uiswipegesturerecognizer *)sender { // swipe stuff [self.delegate doswipestuff]; // if want delegate handle }
hope helps.
Comments
Post a Comment