많은 스토리 보드에 걸쳐 많은 viewcontroller가 있습니다."unknown"viewcontroller에 데이터 전달하기
viewcontroller 식별자 만 알고있을 때 viewcontroller에 데이터를 전달할 수있는 방법이 있습니까?
의 ViewController 식별자 및 스토리 보드 이름
가 PLIST로부터 판독되고, 상기의 ViewController가 다음과 같이 장착된다let storyboard = UIStoryboard(name: plistdata.storyboard, bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: menuItem.identifier)
navigationController?.pushViewController(vc, animated: true)
제가 적절한 클래스로의 ViewController 캐스팅 질수 있기 때문에, 전 데이터를 설정 캔트.
let vc = storyboard.instantiateViewController(withIdentifier: menuItem.identifier) as! ClassFromString("MyDestinationViewController")
또는 같은 클래스가 문자열에서 주조 될 수있는, 뭔가 데이터 모델이의 ViewController가 추진되고있는 추적해야하는 더 나은 방법, 그리고 가능한 한 빨리 대상의 ViewController에서 필요한 데이터를 가져 오는 것 로드?