Swiftpack.co - knoggl/CleanUI as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by knoggl.
knoggl/CleanUI 1.0.1
A SwiftUI / iOS framework.
⭐️ 0
🕓 3 days ago
iOS
.package(url: "https://github.com/knoggl/CleanUI.git", from: "1.0.1")

Swift Package Manager

Get this package with the Swift Package Manager

.package(url: "https://github.com/knoggl/CleanUI.git", .upToNextMinor(from: "1.0.0")),

What is CleanUI

CleanUI is a SwiftUI / iOS framework. CleanUI has many things build in to get you started to build your app. CleanUI is ripped out of the Knoggl iOS App to make a reusable framework, which can be worked on without directly changing things inside of the Knoggl iOS App. In other words, CleanUI is the heart of the Knoggl iOS App.

Live Preview

You can download the Knoggl-iOS App on the AppStore to have a very detailed preview with things CleanUI provides you.

What's inside

CleanUI has many default views from simple to complex. CleanUI allows to make huge changes in your app with as little code as possible.

How to use

CleanUI views have a CL prefix. CleanUI helper classes have a CU prefix.

Examples

Programmatic Navigation

NavigationView {
    Button(action: {
      CUNavigation.pushToSwiftUiView(YOUR_VIEW_HERE)
    }){
      Text("Push To SwiftUI View")
    }
    
    Button(action: {
      CUNavigation.popToRootView()
    }){
      Text("Pop to the Root View")
    }
    
    Button(action: {
      CUNavigation.pushBottomSheet(YOUR_VIEW_HERE)
    }){
      Text("Push to a Botton-Sheet")
    }
}

Custom NavigationBar

List {
    Text("Item")
}
.navigationBar("MyTitle")

// With a big title
List {
    Text("Item")
}
.navigationBar("MyTitle", bigTitle: true)

// With a NavigationSearchBar and trailing buttons

@StateObject var navigationSearchField: NavigationBarSearchField = NavigationBarSearchField()

List {
    Text("Item")
}
.navigationBar("MyTitle", bigTitle: true, buttons: AnyView(Group {
    Button(action: {
        // Action
    }, label: {
        CLIcon(systemImage: "plus")
    })
}), searchBar: navigationSearchField)

Alerts, Sheets and AlertMessages

CleanUI lets you create Alerts, Sheets and AlertMessages very easily.

To show a Alert from everywhere in code you can do this.

CUAlert.show(YOUR_VIEW_HERE)

// Clear all Alerts with
CUAlert.clearAll()

To show a Sheet from everywhere in code you can do this.

CUSheet.show(YOUR_VIEW_HERE)

// Clear all Sheets with
CUSheet.clearAll()

To show a AlertMessage from everywhere in code you can do this.

CUAlertMessage.show("HELOOOOO")
CUAlertMessage.show("HELOOOOO", subTitle: "WORLD")

// All styles `CLInfoCard.InfoCardType``
CUAlertMessage.show("HELOOOOO", type: .error)
CUAlertMessage.show("HELOOOOO", subTitle: "WORLD", type: .error)

CUAlertMessage.show("HELOOOOO", type: .success)
CUAlertMessage.show("HELOOOOO", subTitle: "WORLD", type: .success)

CUAlertMessage.show("HELOOOOO", type: .info)
CUAlertMessage.show("HELOOOOO", subTitle: "WORLD", type: .info)

GitHub

link
Stars: 0
Last commit: 3 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Dependencies

Release Notes

1.0.1
3 days ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics