Skip to content

Commit

Permalink
Bugfix: unowned self crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark ter Luun committed Nov 25, 2019
1 parent dd7cbf9 commit 7e86ad7
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Sources/Managers/M13CheckboxBounceController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ internal class M13CheckboxBounceController: M13CheckboxController {
let morphAnimation = animationGenerator.morphAnimation(fromPath, toPath: toPath)

CATransaction.begin()
CATransaction.setCompletionBlock({ [unowned self] () -> Void in
self.resetLayersForState(self.state)
CATransaction.setCompletionBlock({ [weak self] () -> Void in
self?.resetLayersForState(self?.state)
completion?()
})

Expand Down
4 changes: 2 additions & 2 deletions Sources/Managers/M13CheckboxDotController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ internal class M13CheckboxDotController: M13CheckboxController {
let morphAnimation = animationGenerator.morphAnimation(fromPath, toPath: toPath)

CATransaction.begin()
CATransaction.setCompletionBlock({ [unowned self] () -> Void in
self.resetLayersForState(self.state)
CATransaction.setCompletionBlock({ [weak self] () -> Void in
self?.resetLayersForState(self?.state)
completion?()
})

Expand Down
4 changes: 2 additions & 2 deletions Sources/Managers/M13CheckboxExpandController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ internal class M13CheckboxExpandController: M13CheckboxController {
let morphAnimation = animationGenerator.morphAnimation(fromPath, toPath: toPath)

CATransaction.begin()
CATransaction.setCompletionBlock({ [unowned self] () -> Void in
self.resetLayersForState(self.state)
CATransaction.setCompletionBlock({ [weak self] () -> Void in
self?.resetLayersForState(self?.state)
completion?()
})

Expand Down
4 changes: 2 additions & 2 deletions Sources/Managers/M13CheckboxFadeController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ internal class M13CheckboxFadeController: M13CheckboxController {
let morphAnimation = animationGenerator.morphAnimation(fromPath, toPath: toPath)

CATransaction.begin()
CATransaction.setCompletionBlock({ [unowned self] () -> Void in
self.resetLayersForState(self.state)
CATransaction.setCompletionBlock({ [weak self] () -> Void in
self?.resetLayersForState(self?.state)
completion?()
})

Expand Down
4 changes: 2 additions & 2 deletions Sources/Managers/M13CheckboxFillController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ internal class M13CheckboxFillController: M13CheckboxController {
let morphAnimation = animationGenerator.morphAnimation(fromPath, toPath: toPath)

CATransaction.begin()
CATransaction.setCompletionBlock({ [unowned self] () -> Void in
self.resetLayersForState(self.state)
CATransaction.setCompletionBlock({ [weak self] () -> Void in
self?.resetLayersForState(self?.state)
completion?()
})

Expand Down
4 changes: 2 additions & 2 deletions Sources/Managers/M13CheckboxFlatController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ internal class M13CheckboxFlatController: M13CheckboxController {
let morphAnimation = animationGenerator.morphAnimation(fromPath, toPath: toPath)

CATransaction.begin()
CATransaction.setCompletionBlock({ [unowned self] () -> Void in
self.resetLayersForState(self.state)
CATransaction.setCompletionBlock({ [weak self] () -> Void in
self?.resetLayersForState(self?.state)
completion?()
})

Expand Down
4 changes: 2 additions & 2 deletions Sources/Managers/M13CheckboxSpiralController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ internal class M13CheckboxSpiralController: M13CheckboxController {
let morphAnimation = animationGenerator.morphAnimation(fromPath, toPath: toPath)

CATransaction.begin()
CATransaction.setCompletionBlock({ [unowned self] () -> Void in
self.resetLayersForState(self.state)
CATransaction.setCompletionBlock({ [weak self] () -> Void in
self?.resetLayersForState(self?.state)
completion?()
})

Expand Down
8 changes: 4 additions & 4 deletions Sources/Managers/M13CheckboxStrokeController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ internal class M13CheckboxStrokeController: M13CheckboxController {
let quickOpacityAnimation = animationGenerator.quickOpacityAnimation(true)

CATransaction.begin()
CATransaction.setCompletionBlock({ [unowned self] () -> Void in
self.resetLayersForState(self.state)
CATransaction.setCompletionBlock({ [weak self] () -> Void in
self?.resetLayersForState(self?.state)
completion?()
})

Expand Down Expand Up @@ -141,8 +141,8 @@ internal class M13CheckboxStrokeController: M13CheckboxController {
let morphAnimation = animationGenerator.morphAnimation(fromPath, toPath: toPath)

CATransaction.begin()
CATransaction.setCompletionBlock({ [unowned self] () -> Void in
self.resetLayersForState(self.state)
CATransaction.setCompletionBlock({ [weak self] () -> Void in
self?.resetLayersForState(self?.state)
completion?()
})

Expand Down

0 comments on commit 7e86ad7

Please sign in to comment.