Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Snapkit to xcode manually

How to add Snapkit in xcode manually without using cocoapods or carthage ?

like image 949
Koustov Basu Avatar asked Feb 17 '26 10:02

Koustov Basu


1 Answers

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:

enter image description here

Note: You don't need to import SnapKit if you are adding it manually.

Check complete project HERE.

like image 76
Dharmesh Kheni Avatar answered Feb 19 '26 22:02

Dharmesh Kheni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!