I am using SnapKit and I am trying to pass the closure as a param to my function which calls snp_makeConstaints like below,
func drawView(view: UIView, callback: (() -> Void)!) {
self.addSubview(view)
view.snp_makeConstraints(closure: callback)
}
I am getting the following error,
../example.swift:57:43: Cannot convert value of type '(() -> Void)!' to expected argument type '@noescape (make: ConstraintMaker) -> Void'
Therefore I added (make: ConstaintMaker) -> Void
which resulted in the following error,
Use of undeclared type 'ConstraintMaker'
I do not understand what @noescape
is and why it is saying that ConstraintMaker
is undeclared.