Skip to content

xartistax/iosSwiftUISideMenu

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iOS SwiftUI SideMenu 📱

Swift Version Platform License

Preview 🖼️

Preview Image 1 Preview Image 2

iosSwiftUISideMenu is an intuitive SwiftUI package designed to streamline navigation and enhance user experience within your iOS applications. 📱✨

Features 🌟

  • Effortless Navigation: Seamlessly navigate through different views and sections with a user-friendly side menu.
  • Customizable Interface: Tailor the menu appearance, animations, and functionalities to match your app's aesthetics and requirements.
  • SwiftUI Integration: Leverage the power of SwiftUI for a smooth and native integration within your iOS app.

Installation 🛠️

Swift Package Manager

  1. Open Xcode.
  2. Go to File -> Swift Packages -> Add Package Dependency.
  3. Enter https://github.com/xartistax/iosSwiftUISideMenu.git as Branch main.
  4. Import the package using import iosSwiftUISideMenu.

Usage 🚀

Initialize SideMenuView with the available parameters:

    struct ContentView: View, TabItemView {
    
    @State private var isMenuOpen: Bool = true
    @State private var selectedTab: MenuTabModel?
    
    var tabs: [MenuTabModel] {
    return [
        
        MenuTabModel(
            title: "SubView",
            subtitle: nil,
            imageName: "lock",
            view: SubView(isMenuOpen: $isMenuOpen))
        
    ]
    
}
    
    var body: some View {
       
            
        SideMenuView (
            isMenuOpen: $isMenuOpen,
            selectedTab: $selectedTab,
            selectedMenuView: .roundIcons,
            rootView: RootView(isMenuOpen: $isMenuOpen),
            tabs: tabs
        )
    }
}

Available Parameters

SideMenuView (
    isMenuOpen: <#T##Binding<Bool>#>,
    selectedTab: <#T##Binding<MenuTabModel?>#>,
    offset: <#T##CGFloat#>,
    menuOverlayOpacity: <#T##CGFloat#>,
    blurRadius: <#T##CGFloat#>,
    enable3D: <#T##Bool#>,
    backImage: <#T##String#>,
    iconColor: <#T##Color#>,
    iconBg: <#T##Color#>,
    bgColor: <#T##Color#>,
    selectionColor: <#T##Color#>,
    menuOverlayColor: <#T##Color#>,
    avatar: <#T##AvatarView?#>,
    selectedMenuView: <#T##MenuViewType#>,
    rootView: <#T##RootView#>,
    tabs: <#T##[MenuTabModel]#>
        )
         

SubViews

struct SubView: View , TabItemView {
    
    @Binding var isMenuOpen: Bool
    
    var body: some View {
        VStack {
            Text("SubView")
            Button(action: {
                isMenuOpen.toggle()
            }, label: {
                Text("Close Button")
            })
        }
    }
}

About

This repository shows Side Menu written with SwiftUI

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Swift 100.0%