Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangerhards committed Mar 15, 2022
1 parent 2766880 commit 0f6968e
Showing 1 changed file with 7 additions and 105 deletions.
112 changes: 7 additions & 105 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,20 @@
# Swift Package Manager
Get this package with the Swift Package Manager
```swift
.package(url: "https://github.com/knoggl/CleanUI.git", .upToNextMinor(from: "1.0.0")),
```
### [CleanUI Documentation](https://knoggl.github.io/CleanUI/documentation/cleanui)

# 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](https://github.com/knoggl/Knoggl-iOS) to make a reusable framework, which can be worked on without directly changing things inside of the [Knoggl iOS App](https://github.com/knoggl/Knoggl-iOS). In other words, CleanUI is the heart of the [Knoggl iOS App](https://github.com/knoggl/Knoggl-iOS).

# Live Preview
You can download the Knoggl-iOS App on the [AppStore](https://apps.apple.com/de/app/knoggl/id1570411915) to have a very detailed preview with things CleanUI provides you.

# What's inside
# 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
# How To Use
CleanUI views have a ``CL`` prefix. CleanUI helper classes have a ``CU`` prefix.

# Examples
# Building The Documentation

### Programmatic Navigation
```swift
NavigationView {
Button(action: {
CUNavigation.pushToSwiftUiView(YOUR_VIEW_HERE)
}){
Text("Push To SwiftUI view")
}

Button(action: {
CUNavigation.pushToSwiftUiView(YOUR_VIEW_HERE, enableBackNavigation: false)
}){
Text("Push To SwiftUI view and disbale swipe right to go back gesture")
}

Button(action: {
CUNavigation.pop()
}){
Text("Pop to previous view")
}

Button(action: {
CUNavigation.popToRootView()
}){
Text("Pop to the Root View")
}

Button(action: {
CUNavigation.pushBottomSheet(YOUR_VIEW_HERE)
}){
Text("Push to a Bottom-Sheet")
}
}
```
1. Build the Documentation with Xcode 13.3 / Swift 5.6
2. Convert the .doccarchive with [docc](https://github.com/apple/swift-docc) to use in static environments, by using the following command ``
swift run docc process-archive transform-for-static-hosting /path/to/CleanUI.doccarchive --output-path /path/to/CleanUI/docs --hosting-base-path /CleanUI``

### Custom NavigationBar
```swift
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.
```swift
CUAlert.show(YOUR_VIEW_HERE)

// Clear all Alerts with
CUAlert.clearAll()
```

To show a Sheet from everywhere in code you can do this.
```swift
CUSheet.show(YOUR_VIEW_HERE)

// Clear all Sheets with
CUSheet.clearAll()
```

To show a AlertMessage from everywhere in code you can do this.
```swift
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)
```

0 comments on commit 0f6968e

Please sign in to comment.