xName
用法
var views: [String: UIView] = [:]
override func viewDidLoad() {
...
views = self.view.viewsWithId() // load subviews with accessibility id
let myButton = views["myButton"] as? UIButton // fun!
myButton?.tintColor = .green
}
创建一个 UIButton 并将其可访问性标识符(在“标识符”检查器下)设置为 "myButton"
示例
要运行示例项目,请首先克隆仓库,然后在 Example 目录中运行 pod install
。
需求
无
安装
xName 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:
pod 'xName'
作者
Muhsin Fatih Yorulmaz, [email protected]
许可证
xName按照MIT许可证提供。更多信息请查看LICENSE文件。