Skip to content

Commit c9ceab7

Browse files
authored
Update README.md
1 parent d2a64eb commit c9ceab7

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,53 @@
11
# 🛠️ Engineering Mode
22
EngineeringMode is a highly customizable iOS package to make debugging common things like Notifications, UserDefaults, Permissions and Networking easier.
33

4+
<div>
5+
<img src="https://github.com/ananay/EngineeringMode/assets/5569219/edb32e6b-ccab-44e8-a4cb-969d1c71dae4" width="300" />
6+
<img src="https://github.com/ananay/EngineeringMode/assets/5569219/9150ba17-c0db-4988-bf8f-e108167b082e" width="300" />
7+
<img src="https://github.com/ananay/EngineeringMode/assets/5569219/2de1cdab-614e-4e5a-abb8-237ba3db5ae7" width="300" />
8+
<img src="https://github.com/ananay/EngineeringMode/assets/5569219/e4841876-4c0e-4775-ab84-90d84d7004ce" width="300" />
9+
</div>
10+
11+
12+
13+
## Usage
14+
15+
`EngineeringMode` can be added to any SwiftUI view easily. Typically, it's used with a [Sheet](https://developer.apple.com/design/human-interface-guidelines/sheets).
16+
17+
18+
### **Basic usage with a sheet**
19+
```swift
20+
import EngineeringMode
21+
22+
//...
23+
24+
.sheet(isPresented: $showingEngineeringModeSheet) {
25+
EngineeringMode()
26+
}
27+
```
28+
29+
### **Custom Views**
30+
31+
To add a custom view to the existing Engineering Mode screen, just pass in `customViews` and `customViewTitles`. Optionally, if you want Custom Views to show before the other views, then add `showCustomViewsFirst`.
32+
33+
```swift
34+
EngineeringMode(
35+
customViews: [AnyView],
36+
customViewTitles: [String],
37+
showCustomViewsFirst: Bool
38+
)
39+
```
40+
41+
⚠️ Important:
42+
- `customViews` takes in an `AnyView` - please cast it to that.
43+
- `customViews` and `customViewTitles` should have the same number of array elements! Each custom view should have a title, otherwise the app will crash.
44+
45+
**Example**
46+
47+
```swift
48+
EngineeringMode(
49+
customViews: [AnyView(MyCustomView())],
50+
customViewTitles: ["Test"],
51+
showCustomViewsFirst: true
52+
)
53+
```

0 commit comments

Comments
 (0)