2016-09-30 40 views

回答

0

您需要使用一個類型轉換。此代碼將做到這一點: 首先你需要設置的UITextField的標籤屬性一樣

yourTextField.tag = 123 

現在你可以使用標籤屬性來獲取yourTextField像

if let theTextField = self.view.viewWithTag(123) as? UITextField { 
    theLabel.text = "some text" 
} 
相關問題