chefkoch-dev / AcknowList

View controller listing CocoaPods acknowledgements

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AcknowList

Acknowledgements screen displaying a list of licences, for example from CocoaPods dependencies.

Platform iOS Swift 5 Build Status Swift Package Manager CocoaPods compatible MIT license

Also available in Objective-C with VTAcknowledgementsViewController.

iPhone screenshot 1 iPhone screenshot 2

Features

  • Automatically load acknowledgments from CocoaPods-generated file
  • Remove unnecessary line breaks from licences for better text wrapping
  • Optional list header and footer
  • Tappable links in header, footer, and acknowledgment text
  • Storyboard support
  • Dark Mode support
  • Dynamic Type support, with automatic font adjustment
  • Localized in 13 languages
  • Swift Package Manager support

How to Install

CocoaPods is the most common solution to install this library.

  1. Add pod 'AcknowList' to your Podfile.
  2. Run pod install.
  3. Add the Pods-#target#-acknowledgements.plist file generated by CocoaPods in Pods/Target Support Files/Pods-#target#/ to your main target (drag and drop the file in your Xcode project). Don’t copy the file, leave Copy items if needed unchecked.

Initialization

The AcknowListViewController instance is usually pushed to an existing UINavigationController.

let viewController = AcknowListViewController()
navigationController.pushViewController(viewController, animated: true)

By default, the controller will try to guess the name of your .plist file, based on the bundle name (Pods-#bundle-name#-acknowledgements.plist). If that doesn’t match the file you’re looking for, you can initialize the view controller with a custom file name or path.

let viewController = AcknowListViewController(fileNamed: "Pods-AcknowExample-acknowledgements")
let path = Bundle.main.path(forResource: "Pods-AcknowExample-acknowledgements", ofType: "plist")
let viewController = AcknowListViewController(acknowledgementsPlistPath: path)

Customization

If you need to include licenses that are not part of the generated plist file, or if you don’t want to use the generated plist at all, you can easily create new Acknow instances, and set them as the acknowledgements array of the controller.

let customLicense = Acknow(title: "...", text: "...")
viewController.acknowledgements = [customLicense]

The controller can also display a header and a footer. By default, they are loaded from the generated plist file, but you can also directly change the properties values.

viewController.headerText = "We love open source software."
viewController.footerText = "Powered by CocoaPods.org"

The controller title is a localized value for “acknowledgements”. You might want to use this localized value for the button presenting the controller.

button.setTitle(AcknowLocalization.localizedTitle(), for: .normal)

If you need to further customize the appearance or behavior of this pod, feel free to subclass its classes.

Apple TV

AcknowList is also compatible with tvOS for Apple TV apps.

Apple TV screenshot 1 Apple TV screenshot 2

Requirements

AcknowList is written in Swift 5, requires iOS 8.0 or tvOS 9.0 and above, Xcode 11 and above.

Credits

AcknowList was created by Vincent Tourraine, and improved by a growing list of contributors.

License

AcknowList is available under the MIT license. See the LICENSE.txt file for more info.

About

View controller listing CocoaPods acknowledgements

License:MIT License


Languages

Language:Swift 100.0%