0
class MyCViewContollerClass:UIViewController{
var button = UIButton()
}
let storyBoard = UIStoryboard()
let viewController = storyBoard.instantiateViewController(withIdentifier: "vc") as! MyCViewContollerClass
您是否将'MyCViewContollerClass'设置为标识符为“vc”的视图控制器的类? –
你在Interface Builder中使用故事板吗? – vadian
不,我正在使用游乐场.. –