### Installation via Agent Skill Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/README.md Instructions for installing the SymbolPicker skill for your CLI agent. ```APIDOC ## Installation - Agent Skill You can install the SymbolPicker skill for your CLI agent to get expert guidance on SymbolPicker directly in your terminal. ### Using skills.sh: ```bash npx skills add https://github.com/SzpakKamil/AgentSkills --skill SymbolPicker ``` ### Using ClawdHub: ```bash npx dlx clawdhub@latest install symbolpicker ``` ``` -------------------------------- ### Installation via Swift Package Manager Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/README.md Instructions for adding the SymbolPicker package to your project using Swift Package Manager. ```APIDOC ## Installation - Swift Package Manager Add `SymbolPicker` to your project via Swift Package Manager. The minimum version required is **1.0.0**. ### In `Package.swift`: ```swift dependencies: [ .package(url: "https://github.com/SzpakKamil/SymbolPicker.git", from: "1.0.0") ] ``` ### In Xcode: 1. Go to **File > Swift Packages > Add Package Dependency**. 2. Enter the URL: `https://github.com/SzpakKamil/SymbolPicker.git`. 3. Select version **1.0.0** or later. ``` -------------------------------- ### Basic SymbolPicker Usage in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/README.md Demonstrates a minimal setup for a functional symbol picker. Ensure SymbolPicker is imported and the necessary state variables are managed. ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var isPresented = false @State private var symbolName = "star.fill" var body: some View { Button(action: { isPresented = true }) { Image(systemName: symbolName) .resizable() .scaledToFit() .frame(width: 50, height: 50) } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName) .symbolPickerSymbolsStyle(.filled) .symbolPickerDismiss(type: .onSymbolSelect) } } ``` -------------------------------- ### Install SymbolPicker Skill via ClawdHub Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Getting Started/SetUp.md Use this command to add the SymbolPicker skill for your CLI agent using ClawdHub. ```bash npx dlx clawdhub@latest install symbolpicker ``` -------------------------------- ### Install SymbolPicker Skill via skills.sh Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Getting Started/SetUp.md Use this command to add the SymbolPicker skill for your CLI agent using skills.sh. ```bash npx skills add https://github.com/SzpakKamil/AgentSkills --skill SymbolPicker ``` -------------------------------- ### Basic SymbolPicker SwiftUI Integration Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Getting Started/SetUp.md A minimal example demonstrating how to use SymbolPicker in a SwiftUI view. This code presents an SF Symbol picker when a button is tapped and updates a state variable with the selected symbol name. ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var isPresented = false @State private var symbolName = "star.fill" var body: some View { Button{ isPresented = true } label: { Image(systemName: symbolName) .resizable() .scaledToFit() .frame(width: 50, height: 50) } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName) } } ``` -------------------------------- ### GET SymbolColor.id Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-id.md Retrieves the unique identifier for a SymbolColor case. ```APIDOC ## GET SymbolColor.id ### Description Returns a unique Double identifier for a SymbolColor case, allowing for use in SwiftUI lists or data models requiring Identifiable conformance. ### Response - **id** (Double) - A unique identifier ranging from 0 to 14 corresponding to the specific color case. ``` -------------------------------- ### Initialize a SymbolPicker Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init1.md Demonstrates basic usage of the SymbolPicker initializer with a state-managed symbol name. ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var symbol: String = "star.fill" var body: some View { SymbolPicker(symbolName: $symbol) } } ``` -------------------------------- ### Initialize SymbolPicker with RGBA color binding Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init7.md Demonstrates using the SymbolPicker with state bindings for presentation, symbol selection, and an RGBA color array. This initializer is deprecated in favor of newer alternatives. ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var isPresented = false @State private var symbol = "star.fill" @State private var color: [Double] = [1.0, 0.0, 0.0, 1.0] // Red var body: some View { Button("Pick Symbol") { isPresented = true } .sheet(isPresented: $isPresented) { SymbolPicker(isPresented: $isPresented, symbolName: $symbol, color: $color) } } } ``` -------------------------------- ### Initialize SymbolPicker with presentation binding Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init5.md Demonstrates using the SymbolPicker initializer with isPresented and symbolName bindings within a SwiftUI view. ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var isPresented = false @State private var symbol = "star.fill" var body: some View { Button("Pick Symbol") { isPresented = true } .sheet(isPresented: $isPresented) { SymbolPicker(isPresented: $isPresented, symbolName: $symbol) } } } ``` -------------------------------- ### Reference SymbolColor Enum and Custom Colors Source: https://context7.com/szpakkamil/symbolpicker/llms.txt Displays all predefined SymbolColor cases and demonstrates how to initialize a custom color. ```swift import SwiftUI import SymbolPicker struct SymbolColorReference: View { var body: some View { List { // Predefined colors available in SymbolColor.allCases ForEach(SymbolColor.allCases, id: \.id) { color in HStack { Circle() .fill(color.color) .frame(width: 30, height: 30) VStack(alignment: .leading) { Text(color.name) .font(.headline) // Access RGBA values let rgba = color.value Text("RGBA: [\(rgba[0], specifier: "%.2f"), \(rgba[1], specifier: "%.2f"), \(rgba[2], specifier: "%.2f"), \(rgba[3], specifier: "%.2f")]") .font(.caption) .foregroundStyle(.secondary) } } } // Custom color example Section("Custom Colors") { let customColor = SymbolColor.customColor( red: 0.5, green: 0.2, blue: 0.8, alpha: 1.0 ) HStack { Circle() .fill(customColor.color) .frame(width: 30, height: 30) Text("Custom Purple: \(customColor.name)") } } } } } // Available predefined colors: // .red, .orange, .yellow, .green, .mint, .teal, .cyan, // .blue, .indigo, .purple, .magenta, .pink, .grey, .moro, .brown // Plus: .customColor(red:green:blue:alpha:) ``` -------------------------------- ### Initialize SymbolPicker with Bindings Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init8.md Use this initializer to create a `SymbolPicker` that binds presentation state, selected symbol name, and symbol color. The color binding is optional and defaults to transparent if not provided. This initializer is deprecated. ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var isPresented = false @State private var symbol = "star.fill" @State private var color: SymbolColor = SymbolColor(1.0, 0.0, 0.0, 1.0) // Red var body: some View { Button("Pick Symbol") { isPresented = true } .sheet(isPresented: $isPresented) { SymbolPicker(isPresented: $isPresented, symbolName: $symbol, color: $color) } } } ``` -------------------------------- ### SymbolPicker Initializers Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker.md This section lists the various initializers available for the SymbolPicker view, allowing for different configurations of presentation state, symbol name, and color. ```APIDOC ## SymbolPicker Initializers ### Description Provides different ways to initialize the `SymbolPicker` view, allowing for customization of presentation, selected symbol, and color. ### Initializers - ``SymbolPicker/SymbolPicker/init(symbolName:)`` - ``SymbolPicker/SymbolPicker/init(symbolName:color:)-(_,Binding?)`` - ``SymbolPicker/SymbolPicker/init(symbolName:color:)-(_,Binding<[Double]>?)`` - ``SymbolPicker/SymbolPicker/init(symbolName:color:)-(_,Binding?)`` - ``SymbolPicker/SymbolPicker/init(isPresented:symbolName:)`` - ``SymbolPicker/SymbolPicker/init(isPresented:symbolName:color:)-(_,_,Binding?)`` - ``SymbolPicker/SymbolPicker/init(isPresented:symbolName:color:)-(_,_,Binding<[Double]>?)`` - ``SymbolPicker/SymbolPicker/init(isPresented:symbolName:color:)-(_,_,Binding?)`` ``` -------------------------------- ### Initialize SymbolPicker with Bindings Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init6.md Use this initializer to create a `SymbolPicker` that binds presentation, symbol name, and color to state variables. The color binding is optional and defaults to transparent if not provided. This is for legacy support on iOS 14.0+, macOS 11.0+, or visionOS 1.0+. ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var isPresented = false @State private var symbol = "star.fill" @State private var color: Color = .red var body: some View { Button("Pick Symbol") { isPresented = true } .sheet(isPresented: $isPresented) { SymbolPicker(isPresented: $isPresented, symbolName: $symbol, color: $color) } } } ``` -------------------------------- ### Apply SymbolColor.pink in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Pink.md Demonstrates how to use the SymbolColor.pink case to set the foreground color of a system image. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.pink var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### SymbolPicker Initializer Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init6.md Initializes a SymbolPicker with bindings to control presentation, the selected symbol name, and a SwiftUI Color. ```APIDOC ## SymbolPicker/SymbolPicker/init(isPresented:symbolName:color:)-(_,_,Binding?) ### Description This initializer creates a `SymbolPicker` view that binds the presentation state to `isPresented`, the selected SF Symbol name to `symbolName`, and the symbol’s color to a SwiftUI `Color` via `color`. The `color` binding is optional; if `nil`, the color defaults to transparent. The color is converted to a `SymbolColor` internally. This initializer is deprecated in favor of `init(symbolName:color:)-9y8z2`. Use this for legacy support on iOS 14.0+, macOS 11.0+, or visionOS 1.0+. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var isPresented = false @State private var symbol = "star.fill" @State private var color: Color = .red var body: some View { Button("Pick Symbol") { isPresented = true } .sheet(isPresented: $isPresented) { SymbolPicker(isPresented: $isPresented, symbolName: $symbol, color: $color) } } } ``` ### Response #### Success Response (200) This initializer does not return a value directly, but modifies the bound properties. #### Response Example None ``` -------------------------------- ### Apply SymbolColor.red in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Red.md Demonstrates how to use the SymbolColor.red case to set the foreground color of a system image. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.red var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### Define and use a custom color in SymbolPicker Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-CustomColor.md Demonstrates initializing a SymbolColor with custom RGBA values and applying it to a SwiftUI view. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let customColor = SymbolColor.customColor(red: 0.5, green: 0.2, blue: 0.8, alpha: 1.0) // Purple-like custom color var body: some View { Image(systemName: "star.fill") .foregroundColor(customColor.color) } } ``` -------------------------------- ### Apply SymbolColor.brown in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Brown.md Demonstrates how to use the SymbolColor.brown case to set the foreground color of a system image. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.brown var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### SwiftUI Symbol Gallery App with SymbolPicker Source: https://context7.com/szpakkamil/symbolpicker/llms.txt This code implements a complete SwiftUI app for managing a symbol gallery. It includes a data model for symbols, a list view with search and filtering capabilities, and integrates SymbolPicker for adding and customizing symbols. Use this as a template for building your own symbol management features. ```swift import SwiftUI import SymbolPicker // Data model for gallery items struct GallerySymbol: Identifiable, Equatable, Comparable { let id = UUID() var title: String = "" var symbolName: String = "car.fill" var color: SymbolColor = .red static func < (lhs: GallerySymbol, rhs: GallerySymbol) -> Bool { lhs.title < rhs.title } } struct SymbolGalleryApp: View { @State private var symbols: [GallerySymbol] = [] @State private var isPresented = false @State private var tempSymbol = GallerySymbol() @State private var searchText = "" // Filter symbols based on search var filteredSymbols: [GallerySymbol] { if searchText.isEmpty { return symbols.sorted() } else { return symbols.filter { $0.title.localizedStandardContains(searchText) }.sorted() } } var body: some View { NavigationStack { Group { if symbols.isEmpty { // Empty state ContentUnavailableView( "No Symbols Added", systemImage: "square.grid.2x2", description: Text("Tap + to add your first symbol") ) } else if filteredSymbols.isEmpty { // No search results ContentUnavailableView.search(text: searchText) } else { // Symbol grid List { ForEach(filteredSymbols) { symbol in HStack { Image(systemName: symbol.symbolName) .font(.title) .foregroundStyle(symbol.color.color) .frame(width: 44) VStack(alignment: .leading) { Text(symbol.title) .font(.headline) Text(symbol.symbolName) .font(.caption) .foregroundStyle(.secondary) } } } .onDelete { indexSet in // Map filtered indices back to original array let symbolsToDelete = indexSet.map { filteredSymbols[$0] } symbols.removeAll { symbolsToDelete.contains($0) } } } } } .navigationTitle("Symbol Gallery") .searchable(text: $searchText, prompt: "Search symbols") .toolbar { ToolbarItem(placement: .primaryAction) { Button { tempSymbol = GallerySymbol() isPresented = true } label: { Image(systemName: "plus") } } } // Symbol picker with all features .symbolPicker( isPresented: $isPresented, symbolName: $tempSymbol.symbolName, color: $tempSymbol.color ) .symbolPickerSymbolsStyle(.filled) .symbolPickerDismiss(type: .manual) { // Add symbol to gallery when picker closes tempSymbol.title = tempSymbol.symbolName symbols.append(tempSymbol) tempSymbol = GallerySymbol() } } } } ``` -------------------------------- ### SymbolPicker Initializer Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init7.md Initializes a SymbolPicker view with bindings for presentation state, symbol name, and RGBA color. ```APIDOC ## SymbolPicker(isPresented:symbolName:color:) ### Description Initializes a `SymbolPicker` view that binds the presentation state to `isPresented`, the selected SF Symbol name to `symbolName`, and the symbol’s color to an RGBA array via `color`. ### Parameters #### Parameters - **isPresented** (Binding) - Required - A binding controlling whether the picker is presented. - **symbolName** (Binding) - Required - A binding to the selected SF Symbol name. - **color** (Binding<[Double]>?) - Optional - An optional binding to an RGBA color array ([R, G, B, A]). ### Request Example ```swift SymbolPicker(isPresented: $isPresented, symbolName: $symbol, color: $color) ``` ``` -------------------------------- ### SymbolPicker(symbolName:color:) Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init2.md Initializes a SymbolPicker with bindings to the selected symbol name and a SwiftUI Color. ```APIDOC ## SymbolPicker(symbolName:color:) ### Description Initializes a `SymbolPicker` view that binds the selected SF Symbol name to `symbolName` and the symbol’s color to a SwiftUI `Color` via `color`. ### Parameters #### Path Parameters - **symbolName** (Binding) - Required - A binding to the selected SF Symbol name. - **color** (Binding?) - Optional - An optional binding to the symbol’s SwiftUI Color. ### Request Example ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var symbol: String = "star.fill" @State private var color: Color = .red var body: some View { SymbolPicker(symbolName: $symbol, color: $color) } } ``` ``` -------------------------------- ### Initialize SymbolPicker with SymbolColor Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init4.md Use this initializer to bind a SymbolPicker to a String for the symbol name and a SymbolColor for the color state. ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var symbol: String = "star.fill" @State private var color: SymbolColor = SymbolColor(1.0, 0.0, 0.0, 1.0) // Red var body: some View { SymbolPicker(symbolName: $symbol, color: $color) } } ``` -------------------------------- ### Apply SymbolColor.mint in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Mint.md Demonstrates using the mint color case within a SwiftUI view to set the foreground color of an image. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.mint var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### SymbolPicker(symbolName:color:) Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init3.md Initializes a SymbolPicker view with bindings to the selected SF Symbol name and an optional RGBA color array. ```APIDOC ## SymbolPicker(symbolName:color:) ### Description Initializes a `SymbolPicker` view that binds the selected SF Symbol name to `symbolName` and the symbol’s color to an RGBA array (`[Double]`) via `color`. The `color` binding is optional; if `nil`, the color defaults to transparent. ### Parameters #### Request Body - **symbolName** (Binding) - Required - A binding to the selected SF Symbol name. - **color** (Binding<[Double]?>) - Optional - An optional binding to an RGBA color array ([R, G, B, A]). ### Request Example ```swift @State private var symbol: String = "star.fill" @State private var color: [Double] = [1.0, 0.0, 0.0, 1.0] // Red SymbolPicker(symbolName: $symbol, color: $color) ``` ``` -------------------------------- ### Apply moro Color to SwiftUI Image Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Moro.md Demonstrates how to use the SymbolColor.moro case to set the foreground color of a SwiftUI Image. Ensure SymbolPicker is imported. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.moro var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### SymbolPicker(isPresented:symbolName:) Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init5.md Initializes a SymbolPicker view with bindings for presentation state and the selected SF Symbol name. ```APIDOC ## SymbolPicker(isPresented:symbolName:) ### Description Initializes a SymbolPicker view that binds the presentation state to `isPresented` and the selected SF Symbol name to `symbolName`. This initializer is deprecated in favor of `init(symbolName:)`. ### Parameters #### Request Body - **isPresented** (Binding) - Required - A binding controlling whether the picker is presented. - **symbolName** (Binding) - Required - A binding to the selected SF Symbol name. ### Request Example ```swift @State private var isPresented = false @State private var symbol = "star.fill" SymbolPicker(isPresented: $isPresented, symbolName: $symbol) ``` ``` -------------------------------- ### SymbolPicker Initializer Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init8.md Initializes a `SymbolPicker` with bindings to control presentation, the selected symbol name, and a `SymbolColor`. This initializer is deprecated in favor of `init(symbolName:color:)-3k7x9`. ```APIDOC ## SymbolPicker/SymbolPicker/init(isPresented:symbolName:color:)-(_,_,Binding?) ### Description Initializes a `SymbolPicker` with bindings to control presentation, the selected symbol name, and a `SymbolColor`. The `color` binding is optional; if `nil`, the color defaults to transparent. This initializer is deprecated in favor of `init(symbolName:color:)-3k7x9`. Use this for legacy support on iOS 14.0+, macOS 11.0+, or visionOS 1.0+. ### Method Initializer ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters Grid | Parameter Name | Type | Description | |----------------|------|-------------| | `isPresented` | `Binding` | A binding controlling whether the picker is presented. | | `symbolName` | `Binding` | A binding to the selected SF Symbol name. | | `color` | `Binding?` | An optional binding to the symbol’s `SymbolColor`. | ### Request Example ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var isPresented = false @State private var symbol = "star.fill" @State private var color: SymbolColor = SymbolColor(1.0, 0.0, 0.0, 1.0) // Red var body: some View { Button("Pick Symbol") { isPresented = true } .sheet(isPresented: $isPresented) { SymbolPicker(isPresented: $isPresented, symbolName: $symbol, color: $color) } } } ``` ### Response #### Success Response (200) This initializer does not return a value directly, but modifies the bound properties. #### Response Example None ``` -------------------------------- ### Apply Blue Color to Image - SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Blue.md Demonstrates how to use the SymbolColor.blue case to set the foreground color of a SwiftUI Image. Ensure SymbolPicker is imported. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.blue var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### SymbolPicker(symbolName:color:) Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init4.md Initializes a SymbolPicker view with bindings to the selected symbol name and an optional SymbolColor. ```APIDOC ## SymbolPicker(symbolName:color:) ### Description Initializes a `SymbolPicker` view that binds the selected SF Symbol name to `symbolName` and the symbol name to `color` as a `SymbolColor`. The `color` binding is optional; if `nil`, the color defaults to transparent. ### Parameters #### Request Body - **symbolName** (Binding) - Required - A binding to the selected SF Symbol name. - **color** (Binding?) - Optional - An optional binding to the symbol’s `SymbolColor`. ### Request Example ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var symbol: String = "star.fill" @State private var color: SymbolColor = SymbolColor(1.0, 0.0, 0.0, 1.0) // Red var body: some View { SymbolPicker(symbolName: $symbol, color: $color) } } ``` ``` -------------------------------- ### Apply Grey Color to SwiftUI Image Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Grey.md Demonstrates how to use the SymbolColor.grey case to set the foreground color of a SwiftUI Image. Ensure SymbolPicker is imported. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.grey var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### Color Options Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/README.md Details on supported color formats for SymbolPicker customization. ```APIDOC ## Color Options - Supports predefined `SymbolColor` values (e.g., `.red`, `.blue`, `.customColor(red:green:blue:alpha:)`) for consistent styling. - Allows `[Double]` for RGBA values, SwiftUI `Color`, or `SymbolColor.customColor(red:green:blue:alpha:)` for precise color customization. ``` -------------------------------- ### License Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/README.md Information about the license under which SymbolPicker is released. ```APIDOC ## License `SymbolPicker` is released under the MIT license. ``` -------------------------------- ### Initialize SymbolPicker with Color Binding Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Extension/SymbolPickerModifier-init[Double].md Attaches a symbol picker to a SwiftUI view, binding the symbol's name and its RGBA color values. Use this when managing color as raw RGBA doubles. The `color` parameter is optional and defaults to transparent if not provided. ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var symbolName = "star" @State private var isPresented = false @State private var color: [Double] = [0.490, 0.329, 0.729, 1.0] // Purple var body: some View { Button("Show Symbol Picker") { isPresented = true } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName, color: $color) .symbolPickerSymbolsStyle(.filled) } } ``` -------------------------------- ### SymbolPicker Initializer Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init1.md Initializes a SymbolPicker with a binding to the selected symbol name, without color customization. This is useful for simple symbol selection where color is not a concern. ```APIDOC ## SymbolPicker/SymbolPicker(symbolName:) ### Description Initializes a `SymbolPicker` with a binding to the selected symbol name, without color customization. This initializer is suitable for scenarios where only the symbol name needs to be selected and color options are not required. ### Method Initializer ### Endpoint N/A (SwiftUI View Initializer) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var symbol: String = "star.fill" var body: some View { SymbolPicker(symbolName: $symbol) } } ``` ### Response #### Success Response (N/A) This is an initializer for a SwiftUI View, it does not return a value in the traditional sense. It configures the `SymbolPicker` view. #### Response Example N/A ``` -------------------------------- ### Initialize SymbolPicker with RGBA Color Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init3.md Use this initializer to bind the selected SF Symbol name and an RGBA color array. The color is provided as an optional binding to an array of Doubles representing Red, Green, Blue, and Alpha. ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var symbol: String = "star.fill" @State private var color: [Double] = [1.0, 0.0, 0.0, 1.0] // Red var body: some View { SymbolPicker(symbolName: $symbol, color: $color) } } ``` -------------------------------- ### Use Cyan SymbolColor in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Cyan.md Demonstrates how to use the SymbolColor.cyan case to set the foreground color of an Image in SwiftUI. Ensure SymbolPicker is imported. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.cyan var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### Apply SymbolColor.teal in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Teal.md Demonstrates using the SymbolColor.teal case to set the foreground color of a system image. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.teal var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### Initialize SymbolPicker with SwiftUI Color Binding Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPicker/SymbolPicker-init2.md Use this initializer to bind the selected SF Symbol name and its color to SwiftUI's Color type. The color binding is optional; if nil, the color defaults to transparent. Ensure SymbolPicker is imported. ```swift import SwiftUI import SymbolPicker struct ExampleView: View { @State private var symbol: String = "star.fill" @State private var color: Color = .red var body: some View { SymbolPicker(symbolName: $symbol, color: $color) } } ``` -------------------------------- ### Add SymbolPicker via Swift Package Manager Source: https://context7.com/szpakkamil/symbolpicker/llms.txt Add the SymbolPicker package to your project using Swift Package Manager by specifying the Git URL and version. ```swift // Package.swift dependencies: [ .package(url: "https://github.com/SzpakKamil/SymbolPicker.git", from: "1.0.0") ] ``` -------------------------------- ### Using SymbolColor.orange in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Orange.md Demonstrates applying the orange SymbolColor to a system image within a SwiftUI view. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.orange var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### Requirements Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/README.md Minimum version requirements for various platforms and tools to use SymbolPicker. ```APIDOC ## Requirements - **iOS**: 14.0+ - **iPadOS**: 14.0+ - **macOS**: 11.0+ - **visionOS**: 1.0+ - **Swift**: 5.9+ - **Xcode**: 15.0+ ``` -------------------------------- ### Using SymbolColor.green in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Green.md Demonstrates how to use the SymbolColor.green case to set the foreground color of an Image view in SwiftUI. Ensure SymbolPicker is imported. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.green var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### Implement SymbolPicker with SymbolColor Source: https://context7.com/szpakkamil/symbolpicker/llms.txt Integrates the symbol picker with a state-managed color selection using the SymbolColor enum. ```swift import SwiftUI import SymbolPicker struct SymbolColorExample: View { @State private var isPresented = false @State private var symbolName = "folder.fill" @State private var symbolColor: SymbolColor = .blue var body: some View { VStack(spacing: 20) { // Use SymbolColor's color property Image(systemName: symbolName) .resizable() .scaledToFit() .frame(width: 80, height: 80) .foregroundStyle(symbolColor.color) Text("Color: \(symbolColor.name)") .font(.headline) Button("Change Symbol") { isPresented = true } } .padding() .symbolPicker( isPresented: $isPresented, symbolName: $symbolName, color: $symbolColor ) } } ``` -------------------------------- ### Add SymbolPicker dependency in Package.swift Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/README.md Include this dependency in your Package.swift file to integrate SymbolPicker into your project. ```swift dependencies: [ .package(url: "https://github.com/SzpakKamil/SymbolPicker.git", from: "1.0.0") ] ``` -------------------------------- ### Apply SymbolPicker Modifiers in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Modifiers/Modifiers.md Demonstrates the usage of .symbolPickerSymbolsStyle and .symbolPickerDismiss modifiers to configure a SymbolPicker instance. ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var isPresented = false @State private var symbolName = "star.fill" var body: some View { Button(action: { isPresented = true }) { Image(systemName: symbolName) .resizable() .scaledToFit() .frame(width: 50, height: 50) } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName) .symbolPickerSymbolsStyle(.outline) .symbolPickerDismiss(type: .dismissOnSymbolChange, action: { print("Symbol picker dismissed") }) } } ``` -------------------------------- ### Apply Outlined Symbol Style in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolPickerSymbolsStyle/SymbolPickerSymbolsStyle-Outlined.md Demonstrates applying the .outlined style to a SymbolPicker using the .symbolPickerSymbolsStyle modifier. ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var symbolName = "star" @State private var isPresented = true var body: some View { Button("Select Symbol") { isPresented.toggle() } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName) .symbolPickerSymbolsStyle(.outlined) } } ``` -------------------------------- ### SymbolPicker Initializer with Color Binding Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Extension/SymbolPickerModifier-initSymbolColor.md Initializes a SymbolPicker view modifier with bindings for presentation state, symbol name, and symbol color. ```APIDOC ## .symbolPicker(isPresented:symbolName:color:) ### Description Attaches a symbol picker to a SwiftUI view, allowing users to select an SF Symbol and bind its name to a `String` property, with an optional `SymbolColor` binding for the symbol’s color. ### Method View Modifier ### Endpoint N/A (SwiftUI View Modifier) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var symbolName = "star" @State private var isPresented = false @State private var color = SymbolColor.purple var body: some View { Button("Show Symbol Picker") { isPresented = true } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName, color: $color) .symbolPickerSymbolsStyle(.outlined) .symbolPickerDismiss(type: .onSymbolSelect) } } ``` ### Response #### Success Response (200) N/A (View Modifier) #### Response Example N/A (View Modifier) ``` -------------------------------- ### Implement SymbolPicker in a SwiftUI View Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Extension/SymbolPickerModifier-initNoColor.md Demonstrates attaching the symbolPicker modifier to a button to trigger the selection interface. ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var symbolName = "star" @State private var isPresented = false var body: some View { Button("Show Symbol Picker") { isPresented = true } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName) .symbolPickerSymbolsStyle(.filled) .symbolPickerDismiss(type: .manual) } } ``` -------------------------------- ### SymbolPicker with Different Color Types Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Extension/View.md Demonstrates how to use the `.symbolPicker` modifier with different types of color bindings: `SymbolColor`, `SwiftUI.Color`, and an array of `Double` for RGBA values. ```APIDOC ### Example Usage: With Different Color Types ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var symbolName = "star" @State private var isPresented = false @State private var symbolColor = SymbolColor.blue @State private var swiftUIColor: Color = .red @State private var doubleColor: [Double] = [0.490, 0.329, 0.729, 1.0] // Purple var body: some View { VStack { Button("Pick with SymbolColor") { isPresented = true } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName, color: $symbolColor) Button("Pick with SwiftUI Color") { isPresented = true } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName, color: $swiftUIColor) Button("Pick with Double Array") { isPresented = true } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName, color: $doubleColor) } } } ``` ``` -------------------------------- ### SymbolPicker with Custom Styling Modifiers Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Extension/View.md Shows how to apply additional modifiers like `.symbolPickerSymbolsStyle(_:)` and `.symbolPickerDismiss(type:action:)` to customize the appearance and dismissal behavior of the symbol picker. ```APIDOC ### Example Usage: With Custom Styling Modifiers ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var symbolName = "star" @State private var isPresented = false @State private var color = SymbolColor.purple var body: some View { Button("Show Symbol Picker") { isPresented = true } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName, color: $color) .symbolPickerSymbolsStyle(.outlined) .symbolPickerDismiss(type: .onSymbolSelect) } } ``` ``` -------------------------------- ### Advanced SymbolPicker Customization with Color Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/README.md Shows how to customize the symbol picker with color selection using RGBA values. The `color` parameter accepts an array of Doubles representing red, green, blue, and alpha. ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var isPresented = false @State private var symbolName = "car.fill" @State private var colorValues: [Double] = [0.906, 0.392, 0.416, 1.0] var body: some View { VStack { Image(systemName: symbolName) .foregroundStyle(Color( red: colorValues[0], green: colorValues[1], blue: colorValues[2], opacity: colorValues[3] )) .font(.system(size: 64)) Button("Select Symbol") { isPresented.toggle() } Text("Symbol: \(symbolName)") } .padding() .symbolPicker( isPresented: $isPresented, symbolName: $symbolName, color: $colorValues ) .symbolPickerSymbolsStyle(.filled) .symbolPickerDismiss(type: .onSymbolSelect) } } ``` -------------------------------- ### Import SymbolPicker Module in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Getting Started/SetUp.md Import the SymbolPicker module into your SwiftUI view to use its functionalities. Ensure your project is set up with Swift 5.9+. ```swift import SymbolPicker ``` -------------------------------- ### Apply SymbolColor.yellow in SwiftUI Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/SymbolColor/SymbolColor-Yellow.md Demonstrates using the yellow SymbolColor case to set the foreground color of a system image. ```swift import SwiftUI import SymbolPicker struct ContentView: View { let color = SymbolColor.yellow var body: some View { Image(systemName: "star.fill") .foregroundColor(color.color) } } ``` -------------------------------- ### Present SymbolPicker with Modifiers Source: https://github.com/szpakkamil/symbolpicker/blob/1.0/Sources/SymbolPicker/SymbolPicker.docc/Extension/Getting Started/AboutSymbolPicker.md Use the .symbolPicker modifier to present the SymbolPicker. Configure symbol style and dismissal behavior using chained modifiers. ```swift import SwiftUI import SymbolPicker struct ContentView: View { @State private var isPresented = false @State private var symbolName = "star.fill" var body: some View { Button(action: { isPresented = true }) { Image(systemName: symbolName) .resizable() .scaledToFit() .frame(width: 50, height: 50) } .symbolPicker(isPresented: $isPresented, symbolName: $symbolName) .symbolPickerSymbolsStyle(.filled) .symbolPickerDismiss(type: .dismissOnSymbolChange) } } ```