要使用其标记在视图中获取按钮,可以使用UIView.viewWithTag函数.
if let button = self.view.viewWithTag(tag) as? UIButton { button.setTitle("newTitle",forState: UIControlState.Normal) }