Generate a list of licenses for the Swift Package libraries that your app depends on.
Example
- Development with Xcode 15.4+
- Written in Swift 5.9
- Compatible with iOS 15.0+, tvOS 17.0+
This library does not collect or track user information, so it does not include a PrivacyInfo.xcprivacy file.
LicenseList is available through Swift Package Manager.
Xcode
- File > Add Package Dependencies…
- Search
https://github.com/cybozu/LicenseList.git
.
- Add package and link
LicenseList
to your application target.
CLI
-
Create
Package.swift
that describes dependencies.// swift-tools-version: 5.9 import PackageDescription let package = Package( name: "SomeProduct", products: [ .library(name: "SomeProduct", targets: ["SomeProduct"]) ], dependencies: [ .package(url: "https://github.com/cybozu/LicenseList.git", exact: "1.0.0") ], targets: [ .target( name: "SomeProduct", dependencies: [ .product(name: "LicenseList", package: "LicenseList") ] ) ] )
-
Run the following command in Terminal.
$ swift package resolve
import LicenseList
// in ViewController
let vc = LicenseListViewController()
vc.title = "LICENSE"
// If you want to anchor link of the repository
vc.licenseViewStyle = .withRepositoryAnchorLink
navigationController?.pushViewController(vc, animated: true)
import LicenseList
struct ContentView: View {
var body: some View {
NavigationView {
LicenseListView()
// If you want to anchor link of the repository
.licenseViewStyle(.withRepositoryAnchorLink)
.navigationTitle("LICENSE")
}
}
}
This repository includes demonstration app for UIKit & SwiftUI.
Open Examples/Examples.xcodeproj and Run it.