view Simoleon/Helpers/ConditionalWrapper.swift @ 159:35628bac01f5

Fix a bug that selected wrong symbol in pair
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Sat, 28 Aug 2021 19:18:50 +0100
parents 75c1a05176f6
children
line wrap: on
line source

//
//  ConditionalWrapper.swift
//  Simoleon
//
//  Created by Dennis Concepción Martín on 19/07/2021.
//

import SwiftUI

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