Tusker/Tusker/Controllers/MenuController.swift

34 lines
897 B
Swift
Raw Normal View History

2020-11-14 16:10:20 +00:00
//
// MenuController.swift
// Tusker
//
// Created by Shadowfacts on 11/14/20.
// Copyright © 2020 Shadowfacts. All rights reserved.
//
import UIKit
struct MenuController {
static func refreshCommand(discoverabilityTitle: String?) -> UIKeyCommand {
return UIKeyCommand(title: "Refresh", action: #selector(RefreshableViewController.refresh), input: "r", modifierFlags: .command, discoverabilityTitle: discoverabilityTitle)
}
static func buildMainMenu(builder: UIMenuBuilder) {
builder.insertChild(buildViewMenu(), atEndOfMenu: .view)
}
private static func buildViewMenu() -> UIMenu {
return UIMenu(
title: "",
image: nil,
identifier: nil,
options: .displayInline,
children: [
refreshCommand(discoverabilityTitle: nil),
]
)
}
}