Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)captureButtonAction:(id)sender {
- UIView *cameraView = [[[[[[[[self.view subviews] objectAtIndex:0]
- subviews] objectAtIndex:0]
- subviews] objectAtIndex:0]
- subviews] objectAtIndex:0];
- CGRect screenRect = [[UIScreen mainScreen] bounds];
- UIGraphicsBeginImageContext(screenRect.size);
- CGContextRef ctx = UIGraphicsGetCurrentContext();
- [cameraView.layer renderInContext:ctx];
- UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- UIImageWriteToSavedPhotosAlbum(viewImage, self, nil, nil);
- NSLog(@"capture button action");
- }
Add Comment
Please, Sign In to add comment