Swiftpack.co - HHK1/PryntTrimmerView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
A set of tools to trim, crop and select frames inside a video
.package(url: "https://github.com/HHK1/PryntTrimmerView.git", from: "4.0.2")


codebeat badge Platform License Version Carthage compatible Swift Package Manager

A set of tools written in swift to crop and trim videos.


To run the example project, clone the repo, and run pod install from the Example directory first.




PryntTrimmerView requires iOS9: It uses Layout Anchors to define the constraints.



Add the following to your Package.swift file

dependencies: [
    .package(url: "https://github.com/HHK1/PryntTrimmerView.git", .upToNextMajor(from: "4.0.1"))


PryntTrimmerView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "PryntTrimmerView"

Then, run pod install to download the source and add it to your workspace.


PryntTrimmmerView is available through Carthage. To install it, simply add the following line to your Cartfile:

github "HHK1/PryntTrimmerView"

Run carthage update to build the framework and drag the built PryntTrimmerView.framework into your Xcode project.

Swift Version

  • Swift 3 compatibility: use version 1.0.1 or below.
  • Swift 4 compatibility: use version 2.x.x.
  • Swift 4.2 compatibility: use version 3.x.x


:warning: This library does not contain an API to crop or trim your video asset. You can find a possible implementation for this in the example pod, but the library only provides the UI.


Create a TrimmerView instance (in interface builder or through code), and add it to your view hierarchy.

trimmerView.asset = asset
trimmerView.delegate = self

Access the startTime and endTime property to know where to trim your asset. You can use the TrimmerViewDelegate to link the trimmer with an AVPlayer and provide the end user with a preview. See the VideoTrimmerViewController inside the project to see an example.

You can also customize the trimmer view by changing its colors:

trimmerView.handleColor = UIColor.white
trimmerView.mainColor = UIColor.orange
trimmerView.positionBarColor = UIColor.white


Create an instance of the VideoCropView and add it to your view hierarchy, then load your video into the crop view: videoCropView.asset = asset.

You can set the aspect ratio you want using the setAspectRatio method. Once you are satisfied with the portion of the asset you want to crop, call getImageCropFrame to retrieve the select frame. See the VideoCropperViewController in the example app for an actual example of how to crop the video for export.


PryntTrimmerView is available under the MIT license. See the LICENSE file for more info.


Stars: 624
Last commit: 1 week ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

Xcode 12 support
1 year ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics