NetNewsWire/iOS/Extensions/UISplitViewController-Exten...

32 lines
782 B
Swift
Raw Normal View History

//
// UISplitViewController-Extensions.swift
// NetNewsWire
//
// Created by Maurice Parker on 4/18/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
extension UISplitViewController {
2019-07-19 01:49:27 +02:00
static func template() -> UISplitViewController {
let splitViewController = UISplitViewController()
splitViewController.preferredDisplayMode = .allVisible
2019-07-19 22:59:46 +02:00
let navController = UINavigationController()
navController.isToolbarHidden = false
splitViewController.viewControllers = [navController]
2019-07-19 01:49:27 +02:00
return splitViewController
}
func toggleMasterView() {
let barButtonItem = self.displayModeButtonItem
if let action = barButtonItem.action {
UIApplication.shared.sendAction(action, to: barButtonItem.target, from: nil, for: nil)
}
}
}