Created
April 7, 2018 21:51
-
-
Save omaralbeik/441c57832b760ec02e3dedd4045db193 to your computer and use it in GitHub Desktop.
This file contains 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
extension UITextField { | |
convenience init( | |
placeholder: String, | |
keyboardType: UIKeyboardType = .default, | |
isSecureTextEntry: Bool = false) { | |
self.init() | |
self.placeholder = placeholder | |
self.keyboardType = keyboardType | |
self.isSecureTextEntry = isSecureTextEntry | |
} | |
} | |
extension UIButton { | |
convenience init( | |
type: UIButtonType = .system, | |
title: String?, | |
image: UIImage?) { | |
self.init(type: type) | |
self.setTitle(title, for: .normal) | |
self.setImage(image, for: .normal) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment