Tusker/Tusker/Screens/Main/TuskerRootViewController.swift

50 lines
1.5 KiB
Swift
Raw Permalink Normal View History

2020-06-24 20:40:45 +00:00
//
// TuskerRootViewController.swift
// Tusker
//
// Created by Shadowfacts on 6/24/20.
// Copyright © 2020 Shadowfacts. All rights reserved.
//
import UIKit
import ComposeUI
2020-06-24 20:40:45 +00:00
@MainActor
2023-02-23 02:38:12 +00:00
protocol TuskerRootViewController: UIViewController, StateRestorableViewController, StatusBarTappableViewController {
func compose(editing draft: Draft?, animated: Bool, isDucked: Bool)
func select(route: TuskerRoute, animated: Bool, completion: (() -> Void)?)
func getTabController(tab: MainTabBarViewController.Tab) -> UIViewController?
func getNavigationDelegate() -> TuskerNavigationDelegate?
func getNavigationController() -> NavigationControllerProtocol
2021-05-24 23:07:47 +00:00
func performSearch(query: String)
@discardableResult
func presentPreferences(completion: (() -> Void)?) -> PreferencesNavigationController?
2020-06-24 20:40:45 +00:00
}
enum TuskerRoute {
case timelines
case notifications
case myProfile
case explore
case bookmarks
case list(id: String)
}
@MainActor
protocol NavigationControllerProtocol: UIViewController {
var viewControllers: [UIViewController] { get set }
var topViewController: UIViewController? { get }
@discardableResult
func popToRootViewController(animated: Bool) -> [UIViewController]?
func pushViewController(_ vc: UIViewController, animated: Bool)
}
extension UINavigationController: NavigationControllerProtocol {
}
extension SplitNavigationController: NavigationControllerProtocol {
var topViewController: UIViewController? {
viewControllers.last
}
}