SwiftSelfAware
目的
Swift 解决方案,用于在应用程序启动时运行代码。
变更
v1.0.5
- 修复了 Swift < 4.1 的编译警告
v1.0.4
- 修复编译警告
安装
CocoaPods
将以下内容添加到您的 Podfile
pod 'SwiftSelfAware'
如果未找到cocoapod规范文件,则可以设置直接git URL
pod 'SwiftSelfAware', :git => 'https://github.com/ladeiko/SwiftSelfAware.git'
然后运行以下命令安装pods
pod install
用法
import Foundation
import SwiftSelfAware
class SomeClass: SelfAware {
static func awake() {
print("Run before applicationDidFinishLaunching")
}
}