For some reason, when I add a UITextfield as a subview of the contentview of a tablecell, the clearbutton does not align with the text typed in the field, and appears a bit unde
The answer from Van Du Tran in Swift 4:
class CustomTextField: UITextField { override func clearButtonRect(forBounds bounds: CGRect) -> CGRect { let originalRect = super.clearButtonRect(forBounds: bounds) return originalRect.offsetBy(dx: -8, dy: 0) }
}