Skip to content

Commit 539f2bd

Browse files
committed
SettingsViewController: Simplifies downcasting
1 parent 1840373 commit 539f2bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Settings/SettingsViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class SettingsViewController: UIViewController {
6868
func logOutUser() {
6969
WooAnalytics.shared.track(.logout)
7070
StoresManager.shared.deauthenticate()
71-
self.navigationController?.popToRootViewController(animated: true)
71+
navigationController?.popToRootViewController(animated: true)
7272
}
7373
}
7474

@@ -100,12 +100,12 @@ extension SettingsViewController: UITableViewDataSource {
100100
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
101101
let row = sections[indexPath.section].rows[indexPath.row]
102102
let cell = tableView.dequeueReusableCell(withIdentifier: row.reuseIdentifier, for: indexPath)
103-
if cell is LogOutTableViewCell {
104-
let logoutCell = cell as! LogOutTableViewCell
103+
if let logoutCell = cell as? LogOutTableViewCell {
105104
logoutCell.didSelectLogout = { [weak self] in
106105
self?.handleLogout()
107106
}
108107
}
108+
109109
return cell
110110
}
111111

0 commit comments

Comments
 (0)