Remove all iOS 14 specific components and workarounds and comply with SwiftUI 3. Signed-off-by: kingbri <bdashore3@proton.me>
43 lines
1.3 KiB
Swift
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 customScopeBar(_ content: @escaping () -> some View) -> some View {
|
|
modifier(CustomScopeBarModifier(scopeBarContent: content()))
|
|
}
|
|
|
|
func searchListener(isSearching: Binding<Bool>) -> some View {
|
|
modifier(SearchListenerModifier(isSearching: isSearching))
|
|
}
|
|
}
|