Presenting a modal view controller immediately after dismissing another

Aug 2012 Update: iOS 5 and greater have introduced safer APIs for doing things after modals have animated into / out of place using completion blocks: [self presentViewController:myModalVC animated:YES completion:^{}]; [self dismissViewControllerAnimated:YES completion:^{}]; Pre-Aug 2012 Answer: I encountered a similar problem when dismissing modal one and then presenting modal two in rapid succession. Sometimes modal … Read more

When should I use UIImagePickerControllerSourceTypePhotoLibrary instead of UIImagePickerControllerSourceTypeSavedPhotosAlbum?

UIImagePickerControllerSourceTypePhotoLibrary references the entire photo library, letting the user choose which album. UIImagePickerControllerSourceTypeSavedPhotosAlbum goes straight to the camera roll album without giving the user a choice as to which album to choose from. They’re similar, but different. You can get to the camera roll from PhotoLibrary; you can access only the camera roll from UIImagePickerControllerSourceTypeSavedPhotosAlbum. … Read more

Set dimensions for UIImagePickerController “move and scale” cropbox

Not possible with UIImagePickerController unfortunately. The solution I recommend is to disable editing for the image picker and handle it yourself. For instance, I put the image in a scrollable, zoomable image view. On top of the image view is a fixed position “crop guide view” that draws the crop indicator the user sees. Assuming … Read more

What’s the difference between Camera Roll and Photo Library?

From When should I use UIImagePickerControllerSourceTypePhotoLibrary instead of UIImagePickerControllerSourceTypeSavedPhotosAlbum?: UIImagePickerControllerSourceTypePhotoLibrary references the entire photo library, letting the user choose which album. UIImagePickerControllerSourceTypeSavedPhotosAlbum goes straight to the camera roll album without giving the user a choice as to which album to choose from. They’re similar, but different. You can get to the camera roll from PhotoLibrary, … Read more

iPhone: Camera Preview Overlay

For your implementation file: – (IBAction)TakePicture:(id)sender { // Create image picker controller UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; // Set source to the camera imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; // Delegate is self imagePicker.delegate = self; OverlayView *overlay = [[OverlayView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; // Insert the overlay: imagePicker.cameraOverlayView = overlay; // Allow editing of image … Read more

How to open the ImagePicker in SwiftUI?

You need to wrap UIImagePickerController in a struct implementing UIViewControllerRepresentable. For more about UIViewControllerRepresentable, please check this amazing WWDC 2019 talk: Integrating SwiftUI struct ImagePicker: UIViewControllerRepresentable { @Environment(\.presentationMode) private var presentationMode let sourceType: UIImagePickerController.SourceType let onImagePicked: (UIImage) -> Void final class Coordinator: NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate { @Binding private var presentationMode: PresentationMode private let sourceType: UIImagePickerController.SourceType … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)