view LazyBear/Global functions/ConditionalModifier.swift @ 459:114e4e3d1c7a

Delete ColorTest.swift committer: GitHub <noreply@github.com>
author Dennis C. M. <dennis@denniscm.com>
date Mon, 28 Jun 2021 16:32:19 +0200
parents 417148200aaf
children
line wrap: on
line source

//
//  ConditionalModifier.swift
//  LazyBear
//
//  Created by Dennis Concepción Martín on 20/6/21.
//

import SwiftUI

extension View {
   @ViewBuilder
   func `if`<Content: View>(_ conditional: Bool, content: (Self) -> Content) -> some View {
        if conditional {
            content(self)
        } else {
            self
        }
    }
}