【发布时间】:2016-04-10 02:01:02
【问题描述】:
我正在开发一个 swift 应用程序,它有一个标签栏控制器,其中一个标签有一个导航控制器。带有导航控制器的选项卡有一个表格视图,表格视图中的单元格连接到一个常规的视图控制器。信息根据需要出现在目标视图控制器中,当目标视图控制器出现时,标签栏和导航栏都会消失。
这是我的 prepareForSegue:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "entryCellToEntryView" {
if let destination = segue.destinationViewController as? EntryDetailViewController {
if let index = customTableView.indexPathForSelectedRow {
if let cell = customTableView.cellForRowAtIndexPath(index) as? EntryTableViewCell {
destination.entryToDisplay = cell.entry
} else {
print("prepareForSeque: Unable to cast cell as EntryTableViewCell")
}
} else {
print("prepareForSeque: Index cannot be established")
}
} else {
print("prepareForSeque: Destination cannot be downcast to EntryDetailViewController")
}
}
}
这是我的故事板照片的链接: http://grantbroadwater.com/storyboard.png
【问题讨论】:
标签: swift uitableview uinavigationcontroller uitabbarcontroller segue