.hideIf()

โฌ†๏ธ ้œ€่ฆ๏ผš .if(_:then:)

import SwiftUI

extension View {
    
    // view.hideIf(_:)
    @ViewBuilder
    public func hideIf(_ condition: @autoclosure () -> Bool) -> some View {
        self.if(condition()){ $0.hidden() }
    }
    
}

Last updated