Skip to content
This repository has been archived by the owner on Oct 6, 2019. It is now read-only.

Commit

Permalink
Merge pull request #9 from MerrickSapsford/protocol-fix
Browse files Browse the repository at this point in the history
Fix incorrect strong delegates
  • Loading branch information
msaps authored Jun 21, 2016
2 parents cae6a5d + 6fb4126 commit c01e9fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/CocoaBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ private let CocoaBarAnimatedKey: String = "animated"
public typealias CocoaBarPopulationClosure = (layout: CocoaBarLayout) -> Void
public typealias CocoaBarAnimationCompletionClosure = (animated: Bool, completed: Bool, visible: Bool) -> Void

public protocol CocoaBarDelegate: Any {
public protocol CocoaBarDelegate: class {

/**
The action button on the CocoaBar has been pressed.
Expand Down Expand Up @@ -168,7 +168,7 @@ public class CocoaBar: UIView, CocoaBarLayoutDelegate {
/**
The object that acts as a delegate to the CocoaBar
*/
public var delegate: CocoaBarDelegate?
public weak var delegate: CocoaBarDelegate?

/**
The CocoaBar that is attached to the key window.
Expand Down
4 changes: 2 additions & 2 deletions Sources/CocoaBarLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class CocoaBarLayout: DropShadowView {
The object that acts as a delegate to the layout.
This should always be the CocoaBar
*/
internal var delegate: CocoaBarLayoutDelegate?
internal weak var delegate: CocoaBarLayoutDelegate?

/**
The dismiss button on the layout
Expand Down Expand Up @@ -314,7 +314,7 @@ public class CocoaBarLayout: DropShadowView {
}
}

internal protocol CocoaBarLayoutDelegate: Any {
internal protocol CocoaBarLayoutDelegate: class {

/**
The dismiss button has been pressed on the layout.
Expand Down

0 comments on commit c01e9fc

Please sign in to comment.