mirror of
https://github.com/Finb/Bark.git
synced 2025-12-08 21:36:01 +00:00
31 lines
984 B
Swift
31 lines
984 B
Swift
//
|
|
// BarkSplitViewController.swift
|
|
// Bark
|
|
//
|
|
// Created by sidguan on 2024/6/30.
|
|
// Copyright © 2024 Fin. All rights reserved.
|
|
//
|
|
|
|
import Material
|
|
import UIKit
|
|
|
|
@available(iOS 14, *)
|
|
class BarkSplitViewController: UISplitViewController {
|
|
let sectionViewController = SectionViewController_iPad(viewModel: SectionViewModel())
|
|
// Compact 下替换显示成 BarkTabBarController
|
|
let compactController = BarkTabBarController()
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
self.preferredDisplayMode = .oneBesideSecondary
|
|
self.preferredSplitBehavior = .tile
|
|
}
|
|
|
|
func initViewControllers() {
|
|
self.setViewController(sectionViewController, for: .primary)
|
|
// 设置默认打开页面
|
|
let index: Int = Settings[.selectedViewControllerIndex] ?? 0
|
|
self.setViewController(sectionViewController.viewControllers[index], for: .secondary)
|
|
self.setViewController(compactController, for: .compact)
|
|
}
|
|
}
|