splitViewController의 viewControllers[1]이 detailView이다.
[0]은 master View
viewcontroller를 상속하였기에 뷰 컨트롤러를 넣을 수 있으니 기존 만들어 둔 뷰 컨트롤러를 붙이기 딱 좋다.
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch indexPath.row {
case 0:
debugPrint("indexPath.row - 0")
case 1:
debugPrint("indexPath.row - 1")
let detailViewController = self.storyboard?.instantiateViewController(withIdentifier: "detailview1") as! UINavigationController
self.splitViewController?.viewControllers[1] = detailViewController
case 2:
debugPrint("indexPath.row - 2")
let detailViewController = self.storyboard?.instantiateViewController(withIdentifier: "detailview2") as! UINavigationController
self.splitViewController?.viewControllers[1] = detailViewController
case 4 :
debugPrint("indexPath.row - 3")
let detailViewController = self.storyboard!.instantiateViewController(withIdentifier: "detailview3")
self.splitViewController?.viewControllers[1] = detailViewController
FMI (For More Information)
https://stackoverflow.com/questions/38092605/how-to-change-detail-view-in-splitviewcontroller-programatically-in-swift
'3D world > Unreal Engine Games Review' 카테고리의 다른 글
collections removeall() (0) | 2019.01.14 |
---|---|
테마적용? (0) | 2019.01.12 |
헥사 코드로 컬러 설정하기 (0) | 2019.01.12 |
master cell customizing : master detail view (0) | 2019.01.12 |
싱글톤은 최소 2개 이상 (0) | 2019.01.12 |
최근댓글