Skip to content
Snippets Groups Projects
Commit 8bd4b344 authored by Oliver Wiese's avatar Oliver Wiese
Browse files

link new read view with other views

parent 44525a89
No related branches found
No related tags found
No related merge requests found
......@@ -202,7 +202,12 @@ class FolderViewController: UITableViewController {
performSegue(withIdentifier: "showInboxSegue", sender: nil)
}
} else if sectionType(indexPath) == .mails {
performSegue(withIdentifier: "readFolderMailSegue", sender: getMails()[indexPath.row])
let mail = getMails()[indexPath.row]
if AppDelegate.getAppDelegate().newReadView, let coord = AppDelegate.getAppDelegate().readViewCoordinator {
coord.pushReadView(mail: mail)
return
}
performSegue(withIdentifier: "readFolderMailSegue", sender: mail)
} else {
let vc = storyboard?.instantiateViewController(withIdentifier: "folderViewController") as! FolderViewController
vc.folders = []
......
......@@ -316,6 +316,10 @@ extension KeyViewController: UITableViewDataSource {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "firstMail" {
if let mail = record?.key?.firstMail {
if AppDelegate.getAppDelegate().newReadView, let coord = AppDelegate.getAppDelegate().readViewCoordinator {
coord.pushReadView(mail: mail)
return
}
let DestinationViewController: ReadViewController = segue.destination as! ReadViewController
DestinationViewController.mail = mail
}
......
......@@ -242,6 +242,10 @@ class ListViewController: UITableViewController {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "readMailSegue" {
if let mail = sender as? PersistentMail {
if AppDelegate.getAppDelegate().newReadView, let coord = AppDelegate.getAppDelegate().readViewCoordinator {
coord.pushReadView(mail: mail)
return
}
let DestinationViewController: ReadViewController = segue.destination as! ReadViewController
DestinationViewController.mail = mail
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment