Coder Social home page Coder Social logo

charliescheer / mediaeditor-ios Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wordpress-mobile/mediaeditor-ios

0.0 1.0 0.0 889 KB

Easy add image editing features to your iOS app! ๐Ÿ–ผ๏ธ

License: GNU General Public License v2.0

Swift 96.68% Ruby 2.97% Objective-C 0.35%

mediaeditor-ios's Introduction

MediaEditor

CircleCI Version License Platform Carthage compatible

MediaEditor is an extendable library for iOS that allows you to quickly and easily add image editing features to your app. You can edit single or multiple images, from the device's library or any other source. It has been designed to feel natural and part of the OS.

Features

  • PHAsset support
  • Editing of Plain UIImage
  • Editing of remote images
  • Single media support
  • Multiple media support
  • Editing in both portrait and landscape modes
  • Cool filters
  • Crop, zoom and rotate capability (thanks to TOCropViewController)
  • PencilKit support to annotate images
  • Easily extendable
  • Customizable UI

Usage

Using MediaEditor is very simple, just give it the media and present from a ViewController:

let assets: [PHAsset] = [asset1, asset2, asset3]
let mediaEditor = MediaEditor(assets)
mediaEditor.edit(from: self, onFinishEditing: { images, actions in
    // images contains the returned images, edited or not
    // actions contains the actions made during this session
}, onCancel: {
    // User canceled
})

This presents the MediaEditor from the ViewController with a callback that is called when the user is finished editing.

You can easily determine if an image has been edited by checking the isEdited property of the objects returned in the images array.

You can initialize the MediaEditor with a single or an array of: PHAsset, UIImage or any other entity that conforms to AsyncImage.

More Examples

Check the Example app for even more ways to use the MediaEditor:

  • Device Library: Edit media from the device library and output them in a UICollectionView
  • Remote Image: Edit media that is remotely hosted by conforming to the AsyncImage protocol and downloading high-quality images only when needed.
  • Plain UIImage: Editing plain UIImage's
  • Extending the MediaEditor capability by adding your own brightness extension

Requirements

  • iOS 11.0+
  • Swift 5

Installation

Cocoapods

Add the following to your Podfile:

pod 'MediaEditor'

Carthage

  1. Add the following to your Cartfile:
github "wordpress-mobile/MediaEditor-iOS"
  1. Run carthage update

  2. From the Carthage/Build folder, import MediaEditor.framework and TOCropViewController.framework into your Xcode project.

  3. Follow the remaining steps on Getting Started with Carthage to finish integrating the framework.

Manual Installation

To install manually copy the Sources/ folder to your project and follow the steps to manual install TOCropViewController too.

Contributing

Read our Contributing Guide to learn about reporting issues, contributing code, and more ways to contribute.

Getting in Touch

If you have questions about getting setup or just want to say hi, join the WordPress Slack and drop a message on the #mobile channel.

Author

WordPress, [email protected]

License

MediaEditor is available under the GPL license. See the LICENSE file for more info.

mediaeditor-ios's People

Contributors

frosty avatar jkmassel avatar leandroalonso avatar loremattei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.