Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Acknowledgements screen displaying a list of licenses, for example from CocoaPods dependencies.
Also available in Objective-C with VTAcknowledgementsViewController.
- Automatically load acknowledgments from CocoaPods-generated file
- Remove unnecessary line breaks from licenses 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
- Localized in 13 languages
pod 'AcknowList'to your
- Add the
Pods-#target#-acknowledgements.plistfile generated by CocoaPods to your main target: drag and drop the file from the
Pods/Target Support Files/Pods-#target#/folder in your Xcode project (don’t copy the file, leave
Copy items if neededunchecked).
Swift Package Manager
AcknowList can be installed with the Swift Package Manager (requires Xcode 12 for localized resources).
- Click on
Add Package Dependency….
- Select the version you’d like to use.
AcknowListViewController instance is usually pushed to an existing
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(plistPath: path)
If you want to include licenses that are not part of a
.plist file, you can create new
Acknow instances, and use them for the acknowledgements array of the controller.
let acknow = Acknow(title: "...", text: "...") let viewController = AcknowListViewController(acknowledgements: [acknow])
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)
AcknowListViewController uses the “grouped” table view style. You can choose a different style:
let viewController = AcknowListViewController(plistPath: path, style: .plain)
If you need to further customize the appearance or behavior of this library, feel free to subclass its classes.
AcknowList is also compatible with tvOS for Apple TV apps.
AcknowList is written in Swift 5, requires iOS 9.0 or tvOS 9.0 and above, Xcode 11 and above.
AcknowList is available under the MIT license. See the
LICENSE.txt file for more info.