Replace forEach for for-in.

This commit is contained in:
Brent Simmons
2024-04-07 17:06:39 -07:00
parent 53215c1f80
commit 6db1d40597
37 changed files with 185 additions and 123 deletions

View File

@@ -13,8 +13,9 @@ extension Array where Element == CGRect {
func maxY() -> CGFloat {
var y: CGFloat = 0.0
self.forEach { y = Swift.max(y, $0.maxY) }
for r in self {
y = Swift.max(y, r.maxY)
}
return y
}
}

View File

@@ -12,10 +12,9 @@ class RoundedProgressView: UIProgressView {
override func layoutSubviews() {
super.layoutSubviews()
subviews.forEach { subview in
for subview in subviews {
subview.layer.masksToBounds = true
subview.layer.cornerRadius = bounds.height / 2.0
}
}
}