Backups in Ferrite archive a user's bookmarks, history, source lists, and source names. Sources are not archived due to the size of the backup increasing exponentially. These files use the .feb format to avoid JSON conflicts when opening the file in Ferrite. The backup file can be renamed to JSON for editing at any time. Add the Backport namespace to be used for ported features rather than making a file for every iOS 14 adaptation. Move history and bookmark creation to the PersistenceController rather than individual functions. Signed-off-by: kingbri <bdashore3@proton.me>
49 lines
1.5 KiB
Swift
49 lines
1.5 KiB
Swift
//
|
|
// View.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 8/15/22.
|
|
//
|
|
|
|
import Introspect
|
|
import SwiftUI
|
|
|
|
extension View {
|
|
// MARK: Custom introspect functions
|
|
|
|
func introspectCollectionView(customize: @escaping (UICollectionView) -> Void) -> some View {
|
|
inject(UIKitIntrospectionView(
|
|
selector: { introspectionView in
|
|
guard let viewHost = Introspect.findViewHost(from: introspectionView) else {
|
|
return nil
|
|
}
|
|
return Introspect.previousSibling(containing: UICollectionView.self, from: viewHost)
|
|
},
|
|
customize: customize
|
|
))
|
|
}
|
|
|
|
// MARK: Modifiers
|
|
|
|
func conditionalContextMenu<InternalContent: View, ID: Hashable>(id: ID,
|
|
@ViewBuilder _ internalContent: @escaping () -> InternalContent) -> some View
|
|
{
|
|
modifier(ConditionalContextMenu(internalContent, id: id))
|
|
}
|
|
|
|
func conditionalId<ID: Hashable>(_ id: ID) -> some View {
|
|
modifier(ConditionalId(id: id))
|
|
}
|
|
|
|
func disabledAppearance(_ disabled: Bool, dimmedOpacity: Double? = nil, animation: Animation? = nil) -> some View {
|
|
modifier(DisabledAppearance(disabled: disabled, dimmedOpacity: dimmedOpacity, animation: animation))
|
|
}
|
|
|
|
func disableInteraction(_ disabled: Bool) -> some View {
|
|
modifier(DisableInteraction(disabled: disabled))
|
|
}
|
|
|
|
func inlinedList() -> some View {
|
|
modifier(InlinedList())
|
|
}
|
|
}
|