TextFieldWithPadding.swift
636 Bytes
//
// TextFieldWithPadding.swift
// InterQR-Internship
//
// Created by Дмитрий Тимофеев on 01.06.2022.
//
import UIKit
class TextFieldWithPadding: UITextField {
var textPadding = UIEdgeInsets(
top: 0,
left: 0,
bottom: 0,
right: 0)
override func textRect(forBounds bounds: CGRect) -> CGRect {
let rect = super.textRect(forBounds: bounds)
return rect.inset(by: textPadding)
}
override func editingRect(forBounds bounds: CGRect) -> CGRect {
let rect = super.editingRect(forBounds: bounds)
return rect.inset(by: textPadding)
}
}