diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderListStreamHeader.swift b/WordPress/Classes/ViewRelated/Reader/ReaderListStreamHeader.swift index 1f2659a9bc76..9529a374a07d 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderListStreamHeader.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderListStreamHeader.swift @@ -7,7 +7,7 @@ import WordPressShared.WPStyleGuide @IBOutlet fileprivate weak var detailLabel: UILabel! // Required by ReaderStreamHeader protocol. - open var delegate: ReaderStreamHeaderDelegate? + open weak var delegate: ReaderStreamHeaderDelegate? // MARK: - Lifecycle Methods diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderRecommendedSiteCardCell.swift b/WordPress/Classes/ViewRelated/Reader/ReaderRecommendedSiteCardCell.swift index 5f59ecec911c..3c30c5a570fe 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderRecommendedSiteCardCell.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderRecommendedSiteCardCell.swift @@ -9,7 +9,7 @@ class ReaderRecommendedSiteCardCell: UITableViewCell { @IBOutlet weak var descriptionLabel: UILabel! @IBOutlet weak var infoTrailingConstraint: NSLayoutConstraint! - var delegate: ReaderRecommendedSitesCardCellDelegate? + weak var delegate: ReaderRecommendedSitesCardCellDelegate? override func awakeFromNib() { super.awakeFromNib() @@ -110,6 +110,6 @@ class ReaderRecommendedSiteCardCell: UITableViewCell { } } -protocol ReaderRecommendedSitesCardCellDelegate { +protocol ReaderRecommendedSitesCardCellDelegate: AnyObject { func handleFollowActionForCell(_ cell: ReaderRecommendedSiteCardCell) } diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderSearchSuggestionsViewController.swift b/WordPress/Classes/ViewRelated/Reader/ReaderSearchSuggestionsViewController.swift index f4dec4489ba2..7c6b37389444 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderSearchSuggestionsViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderSearchSuggestionsViewController.swift @@ -5,7 +5,7 @@ import WordPressShared /// Defines methods that a delegate should implement for clearing suggestions /// and for responding to a selected suggestion. /// -protocol ReaderSearchSuggestionsDelegate { +protocol ReaderSearchSuggestionsDelegate: AnyObject { func searchSuggestionsController(_ controller: ReaderSearchSuggestionsViewController, selectedItem: String) } @@ -28,7 +28,7 @@ class ReaderSearchSuggestionsViewController: UIViewController { } @objc var tableViewHandler: WPTableViewHandler! - var delegate: ReaderSearchSuggestionsDelegate? + weak var delegate: ReaderSearchSuggestionsDelegate? @objc let cellIdentifier = "CellIdentifier" @objc let rowAndButtonHeight = CGFloat(44.0) diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderSiteStreamHeader.swift b/WordPress/Classes/ViewRelated/Reader/ReaderSiteStreamHeader.swift index 71cad564149b..b4437e4e2a05 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderSiteStreamHeader.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderSiteStreamHeader.swift @@ -36,7 +36,7 @@ fileprivate func > (lhs: T?, rhs: T?) -> Bool { @IBOutlet fileprivate weak var descriptionLabel: UILabel! @IBOutlet fileprivate weak var descriptionLabelTopConstraint: NSLayoutConstraint! - open var delegate: ReaderStreamHeaderDelegate? + open weak var delegate: ReaderStreamHeaderDelegate? fileprivate var defaultBlavatar = "blavatar-default" // MARK: - Lifecycle Methods diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderStreamHeader.swift b/WordPress/Classes/ViewRelated/Reader/ReaderStreamHeader.swift index d970a7c02cbf..137cbc363037 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderStreamHeader.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderStreamHeader.swift @@ -1,11 +1,11 @@ import Foundation -public protocol ReaderStreamHeaderDelegate: NSObjectProtocol { +@objc public protocol ReaderStreamHeaderDelegate { func handleFollowActionForHeader(_ header: ReaderStreamHeader, completion: @escaping () -> Void) } -public protocol ReaderStreamHeader: NSObjectProtocol { - var delegate: ReaderStreamHeaderDelegate? {get set} +@objc public protocol ReaderStreamHeader { + weak var delegate: ReaderStreamHeaderDelegate? {get set} func enableLoggedInFeatures(_ enable: Bool) func configureHeader(_ topic: ReaderAbstractTopic) } diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderTagStreamHeader.swift b/WordPress/Classes/ViewRelated/Reader/ReaderTagStreamHeader.swift index 0ce723d11d09..55278fcbe80f 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderTagStreamHeader.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderTagStreamHeader.swift @@ -5,7 +5,7 @@ import WordPressShared @IBOutlet fileprivate weak var titleLabel: UILabel! @IBOutlet fileprivate weak var followButton: UIButton! - open var delegate: ReaderStreamHeaderDelegate? + open weak var delegate: ReaderStreamHeaderDelegate? // MARK: - Lifecycle Methods open override func awakeFromNib() {