Skip to content

Commit 5edbe50

Browse files
committed
adicionada cor ao textField e ao placeholder
1 parent 169a284 commit 5edbe50

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

AnimalsApp/AnimalsApp/Views/RegisterViewController/RegisterViewController.swift

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,21 @@ class RegisterViewController: UIViewController {
4141
}
4242

4343
private func setupUI() {
44-
textFieldName.layer.cornerRadius = 10
45-
textFieldImageLink.layer.cornerRadius = 10
46-
textFieldDescription.layer.cornerRadius = 10
47-
textFieldSpecie.layer.cornerRadius = 10
48-
textFieldAge.layer.cornerRadius = 10
44+
[textFieldName, textFieldImageLink, textFieldDescription, textFieldSpecie, textFieldAge].forEach { textField in
45+
textField?.layer.cornerRadius = 8
46+
textField?.layer.borderWidth = 1
47+
textField?.layer.borderColor = UIColor.systemGray.cgColor
48+
textField?.layer.masksToBounds = true
49+
}
50+
51+
let attributes = [
52+
NSAttributedString.Key.foregroundColor: UIColor.systemGray
53+
]
54+
textFieldName.attributedPlaceholder = NSAttributedString(string: "Nome", attributes:attributes)
55+
textFieldImageLink.attributedPlaceholder = NSAttributedString(string: "Link da imagem", attributes:attributes)
56+
textFieldDescription.attributedPlaceholder = NSAttributedString(string: "Descrição", attributes:attributes)
57+
textFieldSpecie.attributedPlaceholder = NSAttributedString(string: "Espécie", attributes:attributes)
58+
textFieldAge.attributedPlaceholder = NSAttributedString(string: "Idade", attributes:attributes)
4959
buttonRegister.layer.cornerRadius = 10
5060
}
5161
}

0 commit comments

Comments
 (0)