mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-15 10:07:55 +08:00
* New Inbox design * rename ident to number * use ax animation * building with old notifications removed * remove "2" suffix * use latest IGLK+Swift * apply IGLK perf fixes * fix build * Update with IGLK binding bug fix
38 lines
939 B
Swift
38 lines
939 B
Swift
//
|
|
// UIViewController+CommonActionItems.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 6/10/18.
|
|
// Copyright © 2018 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
extension UIViewController {
|
|
|
|
func action(owner: String) -> UIAlertAction? {
|
|
weak var weakSelf = self
|
|
return AlertAction(AlertActionBuilder { $0.rootViewController = weakSelf })
|
|
.view(owner: owner)
|
|
}
|
|
|
|
func action(
|
|
owner: String,
|
|
repo: String,
|
|
branch: String,
|
|
issuesEnabled: Bool,
|
|
client: GithubClient
|
|
) -> UIAlertAction? {
|
|
let repo = RepositoryDetails(
|
|
owner: owner,
|
|
name: repo,
|
|
defaultBranch: branch,
|
|
hasIssuesEnabled: issuesEnabled
|
|
)
|
|
weak var weakSelf = self
|
|
return AlertAction(AlertActionBuilder { $0.rootViewController = weakSelf })
|
|
.view(client: client, repo: repo)
|
|
}
|
|
|
|
}
|