Skip to content

Commit 8634613

Browse files
authored
Merge pull request #20 from algrid/fix-18
Fix retain cycle/infinite animation in InfoView
2 parents 88c6588 + abbc10e commit 8634613

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Sources/InfoView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ class InfoView: UIVisualEffectView {
141141
UIView.animate(withDuration: 2.0, delay: 0.5, options: [.beginFromCurrentState],
142142
animations: {
143143
self.effect = UIBlurEffect(style: style)
144-
}, completion: { _ in
145-
self.animate(blurStyle: style == .light ? .extraLight : .light)
144+
}, completion: { [weak self] _ in
145+
self?.animate(blurStyle: style == .light ? .extraLight : .light)
146146
})
147147
}
148148

@@ -163,8 +163,8 @@ class InfoView: UIVisualEffectView {
163163
options: [.beginFromCurrentState],
164164
animations: {
165165
self.borderView.transform = CGAffineTransform(rotationAngle: borderViewAngle)
166-
}, completion: { _ in
167-
self.animate(borderViewAngle: borderViewAngle + CGFloat(M_PI_2))
166+
}, completion: { [weak self] _ in
167+
self?.animate(borderViewAngle: borderViewAngle + CGFloat(M_PI_2))
168168
})
169169
}
170170
}

0 commit comments

Comments
 (0)