Advertisement
xosseh

Untitled

Nov 15th, 2024 (edited)
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. if let emoji = emoji {
  2. symbolTextField.text = emoji.symbol
  3. nameTextField.text = emoji.name
  4. descriptionTextField.text = emoji.description
  5. usageTextField.text = emoji.usage
  6. title = "Edit Emoji"
  7. } else {
  8. title = "Add Emoji"
  9. }
  10.  
  11. updateSaveButtonState()
  12.  
  13.  
  14. func updateSaveButtonState() {
  15. let symbolText = symbolTextField.text ?? ""
  16. let nameText = nameTextField.text ?? ""
  17. let descriptionText = descriptionTextField.text ?? ""
  18. let usageText = usageTextField.text ?? ""
  19. saveButton.isEnabled = !symbolText.isEmpty && !nameText.isEmpty && !descriptionText.isEmpty && !usageText.isEmpty
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement