Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GoodRequest/GoodSwiftUI

Open more actions menu

Repository files navigation

GoodSwiftUI

iOS Version Swift Version Supported devices Contains Test Dependency Manager

A collection of useful and frequently used SwiftUI components for iOS development, including:

  • GRButton - Customizable buttons with loading states and icons
  • GRInputField - Advanced input fields with validation
  • GRToggle - Custom toggles, checkboxes, and radio buttons
  • GRAsyncImage - Async image loading with caching
  • ReadableContentWidth - Content width constraints for better readability

Designed to help developers build consistent, accessible, and production-ready UIs faster.

Installation

Swift Package Manager

Xcode (Recommended)

  1. Open your project in Xcode
  2. Go to File → Add Packages...
  3. Enter the repository URL: https://github.com/GoodRequest/GoodSwiftUI
  4. Select the version and add the package

Package.swift

import PackageDescription

let package = Package(
    name: "YourProject",
    dependencies: [
        .package(url: "https://github.com/GoodRequest/GoodSwiftUI", from: "1.0.0")
    ],
    targets: [
        .target(
            name: "YourTarget",
            dependencies: [
                .product(name: "GoodSwiftUI", package: "GoodSwiftUI"),
            ]
        )
    ]
)

Quick Start

import SwiftUI
import GRButton
import GRInputField

@main
struct MyApp: App {
    init() {
        InputFieldView.configureAppearance()
    }
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

struct ContentView: View {
    @State private var email = ""
    
    var body: some View {
        VStack(spacing: 20) {
            InputField(text: $email, title: "Email", placeholder: "email@example.com")
            
            Button("Submit") { }
                .buttonStyle(GRButtonStyle(appearance: .primary, size: .large(stretch: false)))
        }
        .padding()
    }
}

Documentation

📖 For Developers

Usage Guide - Complete documentation with examples for all components:

  • Installation and setup
  • Component examples (GRButton, GRInputField, GRToggle, GRAsyncImage)
  • Helper patterns to reduce cognitive load
  • Best practices and accessibility
  • SwiftUI property mapping

🤖 For AI Assistants

AI Usage Rules - Structured rules for AI coding assistants:

  • Development speed optimizations
  • When to use library vs native SwiftUI
  • Copy-paste templates and patterns
  • Progressive complexity levels
  • Cognitive load reduction strategies

Components

  • GRButton - Buttons with loading states, icons, and custom appearances
  • GRInputField - Input fields with validation, formatting, and accessibility
  • GRToggle - Switches, checkboxes, and radio buttons
  • GRAsyncImage - Async image loading with caching
  • ReadableContentWidth - Content width constraints for iPad

Sample Project

Explore the GoodSwiftUI-Sample directory for complete examples and snapshot tests.

License

GoodSwiftUI is released under the MIT license. See LICENSE for details.

About

📑 GoodSwiftUI is a comprehensive library filled with reusable SwiftUI snippets for faster and more efficient iOS development. This library offers a wide range of customizable UI components, designed to boost your productivity and streamline your development workflow. Save time and effort by leveraging pre-made, tested, and ready-to-use code.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.