Skip to content

Commit aaced9b

Browse files
committed
Add README
1 parent 6579dcc commit aaced9b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# AdaptiveTabView
2+
3+
An adaptive SwiftUI container that switches between [TabView](https://developer.apple.com/design/human-interface-guidelines/components/navigation-and-search/tab-bars) and [NavigationSplitView](https://developer.apple.com/design/human-interface-guidelines/components/layout-and-organization/split-views) based on horiontal size class. This framework allows you to easily build iPhone and iPad apps that conform to [Apple's Human Interface Guidelines](https://developer.apple.com/design/).
4+
5+
Here's an example of how it can be used:
6+
7+
```swift
8+
@main
9+
struct MyApp: App {
10+
var body: some Scene {
11+
WindowGroup {
12+
AdaptiveTabView(appName: "My App") {
13+
MyFirstTab()
14+
MySecondTab()
15+
MyThirdTab()
16+
} defaultContent: {
17+
MyDefaultContentView()
18+
} defaultDetail: {
19+
MyDefaultDetailView()
20+
} sidebarExtraContent: {
21+
Section {
22+
ForEach(folders) { (folder) in
23+
FolderSidebarCell(folder)
24+
}
25+
}
26+
}
27+
}
28+
}
29+
}
30+
```
31+
32+
```swift
33+
struct MyFirstTab: View, TitleImageProviding {
34+
let title = "My First Tab"
35+
let systemImageName = "1.square"
36+
37+
var body: some View {
38+
...
39+
}
40+
}
41+
```

0 commit comments

Comments
 (0)