I get below error.
Cannot convert value of type '(_) -> ()' to expected argument type 'LTEmitterConfigureClosure?' (aka 'Optional<(CAEmitterLayer, CAEmitterCell) -> ()>')
How can i fix it?
self.emitterView.createEmitter(
"fragments",
particleName: "Fragment",
duration: 0.6
) {_ in}.update { (layer, _) in
if progress > end {
layer.birthRate = 0
}
}.play()
Just replace trailing closure {_ in}
with configureClosure: nil
, ie.
self.emitterView.createEmitter(
"fragments",
particleName: "Fragment",
duration: 0.6,
configureClosure: nil).update { (layer, _) in
if progress > end {
layer.birthRate = 0
}
}.play()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.