It's taken from interview question. You have button in the center of UIViewController that when tapped, returns one of actions enum types. Depending on the action there should be different behaviour. Like:
- Change button color.
- Send email.
- Show local notification.
In future there should be more complex actions that either change UIViewController or use native or 3rd party libs. Because there is nothing common between those action, I would just write simple Switch and do everything inside UIViewController. Do you know a smarter way?
Aucun commentaire:
Enregistrer un commentaire