Skip to content

Commit

Permalink
fix one crash
Browse files Browse the repository at this point in the history
  • Loading branch information
iWECon committed May 23, 2023
1 parent fdd1587 commit b8bfa34
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Sources/Marker/Marker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,16 @@ public class Marker: UIView {
// MARK: Show next
@objc public func showNext(triggerByUser: Bool) {
// show next or dimiss
animateMaps[current.identifier] = true
if current.dimFrame == .zero {
dimmingView.alpha = 0
}

current.completion?(self, triggerByUser)
current.completion = nil // release
// fix crash when trigger showNext in `Marker.Info(completion:)` (crashes caused by dead loops)
if animateMaps[current.identifier] == false {
animateMaps[current.identifier] = true
if current.dimFrame == .zero {
dimmingView.alpha = 0
}
current.completion?(self, triggerByUser)
current.completion = nil // release
}
guard let next = nexts.first else {
// dimiss
dismiss(triggerByUser: triggerByUser)
Expand Down

0 comments on commit b8bfa34

Please sign in to comment.