TextFieldWithPadding.swift 667 Bytes
//
//  TextFieldWithPadding.swift
//  InterQR-Internship
//
//  Created by Дмитрий Тимофеев on 01.06.2022.
//

import UIKit

class TextFieldWithPadding: UITextField {
    var textPaddingForPhone = UIEdgeInsets(
        top: 0,
        left: 78,
        bottom: 0,
        right: 22
    )
    
    override func textRect(forBounds bounds: CGRect) -> CGRect {
        let rect = super.textRect(forBounds: bounds)
        return rect.inset(by: textPaddingForPhone)
    }

    override func editingRect(forBounds bounds: CGRect) -> CGRect {
        let rect = super.editingRect(forBounds: bounds)
        return rect.inset(by: textPaddingForPhone)
    }
}