Skip to content

hero-handwerk/photo-editor

 
 

Repository files navigation

iOS Photo Editor

Features

  • Cropping
  • Adding images -Stickers-
  • Adding Text with colors
  • Drawing with colors
  • Scaling and rotating objects
  • Deleting objects
  • Saving to photos and Sharing
  • Cool animations
  • Uses iOS Taptic Engine feedback

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate iOS Photo Editor into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '10.0'

target '<Your Target Name>' do
    pod 'iOSPhotoEditor', '~> 1.0'
end

Then, run the following command:

$ pod install

Usage

Photo

The PhotoEditorViewController.

guard let photoEditor = UIStoryboard(name: "PhotoEditor", bundle: Bundle.iOSPhotoEditorResourceBundle)
        .instantiateViewController(withIdentifier: String(describing: PhotoEditorViewController.self)) as? PhotoEditorViewController
        else { return }


//PhotoEditorDelegate
photoEditor.photoEditorDelegate = self

//The image to be edited 
photoEditor.image = image

//Stickers that the user will choose from to add on the image         
photoEditor.stickers.append(UIImage(named: "sticker" )!)

//Optional: To hide controls - array of enum control
photoEditor.hiddenControls = [.crop, .draw, .share]

//Optional: Colors for drawing and Text, If not set default values will be used
photoEditor.colors = [.red,.blue,.green]

// Wrap in an UINavigationController
let navigationController = UINavigationController(rootViewController: photoEditor)
navigationController.modalPresentationStyle = UIModalPresentationStyle.currentContext //or .overFullScreen for transparency

// Present
present(navigationController, animated: true, completion: nil)

The PhotoEditorDelegate methods.

func doneEditing(image: UIImage) {
    // the edited image
}
    
func canceledEditing() {
    print("Canceled")
}

Live Demo appetize.io

Demo

Demo Video

Demo

Credits

Written by Mohamed Hamed.
With contributions by Mickey Knox.
Includes PhotoCropEditor by Guilherme Moura.

Initially sponsored by Eventtus

License

Released under the MIT License.

About

Photo editor with a lot of cool features

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 99.2%
  • Ruby 0.8%