⚠️ IMPORTANT: Don’t forget to add the post install hook to your Podfile. Add this script to the end of your Podfile:
post_install do |installer|
pods_dir = File.dirname(installer.pods_project.path)
at_exit { `ruby #{pods_dir}/Carte/Sources/Carte/carte.rb configure` }
end
Usage
Carte provides CarteViewController. You can use it as a normal view controller. Push, present or do whatever you want.
let carteViewController = CarteViewController()
If you want to create your own UI, use Carte.items to get CarteItems.
class Carte {
static var items: [CarteItem]
}
Customizing
Custom Items
CarteViewController has a property named items which is an array of CarteItem. All of the licenses are stored in the items. You can add new items, remove existings, or sort items by manipulating items array.
This is an example of adding a new CarteItem and sorting items.
var item = CarteItem(name: "Carte")
item.licenseText = "The MIT License (MIT) ...Very long text..."
let carteViewController = CarteViewController()
carteViewController.items.append(item)
carteViewController.items.sort { $0.name < $1.name }
Customizing View Controllers
CarteDetailViewController is presented when user selects a table view cell. CarteViewController provides a handler for customizing it.
Definition:
var configureDetailViewController: (CarteDetailViewController -> Void)?
Example:
let carteViewController = CarteViewController()
carteViewController.configureDetailViewController = { detailViewController in
detailViewController.navigationItem.leftBarButtonItem = ...
print(detailViewController.carteItem.name)
}
License
Carte is under MIT license. See the LICENSE file for more info.
La Carte
An open source license notice view generator for Swift.
Screenshot
Features
Installation
Carte only supports CocoaPods at this time.
⚠️ IMPORTANT: Don’t forget to add the post install hook to your Podfile. Add this script to the end of your Podfile:
Usage
Carte provides
CarteViewController
. You can use it as a normal view controller. Push, present or do whatever you want.If you want to create your own UI, use
Carte.items
to getCarteItem
s.Customizing
Custom Items
CarteViewController
has a property nameditems
which is an array ofCarteItem
. All of the licenses are stored in theitems
. You can add new items, remove existings, or sort items by manipulatingitems
array.This is an example of adding a new
CarteItem
and sorting items.Customizing View Controllers
CarteDetailViewController
is presented when user selects a table view cell.CarteViewController
provides a handler for customizing it.Definition:
Example:
License
Carte is under MIT license. See the LICENSE file for more info.