Skip to content

Instantly share code, notes, and snippets.

@alexl9412
alexl9412 / CustomFilterPickerView.swift
Last active October 30, 2025 12:20
Custom filter picker in SwiftUI based on the iOS Mail app
struct CustomFilterPickerView: View {
@State private var showPicker: Bool = false
@State private var selectedColor: Color? = nil
@State private var isFilterActive: Bool = false
@Namespace private var namespace
var colors: [Color] = [.red, .blue, .yellow, .green, .purple, .red, .blue, .yellow, .green, .purple]
var colorOptions: [Color] {