Last active
May 31, 2016 02:57
-
-
Save RyogaK/4de0607c469062f67fb764ae10ccf305 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// InsettedTextField.swift | |
// | |
// Created by Ryoga Kitagawa on 5/31/16. | |
// | |
import Foundation | |
@IBDesignable class InsettedTextField: UITextField { | |
@IBInspectable var insetX: CGFloat = 0.0 | |
@IBInspectable var insetY: CGFloat = 0.0 | |
override func textRectForBounds(bounds: CGRect) -> CGRect { | |
return CGRectInset(bounds, self.insetX, self.insetY) | |
} | |
override func editingRectForBounds(bounds: CGRect) -> CGRect { | |
return CGRectInset(bounds, self.insetX, self.insetY) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment