Present Video Editor using UIKit
The VideoEditViewController
class is responsible for presenting and rendering a video.
It can be presented modally as in this example in which case it will display a toolbar at the bottom or it can be pushed onto a UINavigationController
in which case it will use the navigation controller’s navigation bar.
It also handles the presentation of PhotoEditToolController
subclasses.
Create the video edit controller#
In this example, we present a video from the bundle passing the URL to the Video
constructor.
We then initialize a VideoEditViewController
instance passing the video as videoAsset
.
Implement delegate method#
We set the delegate of the VideoEditViewController
object to self. That means that the presenting view controller must implement the VideoEditViewControllerDelegate
protocol.
The methods of the VideoEditViewControllerDelegate
protocol are designed to inform the delegate about the result of the editing process (for example cancellation).
When a user confirms the edits to a video the videoEditViewControllerDidFinish
method is called and the URL to the finished video is passed as part of the result type argument.