mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
53 lines
1.3 KiB
Swift
53 lines
1.3 KiB
Swift
//
|
|
// TabBarController.swift
|
|
// AltStore
|
|
//
|
|
// Created by Riley Testut on 9/19/19.
|
|
// Copyright © 2019 Riley Testut. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
extension TabBarController
|
|
{
|
|
private enum Tab: Int, CaseIterable
|
|
{
|
|
case news
|
|
case browse
|
|
case myApps
|
|
case settings
|
|
}
|
|
}
|
|
|
|
class TabBarController: UITabBarController
|
|
{
|
|
required init?(coder aDecoder: NSCoder)
|
|
{
|
|
super.init(coder: aDecoder)
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(TabBarController.openPatreonSettings(_:)), name: AppDelegate.openPatreonSettingsDeepLinkNotification, object: nil)
|
|
NotificationCenter.default.addObserver(self, selector: #selector(TabBarController.importApp(_:)), name: AppDelegate.importAppDeepLinkNotification, object: nil)
|
|
}
|
|
}
|
|
|
|
extension TabBarController
|
|
{
|
|
@objc func presentSources(_ sender: Any)
|
|
{
|
|
self.performSegue(withIdentifier: "presentSources", sender: sender)
|
|
}
|
|
}
|
|
|
|
private extension TabBarController
|
|
{
|
|
@objc func openPatreonSettings(_ notification: Notification)
|
|
{
|
|
self.selectedIndex = Tab.settings.rawValue
|
|
}
|
|
|
|
@objc func importApp(_ notification: Notification)
|
|
{
|
|
self.selectedIndex = Tab.myApps.rawValue
|
|
}
|
|
}
|