Adobe Creative SDK

Follow

How to launch Image Editor in Swift 3 for iOS?

Below is the Swift 3 code sample for Image Editor


import UIKit
import AdobeCreativeSDKCore
import AdobeCreativeSDKImage

class ViewController: UIViewController, AdobeUXImageEditorViewControllerDelegate {
    override func viewDidLoad() {
      super.viewDidLoad()

      AdobeUXAuthManager.shared().setAuthenticationParametersWithClientID("<CLIENT ID HERE>", withClientSecret: "<CLIENT SECRET HERE>" )

      AdobeUXAuthManager.shared().redirectURL = NSURL(string: "<REDIRECT URL HERE>")! as URL!
      let image = UIImage(named: "MyImage.jpg")
      self.photoEditorStart(image: image!)
    }

    func photoEditorStart(image: UIImage!) {
      DispatchQueue.main.async {
        AdobeImageEditorCustomization.setToolOrder([
            kAdobeImageEditorEnhance,        /* Enhance */
            kAdobeImageEditorEffects,        /* Effects */
            kAdobeImageEditorStickers,       /* Stickers */
            kAdobeImageEditorOrientation,    /* Orientation */
            kAdobeImageEditorCrop,           /* Crop */
            kAdobeImageEditorColorAdjust,    /* Color */
            kAdobeImageEditorLightingAdjust, /* Lighting */
            kAdobeImageEditorSharpness,      /* Sharpness */
            kAdobeImageEditorDraw,           /* Draw */
            kAdobeImageEditorText,           /* Text */
            kAdobeImageEditorRedeye,         /* Redeye */
            kAdobeImageEditorWhiten,         /* Whiten */
            kAdobeImageEditorBlemish,        /* Blemish */
            kAdobeImageEditorBlur,           /* Blur */
            kAdobeImageEditorMeme,           /* Meme */
            kAdobeImageEditorFrames,         /* Frames */
            kAdobeImageEditorFocus,          /* TiltShift */
            kAdobeImageEditorSplash,         /* ColorSplash */
            kAdobeImageEditorOverlay,        /* Overlay */
            kAdobeImageEditorVignette        /* Vignette */
            ])

        let adobeViewCtr = AdobeUXImageEditorViewController(image: image)
        adobeViewCtr.delegate = self
        self.present(adobeViewCtr, animated: true) { () -> Void in
        }
    }
  }

func photoEditor(_ editor: AdobeUXImageEditorViewController, finishedWith image: UIImage?)
  {

  }

func photoEditorCanceled(_ editor: AdobeUXImageEditorViewController)
  {

  }
}

 

Was this article helpful?
0 out of 0 found this helpful

Comments

Powered by Zendesk