Referencing self in super.init
问题 I have the following code ( EDIT: Updated the code so everyone can compile it and see ): import UIKit struct Action { let text: String let handler: (() -> Void)? } class AlertView : UIView { init(actions: [Action]) { super.init(frame: .zero) for action in actions { // let actionButton = ActionButton(type: .custom) // actionButton.title = action.title // actionButton.handler = action.handler // addSubview(actionButton) } } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has