Skip to content

Instantly share code, notes, and snippets.

@BrunoScheltzke
Created July 6, 2020 21:46
Show Gist options
  • Save BrunoScheltzke/e2764d33bbf736998cd7a97f6ae77841 to your computer and use it in GitHub Desktop.
Save BrunoScheltzke/e2764d33bbf736998cd7a97f6ae77841 to your computer and use it in GitHub Desktop.
//
// UITextField.swift
//
// Created by Bruno Scheltzke on 07/06/20.
// Copyright © 2020 Bruno Scheltzke. All rights reserved.
//
import UIKit
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
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment