Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Sources/ConfettiKit/ConfettiView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ public final class ConfettiView: UIView {

extension ConfettiView: ShootingDelegate {
func shootingDidFinish(_ shooting: Shooting) {
shooting.view?.removeFromSuperview()
shootings.removeAll { $0 === shooting }
guard let view = shooting.view else { return }

UIView.animate(withDuration: 0.5, animations: {
view.alpha = 0.0
}, completion: { _ in
view.removeFromSuperview()
self.shootings.removeAll { $0 === shooting }
})
}
}
1 change: 1 addition & 0 deletions Sources/ConfettiKit/Internal/ConfettiLayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ private extension ConfettiLayerView {
cell.scale = scale
cell.scaleRange = scaleRange
cell.speed = speed
cell.alphaSpeed = -0.4
cell.emissionLongitude = degreesToRadians(180)
cell.emissionRange = degreesToRadians(90)
cell.contents = image.cgImage
Expand Down