我在Swift App的viewController中添加了一個按鈕,當我通過modal segue更改爲下一個Viewcontroller時,此元素顯示在下一個viewController中。我怎樣才能刪除查看這個?如何刪除viewController中編碼的視圖按鈕?
override func viewDidLoad()
{
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let logInButton = TWTRLogInButton(logInCompletion: {
(session: TWTRSession!, error: NSError!) in
...
print(session.userName)
...
})
logInButton.center = self.view.center
self.view.addSubview(logInButton)//Here add the button
}
I'trying
self.view.delete(logInButton)
但是,這得到錯誤。
謝謝!
您得到了什麼錯誤? – userx