Ready to use “Acknowledgements”/“Licenses” view controller for CocoaPods.
Objective-C Ruby
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Classes
Tests
VTAcknowledgementsViewController-Framework
VTAcknowledgementsViewController.bundle
VTAcknowledgementsViewController.xcodeproj
.gitignore
.travis.yml
CHANGELOG.md
LICENSE.md
README.md
VTAcknowledgementsViewController.podspec.json

README.md

VTAcknowledgementsViewController

Ready to use “Acknowledgements”/“Licenses”/“Credits” view controller for CocoaPods.

Now also available in Swift with AcknowList.

Platform iOS Build Status CocoaPods compatible MIT license

iPhone screenshot 1 iPhone screenshot 2

How to Install

This project is only useful if you use CocoaPods, so let’s assume that you’re indeed using CocoaPods.

  1. Add pod 'VTAcknowledgementsViewController' in your Podfile.
  2. Import the Pods-acknowledgements.plist file from the generated Pods folder to your main app project (so you need to run pod install at least once before using this pod; don’t copy the file itself, just add a reference).
    This file is now generated at Pods/Target Support Files/Pods-{project}/Pods-{project}-acknowledgements.plist (cf. #28, #31).
    You can automate that step from your Podfile, as pointed out by @billyto.

How to Use

The VTAcknowledgementsViewController instance is usually pushed to an existing UINavigationController.

VTAcknowledgementsViewController *viewController = [VTAcknowledgementsViewController acknowledgementsViewController];
viewController.headerText = NSLocalizedString(@"We love open source software.", nil); // optional
[self.navigationController pushViewController:viewController animated:YES];

Customization

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.

viewController = [[VTAcknowledgementsViewController alloc] initWithFileNamed:@"Pods-MyTarget-acknowledgements"];
NSString *path = [[NSBundle mainBundle] pathForResource:@"Pods-MyTarget-acknowledgements" ofType:@"plist"];
viewController = [[VTAcknowledgementsViewController alloc] initWithPath:path];

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 = NSLocalizedString(@"We love open source software.", nil);
viewController.footerText = NSLocalizedString(@"Powered by CocoaPods.org", nil);

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

VTAcknowledgement *customLicense = [[VTAcknowledgement alloc] initWithTitle:NSLocalizedString(@"...", nil) text:NSLocalizedString(@"...", nil) license:nil];

viewController.acknowledgements = @[customLicense];

The controller title is a localized value for “acknowledgements” (12 languages supported!). You might want to use this localized value for the button presenting the controller, for instance.

[button setTitle:[VTAcknowledgementsViewController localizedTitle]
        forState:UIControlStateNormal];

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

Apple TV

VTAcknowledgementsViewController is also compatible with tvOS for Apple TV apps.

Apple TV screenshot 1 Apple TV screenshot 2

Requirements

VTAcknowledgementsViewController supports iOS 8.0 or tvOS 9.0 and above, and requires Xcode 9.0 and above. If you need lower requirements, look for an older version of this repository.

Credits

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

License

VTAcknowledgementsViewController is available under the MIT license. See the LICENSE.md file for more info.