UIImagePickerController error: Snapshotting a view that has not been rendered results in an empty snapshot in iOS 7
The problem in iOS7 has to do with transitions. It seems that if a previous transition didn't complete and you launch a new one, iOS7 messes the views, where iOS6 seems to manage it correctly.
You should initialize your Camera in your UIViewController
, only after the view has Loaded and with a timeout:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
//show camera...
if (!hasLoadedCamera)
[self performSelector:@selector(showcamera) withObject:nil afterDelay:0.3];
}
and here is the initialization code
- (void)showcamera {
imagePicker = [[UIImagePickerController alloc] init];
[imagePicker setDelegate:self];
[imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
[imagePicker setAllowsEditing:YES];
[self presentModalViewController:imagePicker animated:YES];
}
ios 10 Snapshotting a view that has not been rendered results in an empty snapshot
Self Solution Working for me like charm :-) hope its helpful for all
DispatchQueue.global(qos: .userInitiated).async
{
self.present(self.imagePicker, animated: true, completion: nil)
}
Related Topics
How to Load Local HTML File into Uiwebview
Uicollectionview - Dynamic Cell Height
Uinavigationbar Custom Back Button Without Title
Swiftui App Life Cycle Ios14 Where to Put Appdelegate Code
Uiscrollview Pauses Nstimer Until Scrolling Finishes
Uiwebview: Html5 Audio Pauses in iOS 6 When App Enters Background
#Warning: C-Style For Statement Is Deprecated and Will Be Removed in a Future Version of Swift
How to Handle Different Orientations in Ios
Always Pass Weak Reference of Self into Block in Arc
Remove or Uninstall Library Previously Added: Cocoapods
Uibutton Inside a View That Has a Uitapgesturerecognizer
How to Create a Guid/Uuid Using Ios
Getting a List of Files in a Directory With a Glob
Ios: Issue with Ampersand in the Url String
Add "...Read More" to the End of Uilabel
How to Import Own Classes from Your Own Project into a Playground
Detecting a Point in a Mkpolygon Broke with iOS7 (Cgpathcontainspoint)