0
でそのプロパティを使用することはできませんsb.instantiateViewController(withIdentifier:)
からvc10
を作成し、ViewController10
にその型を変換してもそのproperty
を使用することはできません。Q:(sb.instantiateViewControllerからwithIdentifierをVCを作成:)迅速
下記これは私のコードです:
vc9:
let sb = UIStoryboard.init(name: "Main", bundle: nil)
var vc10 = sb.instantiateViewController(withIdentifier: "ViewController10")
//vc10.delegate = self // there is the error: Value of type 'UIViewController' hs no member 'delegate'
(ViewController10(vc10)).delegate = self // this did not work too
self.navigationController!.pushViewController(vc10, animated: true)
vc10:
var delegate:ViewController9? // this is the property delegate