Skip to content

Commit

Permalink
Merge pull request #27 from jbuckner/fix_emitter_start
Browse files Browse the repository at this point in the history
Fix issue where the emitter would not start
  • Loading branch information
onmyway133 authored Apr 23, 2019
2 parents c874004 + 819e38e commit 178d2a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/Common/Cheers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ open class CheerView: UIView {
and: pickImages()
)

let beginTime = CACurrentMediaTime()

let cells: [CAEmitterCell] = combinations.reduce([]) { (accum, combination) in
let cell = CAEmitterCell()
cell.birthRate = 20
cell.beginTime = beginTime
cell.lifetime = 20.0
cell.lifetimeRange = 10
cell.velocity = 250 * yMultiplier
Expand All @@ -74,7 +77,6 @@ open class CheerView: UIView {
}

emitter.emitterCells = cells
emitter.beginTime = CACurrentMediaTime()

config.customize?(cells)

Expand Down

0 comments on commit 178d2a6

Please sign in to comment.