Skip to content

Commit f67379c

Browse files
Update README.md
1 parent 81b1ab6 commit f67379c

File tree

1 file changed

+74
-2
lines changed

1 file changed

+74
-2
lines changed

README.md

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,75 @@
1-
# NoobLight
21

3-
A description of this package.
2+
# NoobLight - Lightweight Coach Marks for SwiftUI
3+
4+
NoobLight is a Swift library for adding coach marks to your SwiftUI app. With NoobLight, you can easily create custom shapes and styles for your coach marks and customize the contents to fit your app's design.
5+
6+
NoobLight is highly customizable and lightweight, with a minimum supported iOS version of iOS 13. It's perfect for developers who want to add coach marks to their SwiftUI app without adding a lot of extra weight or complexity.
7+
8+
9+
10+
11+
## Features
12+
13+
- Customizable shapes: choose from rounded, circle, or rectangle shapes for your coach marks
14+
- Customizable content: add any SwiftUI view as the content for your coach marks
15+
- Lightweight: NoobLight is small and fast, with a minimum supported iOS version of iOS 13
16+
17+
18+
19+
## Installation
20+
21+
To use NoobLight in your project, simply add it as a dependency in your Swift Package Manager manifest:
22+
23+
```swift
24+
dependencies: [
25+
.package(url: "https://github.com/ABHI165/NoobLight.git", from: "1.0.0")
26+
]
27+
```
28+
29+
## Usage
30+
31+
To use NoobLight in your app, follow these steps:
32+
33+
1. Import NoobLight in your view file:
34+
```swift
35+
import NoobLight
36+
```
37+
38+
2. Use the addNoobLightWith modifier to add a coach mark to a view:
39+
```swift
40+
.addNoobLightWith(id: 1, lightShape: .rounded, radius: 10) { anchor in
41+
RoundedRectangle(cornerRadius: 20)
42+
.foregroundColor(.red)
43+
}
44+
```
45+
- id: An integer to identify the coach mark.
46+
- lightShape: A NoobViewShape value that determines the shape of the coach mark (.rounded, .circle, or .rectangle).
47+
- radius: A CGFloat value that determines the corner radius of the coach mark (only applicable if lightShape is .rounded or .rectangle).
48+
- content: A closure that takes an Anchor<CGRect> and returns a View to be used as the coach mark.
49+
50+
3. Use the addNoobLight modifier to show the coach marks:
51+
```swift
52+
.addNoobLight(showing: $showCoachMarks, currentShowing: $currentCoachMark)
53+
```
54+
55+
- showing: A binding that controls whether the coach marks should be shown.
56+
- currentShowing: A binding to the current coach mark being shown.
57+
58+
4. Optionally, you can use the addNoobLight modifier with a closure to provide a custom view for the background:
59+
```swift
60+
.addNoobLight(showing: $showCoachMarks, currentShowing: $currentCoachMark) {
61+
ZStack(alignment: .center) {
62+
Rectangle()
63+
.fill(Color.black.opacity(0.4))
64+
65+
Button("Skip") {
66+
shoew = false
67+
}
68+
}
69+
}
70+
```
71+
72+
73+
74+
## License
75+
NoobLight is available under the MIT license. See the LICENSE file for more info.

0 commit comments

Comments
 (0)