You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got this code to find the previous item of an item which satisfies a condition:
func keyInputLeftArrow(_ keyInput: UIKeyInput) {
var previousItem: CodeSelectTextField? = nil
for item in codeInput.subviews as! [CodeSelectTextField] {
if item.isFirstResponder {
previousItem?.becomeFirstResponder()
return
}
previousItem = item
}
}
I'm not sure it can be rewritten using where. Maybe the SwiftLint warning shouldn't trigger when there are statements after the if (like previousItem = item in my example).
The text was updated successfully, but these errors were encountered:
I got this code to find the previous item of an item which satisfies a condition:
I'm not sure it can be rewritten using
where
. Maybe the SwiftLint warning shouldn't trigger when there are statements after theif
(likepreviousItem = item
in my example).The text was updated successfully, but these errors were encountered: