Simple and lightweight view controller for displaying licenses of used dependencies.
LicenseListController uses protocol LicenseEntrySource which defines a source of license entries. A LicenseEntry is a simple struct with dependency name and license text. You initialize LicenseListViewController with a list of data sources. All license entries are then combined and sorted alphabetically.
There are two built-in data sources:
CustomEntrySource: used to manually specify a listLicenseEntry'sLicensePlistEntrySource: this data source uses output .plist files, generated by LicensePlist pod. Do not forget to create folder references instead of groups into which .plist files are placed.
// Find all generated .plist files in BUNDLE_ROOT/Licenses
let plistSource = LicensePlistEntrySource(bundle: .main, path: "Licenses")
// Define some custom entries
let customSource = CustomEntrySource([
.init(title: "My cool framework", text: "License text..."),
.init(title: "SomeOtherDependency", text: "License text...")
])
// Create License List controller
let listController = LicenseListViewController(title: "Licenses", sources: [
plistSource, customSource
])
// Wrap in Navigation Controller and present
let navigationController = UINavigationController(rootViewController: listController)
present(navigationController, animated: true, completion: nil)You may subclass LicenseListViewController and LicenseDetailsViewController to modify styles.