2017-01-22 40 views
0

我只想問,如何使用宇宙材料/材質來處理材質按鈕的事件?我目前有這個代碼。現在,當用戶點擊或點擊按鈕時,我想要做一個功能。謝謝!Comicmind材質框架按鈕事件處理程序

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) 
    } 

回答

1

你想從UIControl繼承的方法:

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

是的,的確!這是正確的答案。 –

+0

還有一件事,我如何獲得文本框的值? email.text不起作用 –