uiimagepickercontroller
Setting delegate for UIImagePicker returns error
You forgot about UINavigationControllerDelegate in your ViewController class defenition. The image picker’s delegate object. Declaration unowned(unsafe) var delegate: protocol<UIImagePickerControllerDelegate, UINavigationControllerDelegate>?
Camera with Custom View
You might be trying using UIImagePickerController. But I know this one solution to your problem. You can do it easily using AVCamCaptureManager and AVCamRecorder classes. Apple has a demo program build on its developer site here. It is named AVCam. In simple words what it does is when you click to open the camera, it … 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
Saving Picked Image to CoreData
Skip to Processing the Image to find out how to convert UIImage to NSData (which is what Core Data uses) Or download from github Core Data Setup: Set up two entities : Full Resolution and Thumbnail. Full Resolutions is to store the original image. Thumbnail to store a smaller version to be used inside the … 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
UIImagePicker allowsEditing stuck in center
Looks like this behavior is just a bug in iOS 6… Basically you cannot move the editing box, it always bounces back to the middle unless you zoom in a bit. Hopefully they fix that soon.
Swift – UIImagePickerController – how to use it?
You’re grabbing a UIImage named UIImagePickerControllerOriginalImage and there exists no such image. You’re meant to grab the UIImage with the key UIImagePickerControllerOriginalImage from the editingInfo dictionary: let tempImage = editingInfo[UIImagePickerControllerOriginalImage] as! UIImage