Swiftpack.co -  Package - sersoft-gmbh/licensed-components
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
sersoft-gmbh/licensed-components
A simple package containing models and UI for listing open source components
.package(url: "https://github.com/sersoft-gmbh/licensed-components.git", from: "1.0.1")

Licensed Components

GitHub release Tests Codacy Badge codecov jazzy

A simple package containing models and UI for listing open source components.

Installation

Add the following dependency to your Package.swift:

.package(url: "https://github.com/sersoft-gmbh/licensed-components.git", from: "1.0.0"),

Or add it via Xcode (as of Xcode 11).

Usage

Licensed Components contains two targets: LicensedComponents and LicensedComponentsUI. The former contains the model LicensedComponent and the latter contains SwiftUI views for listing them.

To use the UI, simply pass a list of LicensedComponents to the LicensedComponentsList:

import SwiftUI

struct ContentView: View {
    private let components: [LicensedComponent] = [
        LicensedComponent(
            name: "Licensed Components",
            license: .apache(.v2),
            copyrightYears: "2020-2021",
            copyrightHolders: "ser.soft GmbH"
        ),
        LicensedComponent(
            name: "Color Components",
            license: .apache(.v2),
            copyrightYears: "2020-2021",
            copyrightHolders: "ser.soft GmbH"
        ),
        LicensedComponent(
            name: "CocoaLumberjack",
            license: .bsd(.threeClause),
            copyrightYears: "2010-2021",
            copyrightHolders: "Deusty, LLC"
        )
    ]

    var body: some View {
        NavigationView {
            LicensedComponentsList(components: components)
        }
    }
}

Documentation

The API is documented using header doc. If you prefer to view the documentation as a webpage, there is an online version available for you.

Contributing

If you find a bug / like to see a new feature in this package there are a few ways of helping out:

  • If you can fix the bug / implement the feature yourself please do and open a PR.
  • If you know how to code (which you probably do), please add a (failing) test and open a PR. We'll try to get your test green ASAP.
  • If you can do neither, then open an issue. While this might be the easiest way, it will likely take the longest for the bug to be fixed / feature to be implemented.

License

See LICENSE file.

For integrating as LicensedComponent:

LicensedComponent(
    name: "Licensed Components",
    license: .apache(.v2),
    copyrightYears: "2020-2021",
    copyrightHolders: "ser.soft GmbH"
)

GitHub

link
Stars: 0
Last commit: 6 days ago

Release Notes

v1.0.1
15 weeks ago
  • Fix animation glitch when collapsing licenses.

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