TextField.swift 594 B

123456789101112131415161718192021222324252627
  1. //
  2. // TextField.swift
  3. // ResetTransmitter
  4. //
  5. // Copyright © 2018 LoopKit Authors. All rights reserved.
  6. //
  7. import UIKit
  8. class TextField: UITextField {
  9. private let textInset = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: 0)
  10. override func editingRect(forBounds bounds: CGRect) -> CGRect {
  11. return bounds.inset(by: textInset)
  12. }
  13. override func textRect(forBounds bounds: CGRect) -> CGRect {
  14. return bounds.inset(by: textInset)
  15. }
  16. override func placeholderRect(forBounds bounds: CGRect) -> CGRect {
  17. return bounds.inset(by: textInset)
  18. }
  19. }