Debugging events in Swift