Package for creating, modifying, and managing subtitle files, such as SubRip (.srt).

Overview

SubtitleKit

Package for creating, modifying, and managing subtitle files, such as SubRip (.srt).

Supported formats

Format File extension Is supported
SubRip .srt Yes
WebVTT .vtt Partially
SubViewer .sub No
YouTube Captions .sbv No
TTML .ttml No
DXFP .dxfp No
You might also like...
Toasts and popups library written with SwiftUI
Toasts and popups library written with SwiftUI

Popup View Toasts and popups library written with SwiftUI We are a development agency building phenomenal apps. Usage Put all your body code into a ZS

Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.

SPAlert Popup from Apple Music & Feedback in AppStore. Contains Done, Heart, Error and other presets. Supports Dark Mode. I tried to recreate Apple's

SwiftMessages is a very flexible view and view controller presentation library for iOS.
SwiftMessages is a very flexible view and view controller presentation library for iOS.

SwiftMessages Overview SwiftMessages is a very flexible view and view controller presentation library for iOS. Message views and view controllers can

SwiftOverlays is a Swift GUI library for displaying various popups and notifications
SwiftOverlays is a Swift GUI library for displaying various popups and notifications

SwiftOverlays is a Swift GUI library for displaying various popups and notifications. SwiftOverlays animated logo is kindly made by Crafted Pixels Fea

Lightweight dropdown message bar in Swift. It's simple and beautiful.
Lightweight dropdown message bar in Swift. It's simple and beautiful.

SwiftyDrop SwiftyDrop is a lightweight pure Swift simple and beautiful dropdown message. Features Easy to use like: Drop.down("Message") Message field

Fully customizable and extensible action sheet controller written in Swift
Fully customizable and extensible action sheet controller written in Swift

XLActionController By XMARTLABS. XLActionController is an extensible library to quickly create any custom action sheet controller. Examples The action

A Swift Toast view - iOS 14 style and newer - built with UIKit. 🍞
A Swift Toast view - iOS 14 style and newer - built with UIKit. 🍞

Toast-Swift A Swift Toast view - iOS 14 style - built with UIKit. 🍞 Installation Swift Package Manager You can use The Swift Package Manager to insta

Bursts 🔥 A Funny Framework is showing alerts, Have been Adapting Swift and SwiftUI

Bursts 🔥 A Funny Framework is showing alerts, Have been Adapting Swift and SwiftUI Features iOS 10+ Can be used in UIKit and SwiftUI applications Lig

iOS tweak to display toasts for Low Power alerts and charging

Electrode iOS tweak to display toasts for Low Power alerts and charging. Localization Want to help translate Electrode to your language? Sumbit a pull

Comments
  • add version tags

    add version tags

    It will be great if this Swift Package use semantic versioning.

    You can add some tags with git using semantic versioning to let users add this package as a dependency in their projects.

    opened by Yang-Xijie 1
  • fatal error when srt has several newlines at the end

    fatal error when srt has several newlines at the end

    This is OK:

    let str = """
    1
    00:00:00,720 --> 00:00:01,620
    some text
    """
    
    let result = try SubRip.parseFile(content: str)
    print(result)
    
    [Backend.SubRipNode(index: 1, interval: 1999-12-31 16:00:00 +0000 to 1999-12-31 16:00:01 +0000, text: "some text")]
    

    This is also OK with only one newline:

    let str = """
    1
    00:00:00,720 --> 00:00:01,620
    some text
    
    """
    
    let result = try SubRip.parseFile(content: str)
    print(result)
    
    [Backend.SubRipNode(index: 1, interval: 1999-12-31 16:00:00 +0000 to 1999-12-31 16:00:01 +0000, text: "some text\n")]
    

    However, more than two newlines will cause a fatal error:

    let str = """
    1
    00:00:00,720 --> 00:00:01,620
    some text
    
    
    """
    
    let result = try SubRip.parseFile(content: str)
    print(result)
    

    output

    Swift/ErrorType.swift:200: Fatal error: Error raised at top level: Backend.SubRipParserError.notFullNodeDeclaration(column: 0, row: 1)
    2022-06-20 03:06:58.901269+0800 SrtProcessing[74669:1300033] Swift/ErrorType.swift:200: Fatal error: Error raised at top level: Backend.SubRipParserError.notFullNodeDeclaration(column: 0, row: 1)
    

    Xcode debug 0_swift_runtime_on_report: Thread 1: Fatal error: Error raised at top level: Backend.SubRipParserError.notFullNodeDeclaration(column: 0, row: 1)

    libswiftCore.dylib`_swift_runtime_on_report:
    ->  0x7ff80fecda10 <+0>: pushq  %rbp
        0x7ff80fecda11 <+1>: movq   %rsp, %rbp
        0x7ff80fecda14 <+4>: popq   %rbp
        0x7ff80fecda15 <+5>: retq   
        0x7ff80fecda16 <+6>: nopw   %cs:(%rax,%rax)
    

    macOS 12.4 Xcode 13.4.1

    $ swift --version

    swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12) Target: x86_64-apple-macosx12.0

    SubtitleKit version: a4a97bc1ff79bba54f2d761c87d9468f19ed9d14

    opened by Yang-Xijie 2
Owner
GGorAA
15 y.o. Junior Swift Multiplatform(iOS macOS etc) developer from Ukraine. Loves electric unicycles(EUCs), FPV drones, playing an electric guitar, and much more!
GGorAA
📑 Actionsheet with navigation features such as the Flipboard App

?? SHEET helps you easily create a wide variety of action sheets with navigation features used in the Flipboard App Installation CocoaPods pod 'Sheet'

ArLupin 322 Nov 28, 2022
A Swift package for iOS/tvOS for easy alert presentation

AlertPresenter Listed on the Swift Package Index and originally posted on my blog. It can be fiddly to handle the presentation of alerts on a specific

Chris Mash 14 Jul 1, 2022
Swift Package mimicking UIKit's ActionSheet with added features

ActionSheetController A Swift package that mimics the UIAlertController Actionsheet with added features. ActionSheetController gives you the ability t

Adebiyi Mojisola 5 Sep 4, 2021
CoffeeToast - A swift package to easily add Toast notifications to your app

CoffeeToast A simple Swift package to add Toast Notifications to your app. Insta

Maegan Wilson 2 Feb 3, 2022
🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.

Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexibl

Sebastian Boldt 2.4k Dec 25, 2022
It is a highly configurable iOS library which allows easy styling with built in styles as well as extra header and footer views so that you can make extremely unique alerts and action sheets.

 CFAlertViewController CFAlertViewController is a library that helps you display and customise Alerts, Action Sheets, and Notifications on iPad and i

Crowdfire Inc. 1.1k Dec 18, 2022
zekunyan 608 Dec 30, 2022
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date...

Alerts & Pickers Advanced usage of native UIAlertController with TextField, TextView, DatePicker, PickerView, TableView, CollectionView and MapView. F

RV 5.5k Dec 22, 2022
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift

CDAlertView is highly customizable alert popup written in Swift. Usage is similar to UIAlertController. Screenshots Animations Usage Basic usage witho

Candost Dagdeviren 1.1k Dec 30, 2022
PMAlertController is a great and customizable alert that can substitute UIAlertController

PMAlertController is a small library that allows you to substitute Apple's uncustomizable UIAlertController, with a beautiful and totally customizable

Paolo Musolino 2.5k Jan 3, 2023