I am using SnapKit.swift and other framework. I wonder why sometime I need to add import SnapKit.swift
and why sometime I don't have to in file that use SnapKit.
Can anyone point me to some resource about how Swift import system works?
Edit: The below code works all fine without importing SnapKit
import UIKit
class ImageEditViewController: UIViewController {
private var imageView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
imageView = UIImageView(image: UIImage.init(named: "img.jpg"))
self.view.addSubview(imageView)
imageView.snp_makeConstraints { (make) -> Void in
make.center.equalTo(self.view)
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}