0
class MyCViewContollerClass:UIViewController{
var button = UIButton()
}
let storyBoard = UIStoryboard()
let viewController = storyBoard.instantiateViewController(withIdentifier: "vc") as! MyCViewContollerClass
您是否將'MyCViewContollerClass'設置爲標識符爲「vc」的視圖控制器的類? –
你在Interface Builder中使用故事板嗎? – vadian
不,我正在使用遊樂場.. –