class MyTextFiled: UITextField {
override func awakeFromNib() {
super.awakeFromNib()
// additional code to make UITextField looking according to your needs
//placeholder
self.text = "Placeholder"
self.textColor = UIColor.lightGrayColor()
// bottom line instead of border
}
@IBDesignable
class CustomTextField: UITextField {
override func drawRect(rect: CGRect) {
super.drawRect(rect)
// do your custom drawing here...
}
}
override func awakeFromNib() {
super.awakeFromNib()
// initialize properties here...
}
UITextField.appearance().backgroundColor = UIColor.blueColor()
import UIKit
class MyTextField: UITextField {
override func drawRect(rect: CGRect) {
let startingPoint = CGPoint(x: rect.minX, y: rect.maxY)
let endingPoint = CGPoint(x: rect.maxX, y: rect.maxY)
let path = UIBezierPath()
path.moveToPoint(startingPoint)
path.addLineToPoint(endingPoint)
path.lineWidth = 3.0
tintColor.setStroke()
path.stroke()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// additional code to make UITextField looking according to your needs
//placeholder
self.text = "Placeholder"
self.textColor = UIColor.lightGrayColor()
// bottom line instead of border
}
@IBDesignable
class CustomTextField: UITextField {
override func drawRect(rect: CGRect) {
super.drawRect(rect)
// do your custom drawing here...
}
}
override func awakeFromNib() {
super.awakeFromNib()
// initialize properties here...
}
UITextField.appearance().backgroundColor = UIColor.blueColor()
import UIKit
class MyTextField: UITextField {
override func drawRect(rect: CGRect) {
let startingPoint = CGPoint(x: rect.minX, y: rect.maxY)
let endingPoint = CGPoint(x: rect.maxX, y: rect.maxY)
let path = UIBezierPath()
path.moveToPoint(startingPoint)
path.addLineToPoint(endingPoint)
path.lineWidth = 3.0
tintColor.setStroke()
path.stroke()
}
}