present new issue VC modally, fixes #449

This commit is contained in:
Ryan Nystrom
2017-09-28 20:11:50 -04:00
parent 58eef8af76
commit 8d1aa57301
2 changed files with 39 additions and 17 deletions

View File

@@ -12,7 +12,9 @@ import Pageboy
import TUSafariActivity
import SafariServices
class RepositoryViewController: TabmanViewController, PageboyViewControllerDataSource {
class RepositoryViewController: TabmanViewController,
PageboyViewControllerDataSource,
NewIssueTableViewControllerDelegate {
private let repo: RepositoryDetails
private let client: GithubClient
@@ -106,8 +108,11 @@ class RepositoryViewController: TabmanViewController, PageboyViewControllerDataS
StatusBar.showGenericError()
return
}
strongSelf.show(newIssueViewController, sender: nil)
newIssueViewController.delegate = self
let nav = UINavigationController(rootViewController: newIssueViewController)
nav.modalPresentationStyle = .formSheet
strongSelf.present(nav, animated: true)
}
}
@@ -140,4 +145,11 @@ class RepositoryViewController: TabmanViewController, PageboyViewControllerDataS
return nil
}
// MARK: NewIssueTableViewControllerDelegate
func didDismissAfterCreatingIssue(model: IssueDetailsModel) {
let issuesViewController = IssuesViewController(client: client, model: model)
show(issuesViewController, sender: self)
}
}