mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-13 16:53:29 +01:00
Files
026392dbc7a5454a39b9287f469d32b5e6768bb8
23 lines
473 B
Swift
23 lines
473 B
Swift
//
|
|||
// View+Hidden.swift
|
|||
// SideStore
|
|||
//
|
|||
// Created by naturecodevoid on 2/18/23.
|
|||
// Copyright © 2023 SideStore. All rights reserved.
|
|||
//
|
|||
|
|||
import SwiftUI
|
|||
|
|||
// https://stackoverflow.com/a/59228385 (modified)
|
|||
extension View {
|
|||
@ViewBuilder func isHidden(_ hidden: Binding<Bool>, remove: Bool = false) -> some View {
|
|||
if hidden.wrappedValue {
|
|||
if !remove {
|
|||
self.hidden()
|
|||
}
|
|||
} else {
|
|||
self
|
|||
}
|
|||
}
|
|||
}
|