Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akardas16/SideMenu
This repository shows Side Menu written with SwiftUI
https://github.com/akardas16/SideMenu
Last synced: about 2 months ago
JSON representation
This repository shows Side Menu written with SwiftUI
- Host: GitHub
- URL: https://github.com/akardas16/SideMenu
- Owner: akardas16
- Created: 2022-08-21T06:04:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-02T03:05:32.000Z (about 1 year ago)
- Last Synced: 2024-11-16T21:33:49.942Z (about 2 months ago)
- Language: Swift
- Homepage:
- Size: 128 KB
- Stars: 46
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-swiftui-libraries - SideMenu - This repository shows Side Menu written with SwiftUI (Menu / Content)
README
# SideMenu - SwiftUI
## Install
### Swift Package Manager
Open `Xcode`, go to `File -> Swift Packages -> Add Package Dependency` and enter `https://github.com/akardas16/SideMenu.git` as Branch `main`
You need to add `import SideMenu`
## Usage
Without 3D effect
With 3D effect* initilize `SideMenuView` with available parameters
```Swift
SideMenuView(
isMenuOpen: $isMenuOpen,
tabs: tabs, // add your [MenuTabModel]
selectedTab: $selectedTab, //initial selectedTab
backColor: $backColor, //acces view placeholder background
backImage: "airplane", //add your background image! Default value is airplane
selectionColor: .purple,
blurRadius: 32, // add blur radius for image default value is 32
enable3D: true //enable/disable 3D effect
) {
if selectedTab.title == "Home" {
TabOne(isMenuOpen: $isMenuOpen, backColor: $backColor)
}else if selectedTab.title == "Profile" {
TabTwo(isMenuOpen: $isMenuOpen, backColor: $backColor)
}else if selectedTab.title == "Settings" {
TabThree(isMenuOpen: $isMenuOpen, backColor: $backColor)
}
}
```* Example tabs array
```Swift
let tabs = [MenuTabModel(title: "Home", imageName: "house"),MenuTabModel(title: "Profile", imageName: "person"),MenuTabModel( title: "Settings", imageName: "gear")]
``````Swift
@State var isMenuOpen:Bool = true
@State var selectedTab:MenuTabModel = MenuTabModel(title: "Home", imageName: "house")
@State var backColor = Color.pink
```
### Want to try library quickly?
* Paste `HomeView.swift` file to your project and see UI on preview