Comicmind Material 框架按钮事件处理程序

Comicmind Material Framework button event handler

我想问一下,如何使用cosmicmind/Material处理Material按钮的事件?我目前有这段代码。现在,我想在用户点击或单击按钮时执行一个功能。谢谢!

fileprivate func prepareRaisedButton() {
        let button = RaisedButton(title: "Create an account", titleColor : .white)
        button.pulseColor = .white
        button.backgroundColor = Color.teal.base

        view.layout(button)
            .height(ButtonLayout.Raised.height)
            .top(18 * constant).horizontally(left : constant, right : constant)
    }

你要的方法继承自UIControl:

button.addTarget(self, action: #selector(tapButton), for: .touchUpInside)