Replace if let strongSelf = self
and if let self = self
checks in closures with modern if let self
#19549
Labels
if let strongSelf = self
and if let self = self
checks in closures with modern if let self
#19549
There's nothing wrong with using
if let strongSelf = self
orguard let strongSelf = self
. However,strongSelf
makes the code a bit more cumbersome to read.strongSelf
or any other name different fromself
used to be required when we couldn't use that keyword in an assignment within a closure, but we now can and do so in various places, e.g.WordPress-iOS/WordPress/Classes/ViewRelated/Stats/Insights/SiteStatsInsightsTableViewController.swift
Lines 512 to 514 in 939521f
We should remove the leftover instances of this old pattern and keep the codebase homogeneous.
Update, we can actually use an even better syntax:
I renamed the issue accordingly to include acting on both
strongSelf = self
andself = self
.The text was updated successfully, but these errors were encountered: