import UIKit

class VCardTextEditCell: UITableViewCell {
    @IBOutlet
    var textField: UITextField!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        textField.setLeftPaddingPoints(10)
        textField.setRightPaddingPoints(20)
        self.selectionStyle = .none
    }
}

extension UITextField {
    func setLeftPaddingPoints(_ amount: CGFloat){
        let paddingView = UIView(frame: CGRect(x: 0, y: 0, width: amount, height: self.frame.size.height))
        self.leftView = paddingView
        self.leftViewMode = .always
    }
    func setRightPaddingPoints(_ amount: CGFloat) {
        let paddingView = UIView(frame: CGRect(x: 0, y: 0, width: amount, height: self.frame.size.height))
        self.rightView = paddingView
        self.rightViewMode = .always
    }
}
