How to add a border just on the top side of a UIView
I consider subclassing UIView and overriding drawRect overkill here. Why not add an extension on UIView and add border subviews? @discardableResult func addBorders(edges: UIRectEdge, color: UIColor, inset: CGFloat = 0.0, thickness: CGFloat = 1.0) -> [UIView] { var borders = [UIView]() @discardableResult func addBorder(formats: String…) -> UIView { let border = UIView(frame: .zero) border.backgroundColor = … Read more