ios/BitwardenWatchApp/Utilities/ViewExtensions.swift
2025-10-06 15:18:35 -05:00

16 lines
358 B
Swift

import Foundation
import SwiftUI
extension View {
func placeholder<Content: View>(
when shouldShow: Bool,
alignment: Alignment = .leading,
@ViewBuilder placeholder: () -> Content,
) -> some View {
ZStack(alignment: alignment) {
placeholder().opacity(shouldShow ? 1 : 0)
self
}
}
}