Skip to content
RPRichard PruittTech & Cyber
Navigation
repo://simon-says-duo/MyApp/RetroClipScopeControl.swift

MyApp/RetroClipScopeControl.swift

803 B · 22 lines · swift · Download from the repository page

MyApp/RetroClipScopeControl.swift
import SwiftUI struct RetroClipScopeControl: View {    @Binding var selection: ClipScope    var body: some View {        ViewThatFits(in: .horizontal) {            HStack(spacing: 12) { choices }            VStack(alignment: .leading, spacing: 12) { choices }        }    }    @ViewBuilder private var choices: some View {        ForEach(ClipScope.allCases) { scope in            Button { selection = scope } label: {                Label(scope.rawValue, systemImage: selection == scope ? "checkmark.square.fill" : "square")                    .frame(maxWidth: .infinity)            }            .buttonStyle(RetroButtonStyle(color: selection == scope ? RetroTheme.yellow : RetroTheme.surface))            .accessibilityAddTraits(selection == scope ? .isSelected : [])        }    }}