Skip to content

Commit 4bf0b3f

Browse files
committed
Extract border configuration to a method
1 parent 517fc39 commit 4bf0b3f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/AvatarTrainView.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ final class AvatarTrainView: UIView {
4343
// redraw border when user interface style changes.
4444
if let previousTraitCollection = previousTraitCollection,
4545
previousTraitCollection.userInterfaceStyle != traitCollection.userInterfaceStyle {
46-
avatarStackView.subviews.forEach { configureBorder(for: $0) }
46+
configureAvatarBorders()
4747
}
4848
}
4949

5050
override func layoutSubviews() {
51-
avatarStackView.arrangedSubviews.forEach({ configureBorder(for: $0) })
51+
configureAvatarBorders()
5252
}
5353

5454
}
@@ -79,10 +79,12 @@ private extension AvatarTrainView {
7979
return imageView
8080
}
8181

82-
func configureBorder(for view: UIView) {
83-
view.layer.masksToBounds = true
84-
view.layer.borderWidth = Constants.borderWidth
85-
view.layer.borderColor = UIColor.listForeground.cgColor
82+
func configureAvatarBorders() {
83+
avatarStackView.arrangedSubviews.forEach { view in
84+
view.layer.masksToBounds = true
85+
view.layer.borderWidth = Constants.borderWidth
86+
view.layer.borderColor = UIColor.listForeground.cgColor
87+
}
8688
}
8789

8890
// MARK: Constants

0 commit comments

Comments
 (0)