diff --git a/Tusker/Preferences/StatusSwipeActions.swift b/Tusker/Preferences/StatusSwipeActions.swift index 2dd1641e..6bfe6b00 100644 --- a/Tusker/Preferences/StatusSwipeActions.swift +++ b/Tusker/Preferences/StatusSwipeActions.swift @@ -34,7 +34,6 @@ extension StatusSwipeAction { protocol StatusSwipeActionContainer: UIView { var mastodonController: MastodonController! { get } var navigationDelegate: any TuskerNavigationDelegate { get } - var toastableViewController: ToastableViewController? { get } var canReblog: Bool { get } diff --git a/Tusker/Screens/Preferences/PreferencesView.swift b/Tusker/Screens/Preferences/PreferencesView.swift index 8e4ed3de..873e316d 100644 --- a/Tusker/Screens/Preferences/PreferencesView.swift +++ b/Tusker/Screens/Preferences/PreferencesView.swift @@ -108,7 +108,12 @@ struct PreferencesView: View { PreferenceSectionLabel(title: "Composing", systemImageName: "pencil", backgroundColor: .blue) } NavigationLink(destination: WellnessPrefsView()) { - PreferenceSectionLabel(title: "Digital Wellness", systemImageName: "brain.fill", backgroundColor: .purple) + let brainImageName = if #available(iOS 17.0, *) { + "brain.fill" + } else { + "brain" + } + PreferenceSectionLabel(title: "Digital Wellness", systemImageName: brainImageName, backgroundColor: .purple) } NavigationLink(destination: AdvancedPrefsView()) { PreferenceSectionLabel(title: "Advanced", systemImageName: "gearshape.2.fill", backgroundColor: .gray) diff --git a/Tusker/Screens/Utilities/Previewing.swift b/Tusker/Screens/Utilities/Previewing.swift index 39695bb0..8e9c90d5 100644 --- a/Tusker/Screens/Utilities/Previewing.swift +++ b/Tusker/Screens/Utilities/Previewing.swift @@ -15,7 +15,6 @@ import SwiftUI @MainActor protocol MenuActionProvider: AnyObject { var navigationDelegate: TuskerNavigationDelegate? { get } - var toastableViewController: ToastableViewController? { get } } @MainActor @@ -34,10 +33,6 @@ extension MenuActionProvider where Self: TuskerNavigationDelegate { var navigationDelegate: TuskerNavigationDelegate? { self } } -extension MenuActionProvider where Self: ToastableViewController { - var toastableViewController: ToastableViewController? { self } -} - extension MenuActionProvider { private var mastodonController: MastodonController? { navigationDelegate?.apiController } @@ -459,7 +454,7 @@ extension MenuActionProvider { } private func handleSuccess(title: String) { - if let toastable = self.toastableViewController { + if let toastable = self.navigationDelegate { var config = ToastConfiguration(title: title) config.systemImageName = "checkmark" config.dismissAutomaticallyAfter = 2 diff --git a/Tusker/Views/ContentTextView.swift b/Tusker/Views/ContentTextView.swift index 6b59857e..a138b0cc 100644 --- a/Tusker/Views/ContentTextView.swift +++ b/Tusker/Views/ContentTextView.swift @@ -267,10 +267,6 @@ extension ContentTextView: UITextViewDelegate { } extension ContentTextView: MenuActionProvider { - var toastableViewController: ToastableViewController? { - // todo: pass this down through the text view - nil - } } extension ContentTextView: UIContextMenuInteractionDelegate { diff --git a/Tusker/Views/Profile Header/ProfileFieldValueView.swift b/Tusker/Views/Profile Header/ProfileFieldValueView.swift index c535f6b3..e2f613dc 100644 --- a/Tusker/Views/Profile Header/ProfileFieldValueView.swift +++ b/Tusker/Views/Profile Header/ProfileFieldValueView.swift @@ -170,10 +170,6 @@ class ProfileFieldValueView: UIView { } extension ProfileFieldValueView: UIContextMenuInteractionDelegate, MenuActionProvider { - var toastableViewController: ToastableViewController? { - navigationDelegate - } - func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? { guard let (hashtag, url) = getHashtagOrURL(), let navigationDelegate else { diff --git a/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift b/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift index e2d32b85..0d00269c 100644 --- a/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift +++ b/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift @@ -945,7 +945,6 @@ extension TimelineStatusCollectionViewCell: UIPointerInteractionDelegate { extension TimelineStatusCollectionViewCell: StatusSwipeActionContainer { var navigationDelegate: TuskerNavigationDelegate { delegate! } - var toastableViewController: ToastableViewController? { delegate } var canReblog: Bool { reblogButton.isEnabled