You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
596 B
26 lines
596 B
//
|
|
// TabItemModifier.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Razmig Sarkissian on 02/04/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct TabItemModifier: ViewModifier {
|
|
let tabDestination: TabDestination
|
|
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.tabItem {
|
|
Label(tabDestination.title, systemImage: tabDestination.image)
|
|
}
|
|
.tag(tabDestination as TabDestination?)
|
|
}
|
|
}
|
|
|
|
extension View {
|
|
func tabItem(for tabDestination: TabDestination) -> some View {
|
|
modifier(TabItemModifier(tabDestination: tabDestination))
|
|
}
|
|
}
|
|
|