Skip to content

Commit

Permalink
Change a few delegate properties in Signup to be weak references
Browse files Browse the repository at this point in the history
  • Loading branch information
crazytonyli committed Jul 11, 2023
1 parent db15a47 commit a530793
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions WordPress/Classes/ViewRelated/NUX/SignupEpilogueCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import UIKit
import WordPressAuthenticator


protocol SignupEpilogueCellDelegate {
protocol SignupEpilogueCellDelegate: AnyObject {
func updated(value: String, forType: EpilogueCellType)
func changed(value: String, forType: EpilogueCellType)
}
Expand Down Expand Up @@ -37,7 +37,7 @@ class SignupEpilogueCell: UITableViewCell {
private let passwordTopMargin: CGFloat = 16

private var cellType: EpilogueCellType?
open var delegate: SignupEpilogueCellDelegate?
open weak var delegate: SignupEpilogueCellDelegate?

// MARK: - UITableViewCell

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import UIKit
import WordPressAuthenticator


protocol SignupEpilogueTableViewControllerDelegate {
protocol SignupEpilogueTableViewControllerDelegate: AnyObject {
func displayNameUpdated(newDisplayName: String)
func displayNameAutoGenerated(newDisplayName: String)
func passwordUpdated(newPassword: String)
Expand All @@ -11,7 +11,7 @@ protocol SignupEpilogueTableViewControllerDelegate {

/// Data source to get the temporary user info, not yet saved in the user account.
///
protocol SignupEpilogueTableViewControllerDataSource {
protocol SignupEpilogueTableViewControllerDataSource: AnyObject {
var customDisplayName: String? { get }
var password: String? { get }
var username: String? { get }
Expand All @@ -21,8 +21,8 @@ class SignupEpilogueTableViewController: UITableViewController, EpilogueUserInfo

// MARK: - Properties

open var dataSource: SignupEpilogueTableViewControllerDataSource?
open var delegate: SignupEpilogueTableViewControllerDelegate?
open weak var dataSource: SignupEpilogueTableViewControllerDataSource?
open weak var delegate: SignupEpilogueTableViewControllerDelegate?
open var credentials: AuthenticatorCredentials?
open var socialService: SocialService?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import WordPressAuthenticator
class SignupUsernameTableViewController: UITableViewController, SearchTableViewCellDelegate {
open var currentUsername: String?
open var displayName: String?
open var delegate: SignupUsernameViewControllerDelegate?
open weak var delegate: SignupUsernameViewControllerDelegate?
open var suggestions: [String] = []
private var service: AccountSettingsService?
private var isSearching: Bool = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SVProgressHUD
import WordPressAuthenticator


protocol SignupUsernameViewControllerDelegate {
protocol SignupUsernameViewControllerDelegate: AnyObject {
func usernameSelected(_ username: String)
}

Expand All @@ -12,7 +12,7 @@ class SignupUsernameViewController: UIViewController {

open var currentUsername: String?
open var displayName: String?
open var delegate: SignupUsernameViewControllerDelegate?
open weak var delegate: SignupUsernameViewControllerDelegate?
private var usernamesTableViewController: SignupUsernameTableViewController?

// MARK: - View
Expand Down

0 comments on commit a530793

Please sign in to comment.