Not sure if you'll like all of these. You don't need Selector("foo") because it's StringLiteralConvertible but it's less explicit, so kind of a matter of taste there.
Same for changing the guard let to if let, but in that case it's simpler because you skip the additional check, and getViewByClassName always returns the correct class so it was effectively a nil check anyway.
Not sure if you'll like all of these. You don't need
Selector("foo")
because it'sStringLiteralConvertible
but it's less explicit, so kind of a matter of taste there.Same for changing the
guard let
toif let
, but in that case it's simpler because you skip the additional check, andgetViewByClassName
always returns the correct class so it was effectively a nil check anyway.