如何在不使用cocoapods或carthage的情况下手动在xcode中添加Snapkit?
问问题
849 次
1 回答
2
然后将该源文件拖放到您的项目中。
你很高兴。
检查提供给他们的 repo 的示例代码。
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
如果您手动添加它,则不需要。
在此处检查完整的项目。
于 2017-12-29T06:14:59.380 回答