0

I have to show all the iCloud picture in my app. So i have to use those photos for further actions. Is there any framework which i have use to implement the iCloud functionality. I have checked the various codes and tuts but not able to get the images form the iCloud.

PAn Kaj Khatri
  • 539
  • 1
  • 6
  • 22

2 Answers2

0

You should use Photos Framework to get access to photos on iCloud. Photos Framework also support photo editing.

For more details you can follow this link - Photos Framework

Amit Pandey
  • 156
  • 2
  • 11
-1

Perhaps what you are looking for is the UIImagePickerControllerDelegate.

Make your class to inherit UIImagePickerControllerDelegate;

Create a function to pick image from library or camera, initialize a pickerController constant, set delegate to self, get pickerController source type, from camera or library, set allowsEditing to true and present view controller.

Check the code below:

class YourClass: UIViewController, UIImagePickerControllerDelegate {

    ...

    @IBAction func picImage(sender: UIButton) {

            let pickerController = UIImagePickerController()
            pickerController.delegate = self
            pickerController.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
            pickerController.allowsEditing = true

            self.presentViewController(pickerController, animated: true, completion: nil)

            // before user finish picking image, another func has to run, imagePickerController.
        }

        // After user pick the image, this method will dismiss active view controller.
        func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage, editingInfo: [String : AnyObject]?) {

            self.dismissViewControllerAnimated(true, completion: nil)
        }
}

This is well understood when watching the link tutorial about CoreData, the video is a bit long but worth your time. My thanks to Jason Rybka, https://www.youtube.com/watch?v=1kCKlv1npw0.

Works for Swift 2.1 / iOS 9.2.

Good luck.

Marco
  • 314
  • 4
  • 9