UITextfield leftView/rightView padding on iOS7,Create space at the beginning of a UITextField

//
// PaddingTextField.swift
// Snapo
//
// Created by mhtran on 5/3/17.
// Copyright © 2017 mhtran. All rights reserved.
//

import Foundation
import UIKit
class PaddingTextField: UITextField {

let padding = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5);

override func textRect(forBounds bounds: CGRect) -> CGRect {
return UIEdgeInsetsInsetRect(bounds, padding)
}

override func placeholderRect(forBounds bounds: CGRect) -> CGRect {
return UIEdgeInsetsInsetRect(bounds, padding)
}

override func editingRect(forBounds bounds: CGRect) -> CGRect {
return UIEdgeInsetsInsetRect(bounds, padding)
}

override func rightViewRect(forBounds bounds: CGRect) -> CGRect {

var textRect: CGRect = super.rightViewRect(forBounds: bounds)
textRect.origin.x -= 10
return textRect
}
}

let buttonSearch = UIButton()
buttonSearch.setImage(UIImage(named:"search"), for: UIControlState.normal)
buttonSearch.frame = CGRect(x: self.frame.size.width - 60 , y: 3, width: 50, height: 50)
textField.clearButtonMode = UITextFieldViewMode.always;
textField.rightView = buttonSearch
textField.rightViewMode = UITextFieldViewMode.always
textField.delegate = self
textField.text = ""
textField.placeholder = "Search".localized()
textField.textAlignment = .left
_ = textField.textRect(forBounds: CGRect(x: 0, y: 0, width: self.frame.size.width, height: 45))
_ = textField.rightViewRect(forBounds: CGRect(x: 0, y: 0, width: self.frame.size.width, height: 45))
tableView = UITableView(frame: CGRect(x: 0, y: 60, width: self.frame.size.width, height: self.frame.size.height - 105))