<commit_before># AcknowList

Acknowledgements screen displaying a list of licenses, for example from [CocoaPods](https://cocoapods.org) or [Swift Package Manager](https://swift.org/package-manager/) dependencies.

![Platform iOS tvOS watchOS macOS](https://img.shields.io/cocoapods/p/AcknowList.svg)
![Swift 5](https://img.shields.io/badge/Swift-5-blue.svg)
![Swift Package Manager](https://img.shields.io/badge/support-Swift_Package_Manager-orange.svg)
[![CocoaPods compatible](https://img.shields.io/cocoapods/v/AcknowList.svg)](https://cocoapods.org/pods/AcknowList)
[![MIT license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vtourraine/AcknowList/raw/master/LICENSE)

_Also available in Objective-C with [VTAcknowledgementsViewController](https://github.com/vtourraine/VTAcknowledgementsViewController)._

![AcknowList screenshots](Sources/AcknowList/AcknowList.docc/Resources/acknowlist@2x.png)

## Features

- Load acknowledgments from CocoaPods-generated files (`Pods-###-acknowledgements.plist`)
- Load acknowledgments from Swift Package Manager files (`Package.resolved`)
- 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
- UIKit and SwiftUI interfaces

## Installation

### CocoaPods

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

### Swift Package Manager

AcknowList can be installed with the [Swift Package Manager](https://swift.org/package-manager/) (requires Xcode 12 for localized resources).

1. Click on `File` → `Add Packages…`.
2. Enter `https://github.com/vtourraine/AcknowList`.
3. Select the version you’d like to use.
4. Add the `Package.resolved` file generated by Xcode to your main target: drag and drop the file from the `[appName].xcodeproj/project.xcworkspace/xcshareddata/swiftpm/` folder to 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`.

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

By default, the controller will try to load acknowledgements from a CocoaPods plist file (by guessing its location from the bundle name), as well as from a `Package.resolved` file (if it exists in the main bundle).
 
 You can also initialize the view controller with a custom file name or URL.

``` swift
let viewController = AcknowListViewController(fileNamed: "Pods-AcknowExample-acknowledgements")
```

``` swift<commit_msg>Update documentation<commit_after># AcknowList

Acknowledgements screen displaying a list of licenses, for example from [CocoaPods](https://cocoapods.org) or [Swift Package Manager](https://swift.org/package-manager/) dependencies.

![Platform iOS tvOS watchOS macOS](https://img.shields.io/cocoapods/p/AcknowList.svg)
![Swift 5](https://img.shields.io/badge/Swift-5-blue.svg)
![Swift Package Manager](https://img.shields.io/badge/support-Swift_Package_Manager-orange.svg)
[![CocoaPods compatible](https://img.shields.io/cocoapods/v/AcknowList.svg)](https://cocoapods.org/pods/AcknowList)
[![MIT license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vtourraine/AcknowList/raw/master/LICENSE)

_Also available in Objective-C with [VTAcknowledgementsViewController](https://github.com/vtourraine/VTAcknowledgementsViewController)._

![AcknowList screenshots](Sources/AcknowList/AcknowList.docc/Resources/acknowlist@2x.png)

## Features

- Load acknowledgments from CocoaPods-generated files (`Pods-###-acknowledgements.plist`)
- Load acknowledgments from Swift Package Manager files (`Package.resolved`)
- 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
- UIKit and SwiftUI interfaces

## Installation

### CocoaPods

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

### Swift Package Manager

AcknowList can be installed with the [Swift Package Manager](https://swift.org/package-manager/) (requires Xcode 12 for localized resources).

1. Click on `File` → `Add Packages…`.
2. Enter `https://github.com/vtourraine/AcknowList`.
3. Select the version you’d like to use.
4. Add the `Package.resolved` file generated by Xcode to your main target: drag and drop the file from the `[appName].xcodeproj/project.xcworkspace/xcshareddata/swiftpm/` folder to 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`.

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

By default, the controller will try to load acknowledgements from a CocoaPods plist file (by guessing its location based on the bundle name), as well as from a `Package.resolved` file.
 
 You can also initialize the view controller with a custom file name or URL.

``` swift
let viewController = AcknowListViewController(fileNamed: "Pods-AcknowExample-acknowledgements")
```

``` swift
{'fraction_non_alphanumeric': 0.10801800300050009, 'fraction_numerical': 0.004667444574095682, 'mean_word_length': 5.382978723404255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 22, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1130775', 'n_tokens_mistral': 1881, 'n_tokens_neox': 1704, 'n_words': 572}