Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
vinhnx committed Dec 17, 2020
1 parent f4cad1a commit 56f8451
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ playground.xcworkspace
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm
.swiftpm

.build/

Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<H1 align="center">Laden</H1>

<h1 align="center">Laden</h1>
<p align="center">SwiftUI loading indicator view</p>
<p align="center">
<img src="./Resources/loading.gif"/>
</p>
<p align="center"><img src="./Resources/loading.gif"/></p>

---

Expand All @@ -19,6 +16,7 @@ Since this component is built using Swift Package Manager, it is pretty straight
### Usage

At simplest form:

```swift
import SwiftUI
import Laden
Expand All @@ -33,6 +31,7 @@ struct ContentView: View {
---

To show loading view on top on current view by embedding inside a `ZStack`:

```swift
ZStack {
Text("Some text") // your content view
Expand All @@ -45,6 +44,7 @@ ZStack {
---

To indicate loading state, have a private loading bool `@State` and bind it to Laden's `isAnimating` initialzier:

```swift
import SwiftUI
import Laden
Expand All @@ -66,6 +66,7 @@ struct ContentView: View {
---

To show or hide loading view, have a private show/hide bool `@State` and modify said loading with `.hidden` attribute, when toggled:

```swift
import SwiftUI
import Laden
Expand All @@ -74,7 +75,7 @@ struct ContentView: View {
@State private var shouldLoadingView = true

private var loadingView = SwiftUILoading.CircleOutlineLoadingView()

var body: some View {
VStack {
if shouldLoadingView {
Expand All @@ -85,7 +86,7 @@ struct ContentView: View {
}

Button(shouldCircleView ? "Show" : "Hide") {
self.shouldLoadingView.toggle()
self.shouldLoadingView.toggle()
}
}
}
Expand Down

0 comments on commit 56f8451

Please sign in to comment.