Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdifran committed Feb 25, 2023
1 parent 6579dcc commit aaced9b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# AdaptiveTabView

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/).

Here's an example of how it can be used:

```swift
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
AdaptiveTabView(appName: "My App") {
MyFirstTab()
MySecondTab()
MyThirdTab()
} defaultContent: {
MyDefaultContentView()
} defaultDetail: {
MyDefaultDetailView()
} sidebarExtraContent: {
Section {
ForEach(folders) { (folder) in
FolderSidebarCell(folder)
}
}
}
}
}
}
```

```swift
struct MyFirstTab: View, TitleImageProviding {
let title = "My First Tab"
let systemImageName = "1.square"

var body: some View {
...
}
}
```

0 comments on commit aaced9b

Please sign in to comment.