Swift presentViewController
Try this: let vc = ViewController() //change this to your class name self.presentViewController(vc, animated: true, completion: nil) With Swift3: self.present(vc, animated: true, completion: nil)
Try this: let vc = ViewController() //change this to your class name self.presentViewController(vc, animated: true, completion: nil) With Swift3: self.present(vc, animated: true, completion: nil)
At this point in your code the view controller’s view has only been created but not added to any view hierarchy. If you want to present from that view controller as soon as possible you should do it in viewDidAppear to be safest.
You may need to put the NSPhotoLibraryUsageDescription in your plist. Like <key>NSPhotoLibraryUsageDescription</key> <string>$(PRODUCT_NAME) uses photos</string> Check all the usage descriptions here.
This line: [self dismissViewControllerAnimated:YES completion:nil]; isn’t sending a message to itself, it’s actually sending a message to its presenting VC, asking it to do the dismissing. When you present a VC, you create a relationship between the presenting VC and the presented one. So you should not destroy the presenting VC while it is presenting … Read more