forked from shadowfacts/Tusker
Rename NewComposeHostingController to ComposeHostingController
This commit is contained in:
parent
afed157f29
commit
30449a2875
|
@ -276,7 +276,7 @@
|
||||||
D6BC9DD7232D7811002CA326 /* TimelinesPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BC9DD6232D7811002CA326 /* TimelinesPageViewController.swift */; };
|
D6BC9DD7232D7811002CA326 /* TimelinesPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BC9DD6232D7811002CA326 /* TimelinesPageViewController.swift */; };
|
||||||
D6BC9DDA232D8BE5002CA326 /* SearchResultsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BC9DD9232D8BE5002CA326 /* SearchResultsViewController.swift */; };
|
D6BC9DDA232D8BE5002CA326 /* SearchResultsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BC9DD9232D8BE5002CA326 /* SearchResultsViewController.swift */; };
|
||||||
D6BD395929B64426005FFD2B /* ComposeUI in Frameworks */ = {isa = PBXBuildFile; productRef = D6BD395829B64426005FFD2B /* ComposeUI */; };
|
D6BD395929B64426005FFD2B /* ComposeUI in Frameworks */ = {isa = PBXBuildFile; productRef = D6BD395829B64426005FFD2B /* ComposeUI */; };
|
||||||
D6BD395B29B64441005FFD2B /* NewComposeHostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BD395A29B64441005FFD2B /* NewComposeHostingController.swift */; };
|
D6BD395B29B64441005FFD2B /* ComposeHostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BD395A29B64441005FFD2B /* ComposeHostingController.swift */; };
|
||||||
D6BEA245291A0EDE002F4D01 /* Duckable in Frameworks */ = {isa = PBXBuildFile; productRef = D6BEA244291A0EDE002F4D01 /* Duckable */; };
|
D6BEA245291A0EDE002F4D01 /* Duckable in Frameworks */ = {isa = PBXBuildFile; productRef = D6BEA244291A0EDE002F4D01 /* Duckable */; };
|
||||||
D6BEA247291A0F2D002F4D01 /* Duckable+Root.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BEA246291A0F2D002F4D01 /* Duckable+Root.swift */; };
|
D6BEA247291A0F2D002F4D01 /* Duckable+Root.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BEA246291A0F2D002F4D01 /* Duckable+Root.swift */; };
|
||||||
D6BED174212667E900F02DA0 /* TimelineStatusTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BED173212667E900F02DA0 /* TimelineStatusTableViewCell.swift */; };
|
D6BED174212667E900F02DA0 /* TimelineStatusTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BED173212667E900F02DA0 /* TimelineStatusTableViewCell.swift */; };
|
||||||
|
@ -672,7 +672,7 @@
|
||||||
D6BC9DD6232D7811002CA326 /* TimelinesPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelinesPageViewController.swift; sourceTree = "<group>"; };
|
D6BC9DD6232D7811002CA326 /* TimelinesPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelinesPageViewController.swift; sourceTree = "<group>"; };
|
||||||
D6BC9DD9232D8BE5002CA326 /* SearchResultsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultsViewController.swift; sourceTree = "<group>"; };
|
D6BC9DD9232D8BE5002CA326 /* SearchResultsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultsViewController.swift; sourceTree = "<group>"; };
|
||||||
D6BD395729B6441F005FFD2B /* ComposeUI */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = ComposeUI; path = Packages/ComposeUI; sourceTree = "<group>"; };
|
D6BD395729B6441F005FFD2B /* ComposeUI */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = ComposeUI; path = Packages/ComposeUI; sourceTree = "<group>"; };
|
||||||
D6BD395A29B64441005FFD2B /* NewComposeHostingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewComposeHostingController.swift; sourceTree = "<group>"; };
|
D6BD395A29B64441005FFD2B /* ComposeHostingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposeHostingController.swift; sourceTree = "<group>"; };
|
||||||
D6BD395C29B789D5005FFD2B /* TuskerComponents */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = TuskerComponents; path = Packages/TuskerComponents; sourceTree = "<group>"; };
|
D6BD395C29B789D5005FFD2B /* TuskerComponents */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = TuskerComponents; path = Packages/TuskerComponents; sourceTree = "<group>"; };
|
||||||
D6BEA243291A0C83002F4D01 /* Duckable */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Duckable; path = Packages/Duckable; sourceTree = "<group>"; };
|
D6BEA243291A0C83002F4D01 /* Duckable */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Duckable; path = Packages/Duckable; sourceTree = "<group>"; };
|
||||||
D6BEA246291A0F2D002F4D01 /* Duckable+Root.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Duckable+Root.swift"; sourceTree = "<group>"; };
|
D6BEA246291A0F2D002F4D01 /* Duckable+Root.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Duckable+Root.swift"; sourceTree = "<group>"; };
|
||||||
|
@ -1089,7 +1089,7 @@
|
||||||
children = (
|
children = (
|
||||||
D68232F62464F4FD00325FB8 /* ComposeDrawingViewController.swift */,
|
D68232F62464F4FD00325FB8 /* ComposeDrawingViewController.swift */,
|
||||||
D62275A724F1CA2800B82A16 /* ComposeReplyContentView.swift */,
|
D62275A724F1CA2800B82A16 /* ComposeReplyContentView.swift */,
|
||||||
D6BD395A29B64441005FFD2B /* NewComposeHostingController.swift */,
|
D6BD395A29B64441005FFD2B /* ComposeHostingController.swift */,
|
||||||
);
|
);
|
||||||
path = Compose;
|
path = Compose;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -1923,7 +1923,7 @@
|
||||||
D6412B0324AFF6A600F5412E /* TabBarScrollableViewController.swift in Sources */,
|
D6412B0324AFF6A600F5412E /* TabBarScrollableViewController.swift in Sources */,
|
||||||
D6093FB725BE0CF3004811E6 /* TrendHistoryView.swift in Sources */,
|
D6093FB725BE0CF3004811E6 /* TrendHistoryView.swift in Sources */,
|
||||||
D6EBF01723C55E0D00AE061B /* UISceneSession+MastodonController.swift in Sources */,
|
D6EBF01723C55E0D00AE061B /* UISceneSession+MastodonController.swift in Sources */,
|
||||||
D6BD395B29B64441005FFD2B /* NewComposeHostingController.swift in Sources */,
|
D6BD395B29B64441005FFD2B /* ComposeHostingController.swift in Sources */,
|
||||||
D61F759229365C6C00C0B37F /* CollectionViewController.swift in Sources */,
|
D61F759229365C6C00C0B37F /* CollectionViewController.swift in Sources */,
|
||||||
D6DD996B2998611A0015C962 /* SuggestedProfilesViewController.swift in Sources */,
|
D6DD996B2998611A0015C962 /* SuggestedProfilesViewController.swift in Sources */,
|
||||||
D6DD8FFD298495A8002AD3FD /* LogoutService.swift in Sources */,
|
D6DD8FFD298495A8002AD3FD /* LogoutService.swift in Sources */,
|
||||||
|
|
|
@ -59,7 +59,7 @@ class ComposeSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDeleg
|
||||||
session.mastodonController = controller
|
session.mastodonController = controller
|
||||||
controller.initialize()
|
controller.initialize()
|
||||||
|
|
||||||
let composeVC = NewComposeHostingController(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)
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ class ComposeSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDeleg
|
||||||
|
|
||||||
if let window = window,
|
if let window = window,
|
||||||
let nav = window.rootViewController as? UINavigationController,
|
let nav = window.rootViewController as? UINavigationController,
|
||||||
let compose = nav.topViewController as? NewComposeHostingController {
|
let compose = nav.topViewController as? ComposeHostingController {
|
||||||
scene.userActivity = UserActivityManager.editDraftActivity(id: compose.controller.draft.id, accountID: scene.session.mastodonController!.accountInfo!.id)
|
scene.userActivity = UserActivityManager.editDraftActivity(id: compose.controller.draft.id, accountID: scene.session.mastodonController!.accountInfo!.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ class ComposeSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDeleg
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ComposeSceneDelegate: NewComposeHostingControllerDelegate {
|
extension ComposeSceneDelegate: ComposeHostingControllerDelegate {
|
||||||
func dismissCompose(mode: DismissMode) -> Bool {
|
func dismissCompose(mode: DismissMode) -> Bool {
|
||||||
let animation: UIWindowScene.DismissalAnimation
|
let animation: UIWindowScene.DismissalAnimation
|
||||||
switch mode {
|
switch mode {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// NewComposeHostingController.swift
|
// ComposeHostingController.swift
|
||||||
// Tusker
|
// Tusker
|
||||||
//
|
//
|
||||||
// Created by Shadowfacts on 3/6/23.
|
// Created by Shadowfacts on 3/6/23.
|
||||||
|
@ -15,13 +15,13 @@ import Pachyderm
|
||||||
import CoreData
|
import CoreData
|
||||||
import Duckable
|
import Duckable
|
||||||
|
|
||||||
protocol NewComposeHostingControllerDelegate: AnyObject {
|
protocol ComposeHostingControllerDelegate: AnyObject {
|
||||||
func dismissCompose(mode: DismissMode) -> Bool
|
func dismissCompose(mode: DismissMode) -> Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
class NewComposeHostingController: UIHostingController<NewComposeHostingController.View>, DuckableViewController {
|
class ComposeHostingController: UIHostingController<ComposeHostingController.View>, DuckableViewController {
|
||||||
|
|
||||||
weak var delegate: NewComposeHostingControllerDelegate?
|
weak var delegate: ComposeHostingControllerDelegate?
|
||||||
weak var duckableDelegate: DuckableViewControllerDelegate?
|
weak var duckableDelegate: DuckableViewControllerDelegate?
|
||||||
|
|
||||||
let controller: ComposeController
|
let controller: ComposeController
|
||||||
|
@ -200,7 +200,7 @@ extension MastodonController: ComposeMastodonContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension NewComposeHostingController: PHPickerViewControllerDelegate {
|
extension ComposeHostingController: PHPickerViewControllerDelegate {
|
||||||
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
|
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
|
||||||
dismiss(animated: true)
|
dismiss(animated: true)
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ extension NewComposeHostingController: PHPickerViewControllerDelegate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension NewComposeHostingController: ComposeDrawingViewControllerDelegate {
|
extension ComposeHostingController: ComposeDrawingViewControllerDelegate {
|
||||||
func composeDrawingViewControllerClose(_ drawingController: ComposeDrawingViewController) {
|
func composeDrawingViewControllerClose(_ drawingController: ComposeDrawingViewController) {
|
||||||
dismiss(animated: true)
|
dismiss(animated: true)
|
||||||
drawingCompletion = nil
|
drawingCompletion = nil
|
|
@ -14,7 +14,7 @@ import ComposeUI
|
||||||
extension DuckableContainerViewController: TuskerRootViewController {
|
extension DuckableContainerViewController: TuskerRootViewController {
|
||||||
func stateRestorationActivity() -> NSUserActivity? {
|
func stateRestorationActivity() -> NSUserActivity? {
|
||||||
var activity = (child as? TuskerRootViewController)?.stateRestorationActivity()
|
var activity = (child as? TuskerRootViewController)?.stateRestorationActivity()
|
||||||
if let compose = duckedViewController as? NewComposeHostingController,
|
if let compose = duckedViewController as? ComposeHostingController,
|
||||||
compose.controller.draft.hasContent {
|
compose.controller.draft.hasContent {
|
||||||
activity = UserActivityManager.addDuckedDraft(to: activity, draft: compose.controller.draft)
|
activity = UserActivityManager.addDuckedDraft(to: activity, draft: compose.controller.draft)
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,7 @@ extension MainTabBarViewController {
|
||||||
case .notifications:
|
case .notifications:
|
||||||
return NotificationsPageViewController(mastodonController: mastodonController)
|
return NotificationsPageViewController(mastodonController: mastodonController)
|
||||||
case .compose:
|
case .compose:
|
||||||
return NewComposeHostingController(draft: nil, mastodonController: mastodonController)
|
return ComposeHostingController(draft: nil, mastodonController: mastodonController)
|
||||||
case .explore:
|
case .explore:
|
||||||
return ExploreViewController(mastodonController: mastodonController)
|
return ExploreViewController(mastodonController: mastodonController)
|
||||||
case .myProfile:
|
case .myProfile:
|
||||||
|
@ -274,7 +274,7 @@ extension MainTabBarViewController: StateRestorableViewController {
|
||||||
func stateRestorationActivity() -> NSUserActivity? {
|
func stateRestorationActivity() -> NSUserActivity? {
|
||||||
var activity: NSUserActivity?
|
var activity: NSUserActivity?
|
||||||
if let presentedNav = presentedViewController as? UINavigationController,
|
if let presentedNav = presentedViewController as? UINavigationController,
|
||||||
let compose = presentedNav.viewControllers.first as? NewComposeHostingController {
|
let compose = presentedNav.viewControllers.first as? ComposeHostingController {
|
||||||
let draft = compose.controller.draft
|
let draft = compose.controller.draft
|
||||||
activity = UserActivityManager.editDraftActivity(id: draft.id, accountID: draft.accountID)
|
activity = UserActivityManager.editDraftActivity(id: draft.id, accountID: draft.accountID)
|
||||||
} else if let vc = (selectedViewController as! UINavigationController).topViewController as? StateRestorableViewController {
|
} else if let vc = (selectedViewController as! UINavigationController).topViewController as? StateRestorableViewController {
|
||||||
|
|
|
@ -98,7 +98,7 @@ extension TuskerNavigationDelegate {
|
||||||
options.preferredPresentationStyle = .prominent
|
options.preferredPresentationStyle = .prominent
|
||||||
UIApplication.shared.requestSceneSessionActivation(nil, userActivity: compose, options: options, errorHandler: nil)
|
UIApplication.shared.requestSceneSessionActivation(nil, userActivity: compose, options: options, errorHandler: nil)
|
||||||
} else {
|
} else {
|
||||||
let compose = NewComposeHostingController(draft: draft, mastodonController: apiController)
|
let compose = ComposeHostingController(draft: draft, mastodonController: apiController)
|
||||||
if #available(iOS 16.0, *),
|
if #available(iOS 16.0, *),
|
||||||
presentDuckable(compose, animated: animated, isDucked: isDucked) {
|
presentDuckable(compose, animated: animated, isDucked: isDucked) {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue