Skip to content

Latest commit

 

History

History
121 lines (90 loc) · 3.4 KB

README.md

File metadata and controls

121 lines (90 loc) · 3.4 KB
LicenseList by Cybozu

Generate a list of licenses for the Swift Package libraries that your app depends on.

Github issues Github forks Github stars Top language Release Github license

Example

Requirements

  • Development with Xcode 15.4+
  • Written in Swift 5.10
  • Compatible with iOS 15.0+, tvOS 17.0+

Documentation

Latest (Swift-DocC)

Privacy Manifest

This library does not collect or track user information, so it does not include a PrivacyInfo.xcprivacy file.

Installation

LicenseList is available through Swift Package Manager.

Xcode

  1. File > Add Package Dependencies…
  2. Search https://github.com/cybozu/LicenseList.git.
  3. Add package and link LicenseList to your application target.

CLI

  1. 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")
                ]
            )
        ]
    )
  2. Run the following command in Terminal.

    $ swift package resolve

Usage

Example for UIKit

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)

Example for SwiftUI

import LicenseList

struct ContentView: View {
    var body: some View {
        NavigationView {
            LicenseListView()
                // If you want to anchor link of the repository
                .licenseViewStyle(.withRepositoryAnchorLink)
                .navigationTitle("LICENSE")
        }
    }
}

Demo

This repository includes demonstration app for UIKit & SwiftUI.

Open Examples/Examples.xcodeproj and Run it.