Tusker/Tusker/Screens/Main/MainTabBarViewController.swift

61 lines
1.8 KiB
Swift
Raw Normal View History

2018-08-21 21:17:25 +00:00
//
// MainTabBarViewController.swift
// Tusker
//
// Created by Shadowfactson 8/21/18.
// Copyright © 2018 Shadowfacts. All rights reserved.
//
import UIKit
class MainTabBarViewController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
2018-10-02 23:23:50 +00:00
let home = TimelineTableViewController.create(for: .home)
let federated = TimelineTableViewController.create(for: .public(local: false))
let local = TimelineTableViewController.create(for: .public(local: true))
let ownProfile = ProfileTableViewController.createForPending()
ownProfile.title = "My Profile"
let notifications = NotificationsTableViewController.create()
let preferences = PreferencesTableViewController.create()
2018-08-21 21:17:25 +00:00
viewControllers = [
2018-10-02 23:23:50 +00:00
navigationController(for: home),
navigationController(for: federated),
navigationController(for: local),
navigationController(for: ownProfile),
notifications,
preferences
2018-08-21 21:17:25 +00:00
]
2018-10-02 23:23:50 +00:00
2018-10-02 23:31:00 +00:00
MastodonController.getOwnAccount { (account) in
2018-10-02 23:23:50 +00:00
ownProfile.accountID = account.id
}
2018-08-21 21:17:25 +00:00
}
func navigationController(for vc: UIViewController) -> UINavigationController {
return UINavigationController(rootViewController: vc)
}
2018-08-21 21:17:25 +00:00
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
2018-08-31 02:30:19 +00:00
@IBAction func unwindToTabBarController(segue: UIStoryboardSegue) {
}
2018-08-21 21:17:25 +00:00
}