CPDAcknowledgements – An Overview
Welcome to the CPDAcknowledgements documentation page. CPDAcknowledgements is a powerful open-source library that helps you manage and display acknowledgements for the third-party libraries or frameworks used in your project.
Installation
To install CPDAcknowledgements, follow these simple steps:
Step 1 – Add the CPDAcknowledgements dependency
Add the following line to your project’s Podfile:
pod 'CPDAcknowledgements'
Step 2 – Install the pod
Run the following command in your project directory:
pod install
Usage
Using CPDAcknowledgements is straightforward. Simply follow these steps:
Step 1 – Import CPDAcknowledgements
In your source file, import the CPDAcknowledgements module:
import CPDAcknowledgements
Step 2 – Display acknowledgements
To display the acknowledgements, create a CPDAcknowledgementsViewController instance and present it:
let acknowledgementsViewController = CPDAcknowledgementsViewController()
self.present(acknowledgementsViewController, animated: true, completion: nil)
Customization
CPDAcknowledgements provides some customization options to fit your app’s design:
Acknowledgement Detail Style
You can customize the style of the acknowledgement detail view by following these steps:
Step 1 – Create a custom style
Create a subclass of CPDAcknowledgementsStyle
and override the desired properties.
import CPDAcknowledgements
class CustomAcknowledgementStyle: CPDAcknowledgementsStyle {
override var detailTextFont: UIFont {
return UIFont(name: "Arial", size: 15)!
}
// Add more customizations if needed
}
Step 2 – Apply the custom style
In your code, before presenting the acknowledgements view controller, set the style
property of the CPDAcknowledgementsViewController
instance to your custom style:
let acknowledgementsViewController = CPDAcknowledgementsViewController()
acknowledgementsViewController.style = CustomAcknowledgementStyle()
self.present(acknowledgementsViewController, animated: true, completion: nil)
Acknowledgements Plist Customization
CPDAcknowledgements also provides options to customize the appearance of the acknowledgements plist file:
Grouping acknowledgements
You can group acknowledgements by specifying the group name in the corresponding plist item’s dictionary. All acknowledgements with the same group name will be grouped together.
<key>Acknowledgements</key>
<array>
<dict>
<key>Title</key>
<string>Group A</string>
<key>Acknowledgements</key>
<array>
<dict>
<key>Name</key>
<string>Acknowledgement 1</string>
<key>License</key>
<string>Apache 2.0</string>
</dict>
<dict>
<key>Name</key>
<string>Acknowledgement 2</string>
<key>License</key>
<string>MIT</string>
</dict>
</array>
</dict>
<dict>
<key>Title</key>
<string>Group B</string>
<key>Acknowledgements</key>
<array>
<dict>
<key>Name</key>
<string>Acknowledgement 3</string>
<key>License</key>
<string>BSD 3-Clause</string>
</dict>
</array>
</dict>
</array>
License
CPDAcknowledgements is released under the MIT License. For more details, see the LICENSE file.