mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-05-28 15:23:54 +08:00
26 lines
815 B
Swift
26 lines
815 B
Swift
//
|
|
// NotificationNavigation.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 6/28/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
import SafariServices
|
|
|
|
func NavigateToNotificationContent(object: NotificationViewModel, client: GithubClient) -> UIViewController {
|
|
switch object.identifier {
|
|
case .hash(let hash):
|
|
let url = URL(string: "https://github.com/\(object.owner)/\(object.repo)/commit/\(hash)")!
|
|
return SFSafariViewController(url: url)
|
|
case .number(let number):
|
|
let model = IssueDetailsModel(owner: object.owner, repo: object.repo, number: number)
|
|
let controller = IssuesViewController(
|
|
client: client,
|
|
model: model
|
|
)
|
|
return UINavigationController(rootViewController: controller)
|
|
}
|
|
}
|