Giter Site home page Giter Site logo

pombredanne / vtacknowledgementsviewcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vtourraine/vtacknowledgementsviewcontroller

0.0 1.0 0.0 2.22 MB

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

License: MIT License

Objective-C 74.06% Ruby 0.32% Shell 25.63%

vtacknowledgementsviewcontroller's Introduction

VTAcknowledgementsViewController

Ready to use “Acknowledgements”/“Licenses”/“Credits” view controller for CocoaPods. Now also available in Swift with AcknowList.

Platform iOS Build Status CocoaPods compatible CocoaPods documentation 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

If your .plist file is named something other than Pods-acknowledgements.plist (e.g. if you’re using fancy build targets), you can initialize the view controller with a custom file name or path.

VTAcknowledgementsViewController *viewController = [[VTAcknowledgementsViewController alloc] initWithAcknowledgementsFileNamed:@"Pods-MyTarget-acknowledgements"];
NSString *path = [[NSBundle mainBundle] pathForResource:@"Pods-MyTarget-acknowledgements" ofType:@"plist"];
VTAcknowledgementsViewController *viewController = [[VTAcknowledgementsViewController alloc] initWithAcknowledgementsPlistPath: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] init];
customLicense.title = NSLocalizedString(@"...", nil);
customLicense.text  = NSLocalizedString(@"...", 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.

Requirements

VTAcknowledgementsViewController requires iOS 5.0 and above, Xcode 7.0 and above, and uses ARC. 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.

vtacknowledgementsviewcontroller's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.