-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change a few delegate properties in Signup to be weak references #21064
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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) | ||||||||||||||||||||
|
@@ -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 } | ||||||||||||||||||||
|
@@ -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? | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WordPress-iOS/WordPress/Classes/ViewRelated/NUX/SignupEpilogueViewController.swift Lines 71 to 79 in 48b8a39
I'm not sure if a view controller would hold strong references to segue instances, which would cause a retain cycle in our case here. But considering how this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I jumped on this memory leak in other investigations. |
||||||||||||||||||||
open var credentials: AuthenticatorCredentials? | ||||||||||||||||||||
open var socialService: SocialService? | ||||||||||||||||||||
|
||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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? | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a retain cycle between WordPress-iOS/WordPress/Classes/ViewRelated/NUX/SignupUsernameViewController.swift Lines 31 to 36 in 48b8a39
|
||||||||||||||
open var suggestions: [String] = [] | ||||||||||||||
private var service: AccountSettingsService? | ||||||||||||||
private var isSearching: Bool = false | ||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2,7 +2,7 @@ import SVProgressHUD | |||||||||||||||||||
import WordPressAuthenticator | ||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
protocol SignupUsernameViewControllerDelegate { | ||||||||||||||||||||
protocol SignupUsernameViewControllerDelegate: AnyObject { | ||||||||||||||||||||
func usernameSelected(_ username: String) | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
|
@@ -12,7 +12,7 @@ class SignupUsernameViewController: UIViewController { | |||||||||||||||||||
|
||||||||||||||||||||
open var currentUsername: String? | ||||||||||||||||||||
open var displayName: String? | ||||||||||||||||||||
open var delegate: SignupUsernameViewControllerDelegate? | ||||||||||||||||||||
open weak var delegate: SignupUsernameViewControllerDelegate? | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This WordPress-iOS/WordPress/Classes/ViewRelated/NUX/SignupEpilogueViewController.swift Lines 80 to 88 in 48b8a39
|
||||||||||||||||||||
private var usernamesTableViewController: SignupUsernameTableViewController? | ||||||||||||||||||||
|
||||||||||||||||||||
// MARK: - View | ||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a retain cycle between the
SignupEpilogueTableViewController
and thisSignupEpilogueCell
.WordPress-iOS/WordPress/Classes/ViewRelated/NUX/SignupEpilogueTableViewController.swift
Line 214 in 48b8a39