Mobile/iOS

[iOS] View Capture

out of coding 2016. 11. 8. 11:34

View를 Capture 하는 방법입니다.


UIGraphicsBeginImageContext(view.frame.size);

[view.layer renderInContext:UIGraphicsGetCurrentContext()];

UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();


view 부분을 자기가 원하는 뷰로 변경하여 줍니다.