Remove dead code found by Periphery on all platforms

Delete declarations that Periphery reports unused on every platform that
compiles them (iOS, macOS, tvOS), including nine views used only by their
own previews. Platform-gated code still used on another platform, device-
only MPV render paths, migration models, CloudKit record names, App
Intents metadata and unused parameters are kept.
This commit is contained in:
Arkadiusz Fal
2026-10-08 23:57:56 +02:00
parent 45e19e6536
commit 4770bbe3b9
141 changed files with 14 additions and 4191 deletions

View File

@@ -34,17 +34,4 @@ extension View {
falseTransform(self)
}
}
/// Conditionally applies a transformation when an optional value is present.
@ViewBuilder
func ifLet<T, Transform: View>(
_ value: T?,
transform: (Self, T) -> Transform
) -> some View {
if let value {
transform(self, value)
} else {
self
}
}
}

View File

@@ -106,45 +106,3 @@ extension View {
modifier(LiquidGlassSheetContentModifier(sourceID: sourceID, namespace: namespace))
}
}
// MARK: - ToolbarContent Extension
extension ToolbarContent {
/// Marks this toolbar content as the source for a Liquid Glass morphing sheet transition.
///
/// Apply this modifier to a `ToolbarItem` that presents a sheet. On iOS 26+,
/// the sheet will morph from this toolbar item when presented.
///
/// - Parameters:
/// - id: Unique identifier for the transition (must match the sheet content's sourceID).
/// - namespace: A namespace for the matched geometry effect.
///
/// Example:
/// ```swift
/// @Namespace private var sheetTransition
///
/// .toolbar {
/// ToolbarItem(placement: .primaryAction) {
/// Button { showSheet = true } label: {
/// Image(systemName: "gear")
/// }
/// }
/// .liquidGlassTransitionSource(id: "settings", in: sheetTransition)
/// }
/// ```
@ToolbarContentBuilder
func liquidGlassTransitionSource(
id: String,
in namespace: Namespace.ID
) -> some ToolbarContent {
#if os(iOS)
if #available(iOS 26, *) {
self.matchedTransitionSource(id: id, in: namespace)
} else {
self
}
#else
self
#endif
}
}

View File

@@ -159,21 +159,6 @@ extension View {
environment(\.zoomTransitionNamespace, namespace)
}
/// Injects the zoom transition namespace into the environment (optional overload).
///
/// If the namespace is nil, the view is returned unchanged.
///
/// - Parameter namespace: The optional namespace to use for matched transitions.
/// - Returns: A view with the namespace injected into the environment, or unchanged if nil.
@ViewBuilder
func zoomTransitionNamespace(_ namespace: Namespace.ID?) -> some View {
if let namespace {
environment(\.zoomTransitionNamespace, namespace)
} else {
self
}
}
/// Sets whether zoom transitions are enabled.
///
/// Apply this at a high level in the view hierarchy (e.g., ContentView) to control