iOS and macOS API
Modules Nitrakit and NitrakitUI. Times are microseconds (Int64); ids are String.
Calls marked throws throw EditorError.
Functions
setLicense(key:) -> LicenseInfo Stable | Installs your license key. |
licenseInfo() -> LicenseInfo Stable | The installed license. |
setLocale(tag:) -> String Stable | The editor's language; returns the one used. |
availableLocales() -> [String] Stable | Built-in languages. |
localeIsRtl() -> Bool Stable | The current language is right to left. |
setStrings(json:) throws Stable | Your own wording: a JSON object of message id → text. |
registerFont(path:) throws -> [String] Stable | Adds a font file; returns its family names. |
fontFamilies() -> [String] Stable | Fonts text can use. |
iconNames() -> [String] Stable | The built-in icon names. |
fontPreview(family:heightPx:path:) throws Preview | Writes a PNG of a family's name in that font, for picker rows. |
easingNames() -> [String] Preview | Named easings. |
NitrakitMedia.resolve Stable | Your lookup from a media id to .remote(url) or .file(url). |
NitrakitPreviewView Stable
init(frame:) | |
editor: Editor? | The editor to show. Starts once the view has a size. |
player: Player? | Playback: play(), pause(), seek(timeUs:), positionUs(), isPlaying(), setVolume(volume:). |
onPosition: ((Int64) -> Void)? | Playback position, on the main thread. |
onPlaying: ((Bool) -> Void)? | Playback started or stopped. |
NitrakitTimelineView Stable
init(frame:) | |
editor: Editor? | The editor to show. |
timeline: Timeline? | setChrome(visible:), select(clip:). |
theme: EditorTheme? | The editor's look; see Theme. |
hideMenuItems(_:), addMenuItem(_:), removeMenuItem(id:) | See Tools and menus. |
setIcon(_:svg:) | See Icons. |
onCustomItem: ((String) -> Void)? | One of your tools was tapped. |
stickerPacks: [StickerPack] | Your sticker packs; see Stickers. |
fonts: [String] | The font panel's list; see Fonts. |
onRequest: (@MainActor (EditorRequest) async -> RequestResponse?)? | Your pickers: return the answer, .cancel, or nil for the built-in picker. |
onSelected: ((String) -> Void)? | The selected clip; "" for none. |
onFullscreen: (() -> Void)? | The fullscreen button was tapped. |
onError: ((Error) -> Void)? | The view couldn't start. |
EditorRequest: kind, clip (the selected clip, "" if none), property (for colours).
RequestType: .addMedia, .addOverlay, .addAudio, .addSticker, .chooseFilter,
.chooseFont, .chooseColor, .editText, .chooseTextStyle.
RequestResponse: .source(id:), .text(value:), .color(r:g:b:a:), .effect(id:),
.stylePreset(id:), .cancel.
Editor
init(width:height:fpsNum:fpsDen:) Stable | A new empty project. |
init(open:) throws Stable | Reopens a saved project. |
toJson() -> String Stable | The project as JSON. |
addMedia(id:file:name:) throws -> MediaInfo Stable | Adds a local file under your media id: source, kind, durationUs, width, height, hasAudio. |
loadMedia() Stable | After opening: makes the project's media available (device, else NitrakitMedia.resolve). |
setMediaProgress(id:fraction:) Stable | Progress on a media id's clips, e.g. while uploading; nil when done. |
retryMedia(id:) Stable | Resolves a media id (or every missing one) again. |
mediaIds() -> [String] Stable | The media ids the project uses. |
apply(edit:) throws -> String Stable with .addTrack, .insertMedia, .insertText | Returns the new id. |
apply(edit:) with any other Edit Preview | See Editing from code. |
undo(), redo() -> Bool Stable | |
setListener(listener:) Stable | EditorListener.changed(canUndo:canRedo:changes:) after every change. |
exportSettings(), exportSettingsFor(shortSide:) Stable | |
export(path:settings:listener:) -> ExportJob Stable | ExportJob.cancel(); ExportListener.progress / finished. |
selectedClips(), selectClips(clips:) Preview | |
timeline() -> TimelineView Preview | Tracks and clips, for your own UI. |
trimLimits(clip:) throws Preview | |
properties(clip:), property(clip:path:atUs:), setProperty(…), resetProperty(…) Preview | |
setKeyframe(…), removeKeyframe(…), keyframes(…) Preview | |
addEffect(clip:kind:), removeEffect(clip:effect:) Preview | |
effectCatalog(), animationPresets(), textStylePresets(), textAnimationPresets() Preview | |
beginSession(), commitSession(), cancelSession() Preview | One undo step, or revert. |
LicenseInfo Stable
state (.valid, .development, .expired, .wrongApp, .invalid, .missing), org,
id, trial, expires, updatesUntil, maxExportSeconds (0 = no limit), watermark,
problems.