Ferrite-backup/Ferrite/Extensions/View.swift
kingbri 254058928f Library: Fix debrid cloud fetch in iOS 14
onAppear wasn't being called with the current implementation of the
cloud tab in library. Fix this to listen to the selectedDebridType
variable instead of relying on the onAppear call of a view.y

Also do some further project cleanup and LOC removal

Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-23 11:04:30 -04:00

43 lines
1.3 KiB
Swift

//
// View.swift
// Ferrite
//
// Created by Brian Dashore on 8/15/22.
//
import Introspect
import SwiftUI
extension View {
// MARK: Modifiers
func conditionalContextMenu(id: some Hashable,
@ViewBuilder _ internalContent: @escaping () -> some View) -> some View
{
modifier(ConditionalContextMenuModifier(internalContent, id: id))
}
func conditionalId(_ id: some Hashable) -> some View {
modifier(ConditionalIdModifier(id: id))
}
func disabledAppearance(_ disabled: Bool, dimmedOpacity: Double? = nil, animation: Animation? = nil) -> some View {
modifier(DisabledAppearanceModifier(disabled: disabled, dimmedOpacity: dimmedOpacity, animation: animation))
}
func disableInteraction(_ disabled: Bool) -> some View {
modifier(DisableInteractionModifier(disabled: disabled))
}
func inlinedList(inset: CGFloat) -> some View {
modifier(InlinedListModifier(inset: inset))
}
func viewDidAppear(_ callback: @escaping () -> Void) -> some View {
modifier(ViewDidAppearModifier(callback: callback))
}
func customScopeBar(_ content: @escaping () -> some View) -> some View {
modifier(CustomScopeBarModifier(scopeBarContent: content()))
}
}