一个bash脚本,可自动生成包含所有许可证文件的HTML文件
请参阅 example-output.html 以查看示例输出
将以下行添加到您的 PodFile 中
pod 'ESOpenSourceLicensesKit'
post_install do |installer_representation|
system("sh Pods/ESOpenSourceLicensesKit/ESOpenSourceLicensesKit/Scripts/generate_licenses.sh")
end
运行 pod update
或 pod install
然后打开 ESOpenSourceLicensesViewController
import ESOpenSourceLicensesKit
let vc = ESOpenSourceLicensesViewController()
let navvc = UINavigationController(rootViewController: vc)
self.presentViewController(navvc, animated: true) { _ in
}
将以下行添加到您的 PodFile 中
pod 'ESOpenSourceLicensesKit'
post_install do |installer_representation|
system("sh Pods/ESOpenSourceLicensesKit/ESOpenSourceLicensesKit/Scripts/generate_licenses.sh")
end
运行 pod update
或 pod install
制作 Swift / Objective-c 桥接。
然后打开 ESOpenSourceLicensesViewController
#import <ESOpenSourceLicensesViewController.h>
ESOpenSourceLicensesViewController *vc = [ESOpenSourceLicensesViewController new];
UINavigationController *navVc = [[UINavigationController alloc] initWithRootViewController:vc];
[self presentViewController:navVc animated:YES completion:nil];
请记住,该项目依赖于 CocoaPods。因为它在 Pods 目录中搜索 LICENSE 文件。但如果你不想使用此 pod,你可以手动从终端调用 bash 脚本
cd /Path/to/xcode-workspace/
sh ./generate_licenses.sh licenses.html
然后将 licenses.html 文件拖放到您的项目中,您可以使用它来在 UIWebView
中加载
ESOpenSourceLicensesKit