Tusker/Tusker/Screens/Main/MainTabBarViewController.swift

61 lines
1.8 KiB
Swift

//
// 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()
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()
viewControllers = [
navigationController(for: home),
navigationController(for: federated),
navigationController(for: local),
navigationController(for: ownProfile),
notifications,
preferences
]
MastodonController.getOwnAccount { (account) in
ownProfile.accountID = account.id
}
}
func navigationController(for vc: UIViewController) -> UINavigationController {
return UINavigationController(rootViewController: vc)
}
/*
// 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.
}
*/
@IBAction func unwindToTabBarController(segue: UIStoryboardSegue) {
}
}