mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Files
3a7cd29b221adc480bfc969dfcab6ebb82c8654d
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
|
|||
}
|
|||
}
|
|||
}
|