Skip to content

akardas16/SideMenu

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

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
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
let tabs = [MenuTabModel(title: "Home", imageName: "house"),MenuTabModel(title: "Profile", imageName: "person"),MenuTabModel( title: "Settings", imageName: "gear")]
@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

About

This repository shows Side Menu written with SwiftUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages