Swiftpack.co - SwiftExtensions/M3UKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by SwiftExtensions.
SwiftExtensions/M3UKit 1.1.0
The extended M3U playlist parser.
⭐️ 1
🕓 1 year ago
.package(url: "https://github.com/SwiftExtensions/M3UKit.git", from: "1.1.0")

M3UKit

action

M3UKit is an easy way of parsing of extended M3U playlists.

Content

Supported directives

Directive Description Example
#EXTM3U file header, must be the first line of the file #EXTM3U
#EXTINF: track information: runtime in seconds and display title of the following resource / additional properties as key-value pairs #EXTINF:123,Artist Name – Track Title
artist - title.mp3
#EXTGRP: begin named grouping #EXTGRP:Foreign Channels

Go to content

Installation

Swift Package Manager

To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter M3UKit repository URL:

https://github.com/SwiftExtensions/M3UKit.git

You can also navigate to your target’s General pane, and in the Frameworks, Libraries, and Embedded Content section, click the + button, select Add Other, and choose Add Package Dependency.

For more information, see Adding Package Dependencies to Your App.

Go to content

CocoaPods

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. To integrate M3UKit into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'M3UKit', git: 'https://github.com/SwiftExtensions/M3UKit.git'

Go to content

Parsing

import M3UKit

let parser = M3UParser()
let playlist = parser.parse(string: PLAYLIST)

Go to content

Loading from newtwork

import M3UKit

let loader = M3ULoader()
try? loader.load(with: URL_TO_PLAYLIST) { response in
    switch response {
    case let .success(playlist):
        print(playlist)
    case let .failure(error):
        print(error)
    }
}

Go to content

GitHub

link
Stars: 1
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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