Compare commits

..

5 Commits

7 changed files with 19 additions and 4 deletions

View File

@ -43,6 +43,9 @@ class AuxiliarySceneDelegate: UIResponder, UIWindowSceneDelegate {
let controller = MastodonController.getForAccount(account) let controller = MastodonController.getForAccount(account)
session.mastodonController = controller session.mastodonController = controller
controller.getOwnAccount()
controller.getOwnInstance()
guard let rootVC = viewController(for: activity, mastodonController: controller) else { guard let rootVC = viewController(for: activity, mastodonController: controller) else {
UIApplication.shared.requestSceneSessionDestruction(session, options: nil, errorHandler: nil) UIApplication.shared.requestSceneSessionDestruction(session, options: nil, errorHandler: nil)
return return

View File

@ -32,6 +32,9 @@ class ComposeSceneDelegate: UIResponder, UIWindowSceneDelegate {
let controller = MastodonController.getForAccount(account) let controller = MastodonController.getForAccount(account)
session.mastodonController = controller session.mastodonController = controller
controller.getOwnAccount()
controller.getOwnInstance()
let composeVC = ComposeHostingController(draft: draft, mastodonController: controller) let composeVC = ComposeHostingController(draft: draft, mastodonController: controller)
composeVC.delegate = self composeVC.delegate = self
let nav = EnhancedNavigationViewController(rootViewController: composeVC) let nav = EnhancedNavigationViewController(rootViewController: composeVC)

View File

@ -36,6 +36,7 @@ struct ComposeAttachmentsList: View {
} }
} }
.listRowInsets(EdgeInsets(top: cellPadding / 2, leading: cellPadding / 2, bottom: cellPadding / 2, trailing: cellPadding / 2)) .listRowInsets(EdgeInsets(top: cellPadding / 2, leading: cellPadding / 2, bottom: cellPadding / 2, trailing: cellPadding / 2))
.onDrag { NSItemProvider(object: attachment) }
} }
.onMove(perform: self.moveAttachments) .onMove(perform: self.moveAttachments)
.onDelete(perform: self.deleteAttachments) .onDelete(perform: self.deleteAttachments)

View File

@ -81,6 +81,7 @@ class MainSidebarViewController: UIViewController {
collectionView.backgroundColor = .clear collectionView.backgroundColor = .clear
collectionView.delegate = self collectionView.delegate = self
collectionView.dragDelegate = self collectionView.dragDelegate = self
collectionView.isSpringLoaded = true
view.addSubview(collectionView) view.addSubview(collectionView)
dataSource = createDataSource() dataSource = createDataSource()

View File

@ -139,8 +139,10 @@ extension MainSplitViewController: UISplitViewControllerDelegate {
// Transfer the nav stacks for all the sidebar items that map 1 <-> 1 with tabs // Transfer the nav stacks for all the sidebar items that map 1 <-> 1 with tabs
for tab in [MainTabBarViewController.Tab.timelines, .notifications, .myProfile] { for tab in [MainTabBarViewController.Tab.timelines, .notifications, .myProfile] {
let tabNav = tabBarViewController.viewController(for: tab) as! UINavigationController let tabNav = tabBarViewController.viewController(for: tab) as! UINavigationController
if tabNav.isViewLoaded {
transferNavigationStack(from: .tab(tab), to: tabNav) transferNavigationStack(from: .tab(tab), to: tabNav)
} }
}
// Since several sidebar items map to the single Explore tab, we only transfer the // Since several sidebar items map to the single Explore tab, we only transfer the
// navigation stack of the most-recently used one. // navigation stack of the most-recently used one.
@ -235,7 +237,8 @@ extension MainSplitViewController: UISplitViewControllerDelegate {
// For each sidebar item, transfer the existing navigation stasck from the tab bar controller to ourself. // For each sidebar item, transfer the existing navigation stasck from the tab bar controller to ourself.
var exploreItem: MainSidebarViewController.Item? var exploreItem: MainSidebarViewController.Item?
for tab in MainTabBarViewController.Tab.allCases { for tab in MainTabBarViewController.Tab.allCases {
guard let tabNavController = tabBarViewController.viewController(for: tab) as? UINavigationController else { continue } guard let tabNavController = tabBarViewController.viewController(for: tab) as? UINavigationController,
tabNavController.isViewLoaded else { continue }
let tabNavigationStack = tabNavController.viewControllers let tabNavigationStack = tabNavController.viewControllers
switch tab { switch tab {

View File

@ -70,6 +70,8 @@ class MainTabBarViewController: UITabBarController, UITabBarControllerDelegate {
let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(tabBarTapped)) let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(tabBarTapped))
tapRecognizer.cancelsTouchesInView = false tapRecognizer.cancelsTouchesInView = false
tabBar.addGestureRecognizer(tapRecognizer) tabBar.addGestureRecognizer(tapRecognizer)
tabBar.isSpringLoaded = true
} }
@objc private func tabBarTapped(_ recognizer: UITapGestureRecognizer) { @objc private func tabBarTapped(_ recognizer: UITapGestureRecognizer) {

View File

@ -78,8 +78,6 @@ class ProfileViewController: UIPageViewController {
} }
navigationItem.rightBarButtonItem = composeButton navigationItem.rightBarButtonItem = composeButton
userActivity = UserActivityManager.showProfileActivity(id: accountID!, accountID: mastodonController.accountInfo!.id)
headerView = ProfileHeaderView.create() headerView = ProfileHeaderView.create()
headerView.delegate = self headerView.delegate = self
@ -132,6 +130,10 @@ class ProfileViewController: UIPageViewController {
return return
} }
if let currentAccountID = mastodonController.accountInfo?.id {
userActivity = UserActivityManager.showProfileActivity(id: accountID, accountID: currentAccountID)
}
// Optionally invoke updateUI on headerView because viewDidLoad may not have been called yet // Optionally invoke updateUI on headerView because viewDidLoad may not have been called yet
headerView?.updateUI(for: accountID) headerView?.updateUI(for: accountID)
navigationItem.title = account.displayNameWithoutCustomEmoji navigationItem.title = account.displayNameWithoutCustomEmoji