Skip to content

πŸ“‘ 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.

License

Notifications You must be signed in to change notification settings

GoodRequest/GoodSwiftUI

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

No packages published

Contributors 7

Languages