How to add Snapkit in xcode manually without using cocoapods or carthage ?
Asked
Active
Viewed 1,209 times
3
-
What are your reasoning for deciding against using cocoapods or Carthage for dependency management? Just curious, as cocoa pods and Carthage makes it easier to update, maintain your dependencies, and you can even set a dependency to a fixed version, as I think might be the reasoning for you? :) – T. Hyldgaard Feb 12 '18 at 12:38
1 Answers
4
Download project from repo or you can download only source file.
Then drag and drop that source file into your project.
And you are good to go.
Check example code which is given into their 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)
}
}
}
And its running without and errors:
Note: You don't need to import SnapKit
if you are adding it manually.
Check complete project HERE.

Dharmesh Kheni
- 71,228
- 33
- 160
- 165