📈 GH Trending Explorer 🎲 Surprise me

← all repos

TimOliver / TOCropViewController

git clone https://github.com/TimOliver/TOCropViewController.git 3.2.0 · 2mo ago 🔥 on GitHub Trending today

A view controller for iOS that allows users to crop portions of UIImage objects

—
stars, 24h
—
stars, 7 days
+1
stars, 30 days · #10,073
4.9k
★ total
1.0k
forks · 106 open issues

Star history starts 2026-10-20; the chart appears after the second daily snapshot.

LanguageObjective-C
LicenseMIT
Created2015-06-06 (11y ago)
Last push16d ago
Watchers85
OwnerUser

Seen on GitHub Trending

  • 2026-10-20 — #17 monthly in objective-c · +1 ★

GitHub topics

Links

README excerpt
# TOCropViewController
`TOCropViewController` is an open-source `UIViewController` subclass to crop out sections of `UIImage` objects, as well as perform basic rotations. It is excellent for things like editing profile pictures, or sharing parts of a photo online. It has been designed with the iOS Photos app editor in mind, and as such, behaves in a way that should already feel familiar to users of iOS.
For Swift developers, `CropViewController` is a Swift wrapper that completely encapsulates `TOCropViewController` and provides a much more native, Swiftier interface.
#### Proudly powering apps by
_Looking for something more? If `TOCropViewController` doesn't meet your exact requirements, please consider IMG.LY with video editing and photo filter capabilities instead! (Disclaimer: Affiliate Link)_
## Features
* Crop images by dragging the edges of a grid overlay.
* Optionally, crop circular copies of images.
* Rotate images in 90-degree segments.
* Clamp the crop box to a specific aspect ratio.
* A reset button to completely undo all changes.
* iOS 7/8 translucency to make it easier to view the cropped region.
* The choice of having the controller return the cropped image to a delegate, or immediately pass it to a `UIActivityViewController`.
* A custom animation and layout when the device is rotated to landscape mode.
* Custom 'opening' and 'dismissal' animations.
* Localized in 28 languages.
## System Requirements
iOS 12.0 or above.
_Disclaimer: visionOS and Mac Catalyst modes are also enabled, however they are not officially supported. PRs are always welcome!_ 
## Installation
 CocoaPods 
 Objective-C 
Add the following to your Podfile:
 [code] 
 Swift 
Add the following to your Podfile:
 [code] 
 Swift Package Manager 
Add the following to your `Package.swift`:
 [code] 
 Carthage 
1. Add the following to your Cartfile:
 [code] 
2. Run `carthage update`
3. From the `Carthage/Build` folder, import one of the two frameworks into your Xcode project. For Objective-C projects, import just `TOCropViewController.framework` and for Swift, import `CropViewController.framework` instead. Each framework is separate; you do not need to import both.
4. Follow the remaining steps on Getting Started with Carthage to finish integrating the framework.
 Manual Installation 
All of the necessary source and resource files for `TOCropViewController` are in `Objective-C/TOCropViewController`, and all of the necessary Swift files are in `Swift/CropViewController`.
For Objective-C projects, copy just the `TOCropViewController` directory to your Xcode project. For Swift projects, copy both `TOCropViewController` and `CropViewController` to your project.
## Examples
Using `TOCropViewController` is very straightforward. Simply create a new instance passing the `UIImage` object you wish to crop, and then present it modally on the screen.
While `TOCropViewController` prefers to be presented modally, it can also be pushed to a `UINavigationController` stack.
For a complete wo