FastActions是一个强大且纯Swift实现的action处理器库。
特性
- 将动作发送到当前ViewController或ChildViewController
- 将动作发送到当前NavigationController的viewController
- 将动作发送到任何Class
最简单的使用场景是将动作发送到使用UIButton
扩展的ViewController
let button = UIButton()
let params = FastActionsParams(tag: "kBntClickAction")
button.fa.dispatchToVC(params: params)
要求
- iOS 9.0+ / macOS 10.12+ / tvOS 10.0+
- Swift 4.0+
安装
CocoaPods
要使用CocoaPods将FastActions集成到您的Xcode项目中,在您的Podfile
中指定目标
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'MyApp' do
# other pod
pod 'FastActions'
end
然后,运行以下命令
$ pod install
Carthage
为了使用 Carthage 将 FastActions 集成到您的 Xcode 项目中,请在您的 Cartfile
中指定它
github "dengyhgit/FastActions" ~> 1.0
然后,运行下面的命令来构建 FastActions 框架
$ carthage update FastActions --platform iOS
# Or `--platform macOS`, `--platform tvOS`
许可证
FastActions 是在 MIT 许可证下发布的。请参阅 LICENSE 以获取详细信息。