mirror of
https://github.com/bitwarden/ios.git
synced 2025-12-11 04:34:55 -06:00
16 lines
358 B
Swift
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
|
|
}
|
|
}
|
|
}
|