Files
GitHawk/Classes/View Controllers/UIViewController+CommonActionItems.swift
Ryan Nystrom faca5497a8 New Inbox design (#1870)
* 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
2018-06-17 14:47:59 -04:00

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)
}
}