I currently have a regular border. I would like to only have a top and bottom border.
How do I accomplish this?
Using the UITextField<
Swift 3: Clean with AutoLayout (I'm using here PureLayout but you can also do it with common NSLayoutConstraint:
func makeUnderline(for textField: UITextField) {
let borderLine = UIView()
borderLine.backgroundColor = UIColor.black
borderLine.autoSetDimension(.height, toSize: 1)
textField.addSubview(borderLine)
borderLine.autoPinEdgesToSuperviewEdges(with: UIEdgeInsets.zero, excludingEdge: .top)
}