diff --git a/Tusker.xcodeproj/project.pbxproj b/Tusker.xcodeproj/project.pbxproj index 1aa2e48379..5a80d835ae 100644 --- a/Tusker.xcodeproj/project.pbxproj +++ b/Tusker.xcodeproj/project.pbxproj @@ -169,6 +169,7 @@ D6BC9DB1232C61BC002CA326 /* NotificationsPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BC9DB0232C61BC002CA326 /* NotificationsPageViewController.swift */; }; D6BC9DB3232D4C07002CA326 /* WellnessPrefsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BC9DB2232D4C07002CA326 /* WellnessPrefsView.swift */; }; D6BC9DB5232D4CE3002CA326 /* NotificationsMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BC9DB4232D4CE3002CA326 /* NotificationsMode.swift */; }; + D6BC9DD7232D7811002CA326 /* TimelinesPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BC9DD6232D7811002CA326 /* TimelinesPageViewController.swift */; }; D6BED170212663DA00F02DA0 /* SwiftSoup.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D6BED16E212663DA00F02DA0 /* SwiftSoup.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D6BED174212667E900F02DA0 /* StatusTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BED173212667E900F02DA0 /* StatusTableViewCell.swift */; }; D6C693EF216192C2007D6A6D /* TuskerNavigationDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6C693EE216192C2007D6A6D /* TuskerNavigationDelegate.swift */; }; @@ -418,6 +419,7 @@ D6BC9DB0232C61BC002CA326 /* NotificationsPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsPageViewController.swift; sourceTree = ""; }; D6BC9DB2232D4C07002CA326 /* WellnessPrefsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WellnessPrefsView.swift; sourceTree = ""; }; D6BC9DB4232D4CE3002CA326 /* NotificationsMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsMode.swift; sourceTree = ""; }; + D6BC9DD6232D7811002CA326 /* TimelinesPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelinesPageViewController.swift; sourceTree = ""; }; D6BED16E212663DA00F02DA0 /* SwiftSoup.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftSoup.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D6BED173212667E900F02DA0 /* StatusTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusTableViewCell.swift; sourceTree = ""; }; D6C693EE216192C2007D6A6D /* TuskerNavigationDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TuskerNavigationDelegate.swift; sourceTree = ""; }; @@ -702,6 +704,7 @@ D641C781213DD7DD004B4513 /* Timeline */ = { isa = PBXGroup; children = ( + D6BC9DD6232D7811002CA326 /* TimelinesPageViewController.swift */, D6F953EB212519E700CF0F2B /* TimelineTableViewController.swift */, ); path = Timeline; @@ -1517,6 +1520,7 @@ 0411610022B442870030A9B7 /* AttachmentViewController.swift in Sources */, D62D2426217ABF63005076CC /* UserActivityType.swift in Sources */, D66362712136338600C9CBA2 /* ComposeViewController.swift in Sources */, + D6BC9DD7232D7811002CA326 /* TimelinesPageViewController.swift in Sources */, D6028B9B2150811100F223B9 /* MastodonCache.swift in Sources */, D6A3BC802321B7E600FD64D5 /* FollowNotificationGroupTableViewCell.swift in Sources */, D62D2422217AA7E1005076CC /* UserActivityManager.swift in Sources */, diff --git a/Tusker/Screens/Main/MainTabBarViewController.swift b/Tusker/Screens/Main/MainTabBarViewController.swift index dc36f2be0d..42dd828baa 100644 --- a/Tusker/Screens/Main/MainTabBarViewController.swift +++ b/Tusker/Screens/Main/MainTabBarViewController.swift @@ -16,10 +16,9 @@ class MainTabBarViewController: UITabBarController, UITabBarControllerDelegate { self.delegate = self viewControllers = [ - embedInNavigationController(TimelineTableViewController(for: .home)), + embedInNavigationController(TimelinesPageViewController()), embedInNavigationController(NotificationsPageViewController()), ComposeViewController(), - embedInNavigationController(TimelineTableViewController(for: .public(local: false))), embedInNavigationController(MyProfileTableViewController()), ] } diff --git a/Tusker/Screens/Timeline/TimelinesPageViewController.swift b/Tusker/Screens/Timeline/TimelinesPageViewController.swift new file mode 100644 index 0000000000..7fd95c3a46 --- /dev/null +++ b/Tusker/Screens/Timeline/TimelinesPageViewController.swift @@ -0,0 +1,45 @@ +// +// TimelinesPageViewController.swift +// Tusker +// +// Created by Shadowfacts on 9/14/19. +// Copyright © 2019 Shadowfacts. All rights reserved. +// + +import UIKit + +class TimelinesPageViewController: SegmentedPageViewController { + + private let homeTitle = NSLocalizedString("Home", comment: "home timeline tab title") + private let federatedTitle = NSLocalizedString("Federated", comment: "federated timeline tab title") + private let localTitle = NSLocalizedString("Local", comment: "local timeline tab title") + + init() { + let home = TimelineTableViewController(for: .home) + home.title = homeTitle + + let federated = TimelineTableViewController(for: .public(local: false)) + federated.title = federatedTitle + + let local = TimelineTableViewController(for: .public(local: true)) + local.title = localTitle + + super.init(titles: [ + homeTitle, + federatedTitle, + localTitle + ], pageControllers: [ + home, + federated, + local + ]) + + title = homeTitle + tabBarItem.image = UIImage(systemName: "house.fill") + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +}