반응형
Step 1) 스토리보드에 들어가서 segue.identifier에 원하는 이름을 정해준다음
Step 2) prepare 함수를 override해서 그안에 원하는 값을 다음 뷰로 전달해주면 된다.
But!! 여기서 주의할 점!!
중간에 Navigation Controller를 새로이 임베디드 시키면 segue.destination을 변경 시켜줘야 한다!
guard let navigationController = segue.destination as? UINavigationController else {
return
}
guard let nextViewController = navigationController.topViewController as? SendingCommentViewController else { return }
이런식으로 말이다.
*여기서 말하는 navigation.topViewController는 navagation stack의 첫번째 컨트롤러를 말하는 것이다.
반응형
'iOS 앱 개발 > 앱 개발 중 깨달음' 카테고리의 다른 글
Operation Queue vs Dispatch Queue for iOS Application (0) | 2019.07.08 |
---|---|
[이게 무엇일까?] MGIsDeviceOneOfType is not supported on this platform. (0) | 2019.02.18 |
ContentMode에 대해서..(Scale to Fill, Aspect Fit, Aspect Fill) (0) | 2019.02.17 |
세그를 막는 방법! shouldPerformSegue! (0) | 2018.09.28 |
RootViewController로 가는 두가지 방법 (0) | 2018.09.03 |