Can you create anonymous inner classes in Swift?
问题 I'm tired of declaring entire classes as having the ability to handle UIAlertView clicks by making them extend UIAlertViewDelegate . It starts to feel messy and wrong when I have multiple possible UIAlertView s, and have to distinguish which was clicked in the handler. What I really want is to create a single object that implements the UIAlertViewDelegate protocol, and give this one-off object to my UIAlertView when showing it. I want something like this: let confirmDelegate =