手动将 Snapkit 添加到 xcode
Adding Snapkit to xcode manually
如何在不使用 cocoapods 的情况下手动在 xcode 中添加 Snapkit 或者迦太基 ?
从 repo or you can download only source 文件下载项目。
然后将该源文件拖放到您的项目中。
你很高兴。
查看其存储库中提供的示例代码。
import UIKit
class ViewController: UIViewController {
lazy var box = UIView()
override func viewDidLoad() {
super.viewDidLoad()
self.view.addSubview(box)
box.snp.makeConstraints { (make) -> Void in
make.width.height.equalTo(50)
make.center.equalTo(self.view)
}
}
}
它的 运行 没有错误:
注意:如果您手动添加,则不需要import SnapKit
。
检查完整项目HERE。
如何在不使用 cocoapods 的情况下手动在 xcode 中添加 Snapkit 或者迦太基 ?
从 repo or you can download only source 文件下载项目。
然后将该源文件拖放到您的项目中。
你很高兴。
查看其存储库中提供的示例代码。
import UIKit
class ViewController: UIViewController {
lazy var box = UIView()
override func viewDidLoad() {
super.viewDidLoad()
self.view.addSubview(box)
box.snp.makeConstraints { (make) -> Void in
make.width.height.equalTo(50)
make.center.equalTo(self.view)
}
}
}
它的 运行 没有错误:
注意:如果您手动添加,则不需要import SnapKit
。
检查完整项目HERE。