Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit ccd547d

Browse files
committed
Merge pull request #8 from nodes-ios/delegate_memory_leak_fix
Fix strong reference to delegate causing a retain cycle
2 parents ba8c553 + 1e324bb commit ccd547d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

KeyboardHelper/Classes/KeyboardHelper.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import UIKit
1313
Protocol `KeyboardNotificationDelegate` requires two functions.
1414
Function `keyboardWillAppear` and `keyboardWillDisappear` with parameter `info` struct `KeyboardAppearanceInfo`.
1515
*/
16-
public protocol KeyboardNotificationDelegate {
16+
public protocol KeyboardNotificationDelegate: class {
1717

1818
/**
1919
This function will recongnize a change of `KeyboardAppearanceInfo` and will be fired when the keyboard will appaear.
@@ -36,7 +36,7 @@ public class KeyboardHelper {
3636
/**
3737
Delegate that conforms with the `KeyboardNotificationDelegate`.
3838
*/
39-
public let delegate: KeyboardNotificationDelegate?
39+
public weak var delegate: KeyboardNotificationDelegate?
4040

4141
/**
4242
Initialize the `delegate` and add the two observer for `keyboardWillAppear` and `keyboardWillDisappear`.

0 commit comments

Comments
 (0)