NewsBlur-viq/clients/ios/Classes/Storyboards.swift
David Sinclair 926181327a #1720 (Grid view)
- Added a Grid layout option to the feed detail menu.
- In Grid layout, the title length and image position options are replaced by grid columns and grid height options.
- When chosen, the right panes are replaced by a Grid view.
- This is a work in progress.
2022-08-19 19:21:00 -07:00

46 lines
1.4 KiB
Swift

//
// Storyboards.swift
// NewsBlur
//
// Created by David Sinclair on 2020-09-24.
// Copyright © 2020 NewsBlur. All rights reserved.
//
import UIKit
/// Singleton to manage the storyboards of the app.
class Storyboards {
/// Singleton shared instance.
static let shared = Storyboards()
/// Private init to prevent others constructing a new instance.
private init() {
}
/// Main storyboard identifiers.
enum Main: String {
case feedDetail = "FeedDetailViewController"
case gridDetail = "GridDetailViewController"
case horizontalPages = "HorizontalPageViewController"
case verticalPages = "VerticalPageViewController"
// case storyDetail = "StoryDetailViewController" // loading from XIB currently
}
/// Storyboard names.
private struct Name {
static let main = "MainInterface"
}
/// The storyboard for the main view controllers.
private lazy var mainStoryboard: UIStoryboard = {
return UIStoryboard(name: Name.main, bundle: nil)
}()
/// Returns a view controller loaded from the main storyboard, or `nil` if it couldn't be found.
///
/// - Parameter identifier: The identifier of the controller.
/// - Returns: The instantiated view controller, or `nil`.
func controller(withIdentifier identifier: Main) -> Any? {
return mainStoryboard.instantiateViewController(withIdentifier: identifier.rawValue)
}
}