Navigation Controller 간 변환
2182 단어 Swift
FirstView→NavigationController→SecondView
이렇게 바꾸고 싶어요.
같은 스토리보드에sege를 사용하지 않는 방법
FirstView→NavigationController→SecondView
sample.swift func test() {
let storyboard = UIStoryboard(name: "view1", bundle: NSBundle.mainBundle())
let naviView = storyboard.instantiateViewControllerWithIdentifier("Second") as! UINavigationController
let view = naviView.topViewController as! SecondView
view.hogehoge = "ほげほげ"
self.navigationController?.pushViewController(view, animated: true)
}
구분자 사용 시
FirstVC에서 present modally로 변환
그리고 SecondVC에 Embed in의 navigation controller를 추가하면 됩니다.
Reference
이 문제에 관하여(Navigation Controller 간 변환), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/hi_erica_/items/b9481093c7d9be61643e
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
func test() {
let storyboard = UIStoryboard(name: "view1", bundle: NSBundle.mainBundle())
let naviView = storyboard.instantiateViewControllerWithIdentifier("Second") as! UINavigationController
let view = naviView.topViewController as! SecondView
view.hogehoge = "ほげほげ"
self.navigationController?.pushViewController(view, animated: true)
}
FirstVC에서 present modally로 변환
그리고 SecondVC에 Embed in의 navigation controller를 추가하면 됩니다.
Reference
이 문제에 관하여(Navigation Controller 간 변환), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/hi_erica_/items/b9481093c7d9be61643e텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)