Take a Snapshot of a UIIView iOS

Mr.Javed Multani
1 min readOct 5, 2020

Sometimes we need to capture a UIVIew which contains data and controls so basically we can capture it like this and we can use it by JPG format image.

//Here self.webView is the view whose screenshot I need to take
//The screenshot is saved in jpg format in the application directory to avoid any loss of quality in retina display devices i.e. all current devices running iOS 10 UIGraphicsBeginImageContextWithOptions(self.webView.bounds.size, NO, [UIScreen mainScreen].scale); [self.webView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image =…

--

--

Mr.Javed Multani

Software Engineer | Certified ScrumMaster® (CSM) | UX Researcher | Youtuber | Tech Writer