talira

TOCropViewController

iOS view controller for cropping and rotating images

open sourceMITfree

TOCropViewController is an open source UIViewController subclass for iOS that lets users crop sections of a UIImage and rotate it, modelled on the editor in Apple's Photos app. Users drag the edges of a grid to crop, can crop a circular copy, rotate in 90-degree steps, lock the crop box to an aspect ratio and reset all changes. The cropped image goes back to a delegate or straight to a share sheet. CropViewController is its Swift wrapper with a more native Swift interface, and both are localized in 28 languages.

Problems it solves

  • let users crop a profile picture in my iOS app
  • add a photo crop and rotate screen like the Photos app
  • crop a UIImage to a square or circle in Swift

Features

  • crop by dragging the edges of a grid overlay
  • circular crops
  • rotate in 90-degree steps
  • lock the crop box to an aspect ratio
  • return the result to a delegate or a share sheet
  • CropViewController Swift wrapper
  • localized in 28 languages

Limitations

  • Needs iOS 12 or later; visionOS and Mac Catalyst builds are enabled but not officially supported.1

Alternatives

The same job

These do what TOCropViewController does.

  1. image_cropper Flutter plugin for cropping and rotating images on Android, iOS and the web

Compare TOCropViewController with the top 3