iOS and macOS · Swift
An iOS video editor SDK, in your app and your brand
Give your iOS app a complete video editor in Swift: real-time preview, timeline, text, captions, effects, music and MP4 export. Add one Swift package, place two views, and keep your own pickers and storage. The same package runs on macOS.
What your users get
Captions from your speech-to-text
One call turns your transcript into captions. With word timings, karaoke-style animations follow the speech.
Direct manipulation
Users drag, pinch or use handles to move, resize and rotate anything in the preview.
The edits people expect
Trim, split, speed, transform, crop, masks, looks and effects, with transitions between clips.
Animated text
Titles with ready-made styles, in, out and loop animations, and keyframes with easing.
Audio
Music and sound on their own tracks, with volume, voice and audio effects.
Undo and saved projects
Undo and redo in the transport row; projects save as JSON you store where you like.
Try every tool in the live demo.
Install with Swift Package Manager
Add the package from https://github.com/Nitrakit/nitrakit-swift. In Xcode: File → Add Package Dependencies, enter the URL, and add the Nitrakit and NitrakitUI products to your app target. Or in Package.swift:
dependencies: [.package(url: "https://github.com/Nitrakit/nitrakit-swift", from: "0.2.0")],
// in your target:
.product(name: "NitrakitUI", package: "nitrakit-swift"),Nitrakit holds projects, export, the license and languages; NitrakitUI holds the views.
Show the Swift video editor
Two views make up the editor: NitrakitPreviewView plays the project and lets the user move and resize layers; NitrakitTimelineView has the timeline, tools and panels. Give both the same editor:
import NitrakitUI
let preview = NitrakitPreviewView(frame: .zero)
preview.editor = editor
let dock = NitrakitTimelineView(frame: .zero)
dock.editor = editorLay them out like any view: typically the preview on top and the editor, about 400 pt tall, below. Each starts drawing once it has a size. Create them in code; they don't load from storyboards. The preview pauses itself when it leaves the window.
Use it from SwiftUI
The views are UIKit views, so in SwiftUI you wrap each one in a UIViewRepresentable:
struct EditorPreview: UIViewRepresentable {
let editor: Editor
func makeUIView(context: Context) -> NitrakitPreviewView {
let view = NitrakitPreviewView(frame: .zero)
view.editor = editor
return view
}
func updateUIView(_ view: NitrakitPreviewView, context: Context) {}
}The timeline view wraps the same way.
macOS too
The same Swift package supports macOS 13 or later with AppKit, so a Mac app can share projects with your iPhone app. One difference: on macOS there are no built-in pickers, so your app answers every request (media, fonts, colours, text).
Your picker, your storage
The editor never opens the photo library itself. When the user taps Add media, it calls your onRequest closure. It's async and runs on the main actor, so you can present a picker and await the result:
dock.onRequest = { request in
switch request.kind {
case .addMedia, .addOverlay, .addAudio, .addSticker:
guard let file = await presentMediaPicker() else { return .cancel } // your picker
let id = startUpload(file) // your storage
let media = try? editor.addMedia(id: id, file: file)
return media.map { .source(id: $0.source) } ?? .cancel
default:
return nil // built-in picker
}
}If users pick from their photo library, add NSPhotoLibraryUsageDescription to your Info.plist. Media is referred to by your ids, and NitrakitMedia.resolve tells the SDK where to download it when a project opens on another device. See Your pickers.
Export an MP4
editor.export(path:settings:listener:) writes an MP4 (H.264 video, AAC audio) to your path in the background; the user can keep editing. An ExportListener gets progress and the result, and job.cancel() stops it. Then save it to the photo library, share it or upload it. See Export.
Make it look like your app
Requirements
| iOS | 16 or later |
|---|---|
| macOS | 13 or later |
| UI | UIKit or AppKit; SwiftUI through a small wrapper |
| Package | Swift package nitrakit-swift |
Library, SDK or AVFoundation?
AVFoundation can trim, compose and export video, and it's free and built in. If your app only needs one fixed edit, use it. An editor is different: a timeline users scrub and drag, a preview that matches the export, text and captions, undo, and pickers. That's where the time goes, and it's what you get from Nitrakit as two views.
FAQ
- Does it work with SwiftUI?
- Yes, through a small
UIViewRepresentablewrapper around each view (above). - Does it run on macOS?
- Yes: macOS 13 or later, with AppKit, from the same Swift package. On macOS your app handles every picker request.
- What's the minimum iOS version?
- iOS 16.
- Can I try it without a license key?
- Yes. Everything works without one; exports are watermarked and up to 15 seconds. A key, tied to your bundle ID, removes the limits when you release. See pricing.
- How much does it add to my app?
- The framework is dynamic and App Store thinning keeps only the device slice. Numbers per platform are in App size.
- Is it the same editor on Android, React Native and the web?
- Yes: one engine everywhere, so projects and exports match. See the Android video editor SDK, the React Native video editor and the web video editor.