-
Notifications
You must be signed in to change notification settings - Fork 0
/
RoundedUITextField.swift
47 lines (29 loc) · 1.19 KB
/
RoundedUITextField.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// RoundedUITextField.swift
// Inaldo&Tony
//
// Created by Davide Cifariello on 14/12/17.
// Copyright © 2017 Antonio Sirica. All rights reserved.
//
import UIKit
class RoundedUITextField: UITextField {
override init(frame: CGRect) {
super.init(frame: frame)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override func awakeFromNib() {
super.awakeFromNib()
self.setAttributes()
}
func setAttributes() {
//self.layer.cornerRadius = 20.0
self.textColor = UIColor.white
self.backgroundColor = UIColor(red:0.07, green:0.07, blue:0.07, alpha:1.0)
self.tintColor = UIColor(red:0.48, green:0.73, blue:0.84, alpha:1.0)
// let str = NSAttributedString(string: (self.placeholder)!, attributes: [NSAttributedStringKey.foregroundColor:UIColor.white])
//self.attributedPlaceholder = str
self.attributedPlaceholder = NSAttributedString(string: self.placeholder!, attributes: [NSAttributedStringKey.foregroundColor: UIColor(red:0.56, green:0.56, blue:0.58, alpha:1.0)])
}
}