A Swift library for documenting, isolating, and testing SwiftUI, UIKIt & AppKit components.

Overview

alt text

A Swift library for documenting, isolating, and testing SwiftUI, UIKit & AppKit components.

Swift Mac OS IOS Tests

Minimal Example

An example demonstrated with the Slider ui element.

// Create a "doc" that conforms to View.
struct SliderDoc: View {
    @State private var value: Double = 0.0
    
    // Use the markup components provided with SwiftBook to 
    // describe your components.
    //
    // Wrap your component in `SwiftBookComponent` to get the snapshot
    // testing and more.
    var body: some View {
        H1("Slider")
        P("A Slider element provided by Apple for SwiftUI.")
        SwiftBookComponent {
            Slider(value: $value)
        }
        
    }
}

// Add your "doc" to the SwiftBook documents table.
struct ContentView: View {
    var body: some View {
        SwiftBook([
            ("Slider", AnyView(SliderDoc())),
        ])
    }
}

An example demonstrating the "controls" provided with SwiftBook

struct CircleView: View {
    let color: Color
    let label: String
    let labelColor: Color
    
    var body: some View {
        ZStack {
            Circle()
                .frame(width: 300, height: 300, alignment: .center)
                .foregroundColor(color)
            Text(label)
                .foregroundColor(labelColor)
                .font(.headline)
        }
    }
}

struct CircleDoc: View {
    @State private var color: Color = .red
    @State private var label: String = "Red Circle"
    @State private var labelColor: Color = .primary

    var body: some View {
        H2("A red circle")
        H3("This is a description of a red circle.")
        SwiftBookComponent {
            CircleView(color: color, label: label, labelColor: labelColor)
        }
        SwiftBookControlTable {
            SwiftBookControlColor(color: $color, title: "color")
            SwiftBookControlColor(color: $labelColor, title: "labelColor")
            SwiftBookControlText(text: $label, label: "label")
        }
    }
}

Full example app at https://github.com/hpennington/shapes.git

You might also like...
Adventures-with-Swift - Building Native iOS Apps with UIKit and SiwftUI  
Adventures-with-Swift - Building Native iOS Apps with UIKit and SiwftUI 

Adventures with Swift, UIKit, & SwiftUI As I have experience working with React Native and have dabbled a bit with Flutter, I've decided to dive in th

Restaurant App iOs swift Uikit

Restaurant-App Restaurant App iOs swift Uikit if you want to use this app first install CocoPods $ sudo gem install cocopods and then use this comman

🎬 Netflix Clone 🔥 Made using UIKit with Swift language.
🎬 Netflix Clone 🔥 Made using UIKit with Swift language.

Made using UIKit with Swift language. Core Data was used as the local database. Tmdb and youtube api were used for the API.

Swift UIKit E-Commerce (UgurShopping)  No StoryBoard   Firebase, FireStore, FirebaseAuth, KingFisher, SwiftEntryKit, ProgressHud, Alamofire UICollectionViewCompositionalLayout, NotificationCenter
Swift UIKit E-Commerce (UgurShopping) No StoryBoard Firebase, FireStore, FirebaseAuth, KingFisher, SwiftEntryKit, ProgressHud, Alamofire UICollectionViewCompositionalLayout, NotificationCenter

Swift UIKit E-Commerce (UgurShopping) No StoryBoard Firebase, FireStore, FirebaseAuth, KingFisher, SwiftEntryKit, ProgressHud, Alamofire UICollectionViewCompositionalLayout, NotificationCenter

UIKit (MVC), Weather App
UIKit (MVC), Weather App

Weather Simple weather app written on UIKit (MVC) Was used • UITableView • CoreLocation • Lottie Animations • OpenWeatherMap (API) • Author of animate

 Quotes App - quotes browsing app which is built with Quotable Free API completely in UIKit
Quotes App - quotes browsing app which is built with Quotable Free API completely in UIKit

Quotes App is quotes browsing app which is built with Quotable Free API completely in UIKit

A package that allows you to easily enable the Xcode canvas to a UIKit view.
A package that allows you to easily enable the Xcode canvas to a UIKit view.

UIViewCanvas This package allows you to enable a SwiftUI Xcode canva to a UIView or a entire ViewController. Why? Run emulator everytime you need to t

In this mini app covered the concepts like basics of SwiftUI and Navigations and Animations and List with CRUD functions and MVVM and App Launch and App icons adding and also applied persistence using UserDefaults Concept.
In this mini app covered the concepts like basics of SwiftUI and Navigations and Animations and List with CRUD functions and MVVM and App Launch and App icons adding and also applied persistence using UserDefaults Concept.

TodoList In this application used the concepts from the beginner level project of SwiftUI_Evolve_1 The following concepts covered in this mini app Swi

Owner
Hayden Pennington
iOS | Full stack web engineer
Hayden Pennington
Introspect underlying UIKit components from SwiftUI

Introspect for SwiftUI Introspect allows you to get the underlying UIKit or AppKit element of a SwiftUI view. For instance, with Introspect you can ac

Siteline 3.7k Jan 4, 2023
NeoPop is CRED's inbuilt library for using NeoPop components in your app

NeoPOP NeoPOP is CRED's inbuilt library for using NeoPOP components in your app. What really is NeoPOP? NeoPOP was created with one simple goal; to cr

CRED 125 Dec 29, 2022
A SwiftUI system components and interactions demo app

SwiftUI Kit A SwiftUI system components and interactions demo app based on iOS 14, macOS Big Sur, watchOS 7, and tvOS 14. Use the SwiftUI Kit app to s

Jordan Singer 2k Jan 6, 2023
A collection of missing SwiftUI components

SwiftUIKit A collection of components that will simplify and accelerate your iOS development. Components CurrencyTextField AdaptToKeyboard (not needed

youjinp 239 Nov 18, 2022
A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind

A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.

donggyu 3 Jun 10, 2022
SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testing, and more.

Articles related to this project Clean Architecture for SwiftUI Programmatic navigation in SwiftUI project Separation of Concerns in Software Design C

Alexey Naumov 4k Jan 8, 2023
A collection of Swift functions, extensions, and SwiftUI and UIKit Views.

J's Helper A collection of Swift functions, extensions, and SwiftUI and UIKit Views. Legend: ?? UIKit ?? SwiftUI ?? Shared Installation In XCode 12 go

Jem Alvarez 3 Oct 1, 2022
content for Using Combine - notes on learning Combine with UIKit and SwiftUI

SwiftUI-Notes A collection of notes, project pieces, playgrounds and ideas on learning and using SwiftUI and Combine. Changes, corrections, and feedba

Joseph Heck 1.7k Dec 27, 2022
Movie Database app made with SwiftUI and UIKit

HW4_DogukaanKilicarslan Movie Data Base App made with SwiftUI Movie Database app made with SwiftUI Preview Movie Data Base App : Star Wars Characters

null 1 Oct 20, 2021
Porting the example app from our Advanced iOS App Architecture book from UIKit to SwiftUI.

SwiftUI example app: Koober We're porting the example app from our Advanced iOS App Architecture book from UIKit to SwiftUI and we are sharing the cod

raywenderlich 55 Dec 19, 2022