A simple, fun, menu UI element. Great replacement for hamburger menus and tab bar menus.

Related tags

Menu JVFlowerMenu
Overview

#JVFlowerMenu is a quick and easy replacement to a hamburger menu and possibly a UITabBar

The JVFlowerMenu is not a controller but rather a drop in UI element that you could then use to control the content of any UI View. Here is a quick example of the final product:

menuGIF

#Setup

Cocoapods

pod 'JVFlowerMenu'

#Limitations

  1. Right now the classes are not @UIDesignable or @UIInspectable. This means that if you want to add them you have to add the constraints yourself in code or live and let live after you assign a frame.

  2. Will have unexpected behavior if it's super view is not the root view of your view controller.

  3. Any transforms you apply to the menu will mess up the behavior.

#Example

initalize a JVFlowerMenu like this:

let menu = JVFlowerMenu(withImage: nil, andTitle: nil)

Initalizing with a nil image will default to a drawing of a hamburger menu. A nil title wil just produce nothing for the title.

Then you can add Pedals like this:

menu.addPedal(withImage: nil, withTitle: nil)
menu.addPedal(withImage: nil, withTitle: nil)
menu.addPedal(withImage: nil, withTitle: nil)

If you pass nil for a Pedal image it will default to a drawing of a circle. nil for the title will display nothing.

You can then become the delegate and get notified about events in these methods:

menu.delegate = self

//MARK: Delegate Functions

public func flowerMenuDidSelectPedalWithID(_ theMenu: JVFlowerMenu, pedal: Pedal) {
    print("\(pedal.ID) Selected")
}

public func flowerMenuDidExpand() {
    print("Flower Menu expanded")
}

public func flowerMenuDidRetract() {    
    print("Flower Menu Retracted")
}

There are some properties you can change to manipulate the behavior of the menu:

menu.startAngle = 90.0
menu.pedalDistance = 200
menu.pedalSpace = 20
menu.stagger = 0

Finally, here is some set up code for adding constraints progmatically:

override func viewDidLoad() {
    self.view.addSubview(menu)
    self.constrain()
}

func constrain() {
    var constraints = [NSLayoutConstraint]()
    let vertical = NSLayoutConstraint.constraints(withVisualFormat: "V:|-30-[pedal]", options: [], metrics: nil, views: ["pedal": self.menu])
    constraints.append(contentsOf: vertical)
    let horizontal = NSLayoutConstraint.constraints(withVisualFormat: "H:|-20-[pedal]", options: [], metrics: nil, views: ["pedal": self.menu])
    constraints.append(contentsOf: horizontal)
    self.view.addConstraints(constraints)
}
You might also like...
EasyMenu - SwiftUI Menu but not only button (similar to the native Menu)
EasyMenu - SwiftUI Menu but not only button (similar to the native Menu)

EasyMenu SwiftUI Menu but not only button (similar to the native Menu) You can c

Swift-sidebar-menu-example - Create amazing sidebar menu with animation using swift
Swift-sidebar-menu-example - Create amazing sidebar menu with animation using swift

 SWIFT SIDEBAR MENU EXAMPLE In this project I create a awesome side bar menu fo

A menu bar app to change input source swiftly using shortcuts on macOS Big Sur or later.

Source Switcher A menu bar app to change input sources swiftly using shortcuts on macOS Big Sur and later. View screenshots Introduction This app uses

macOS (>11.0) Menu Bar App for WLED
macOS (11.0) Menu Bar App for WLED

wledQuickControl functions Left click on the Menubar icon will toggle the WLED device On/Off Right click on the Menubar icon: will update the icon/sli

SwiftBar - Powerful macOS menu bar customization tool
SwiftBar - Powerful macOS menu bar customization tool

SwiftBar - Powerful macOS menu bar customization tool

The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when a user clicks on the navigation title.
The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when a user clicks on the navigation title.

Introduction The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when

adb-tools-mac is a macOS menu bar app written in SwiftUI for common adb tools.
adb-tools-mac is a macOS menu bar app written in SwiftUI for common adb tools.

adb-tools-mac is a macOS menu bar app written in SwiftUI for common adb tools.

Ambar is a macOS Menu Bar app built with SwiftUI.
Ambar is a macOS Menu Bar app built with SwiftUI.

Ambar Ambar is a macOS Menu Bar app built with SwiftUI. It is a template project which means that it can be used as a starting point for a new Menu Ba

Mac menu bar tool to view the architecture of the running application
Mac menu bar tool to view the architecture of the running application

Silicon Info About Silicon Info is a tiny menu bar application allows the user to quickly view the architecture of the currently running application.

Releases(1.0.10)
Owner
null
Hamburger Menu using Swift and iOS 8 API's

FrostedSidebar Hamburger Menu using Swift and iOS 8 API's Heavily influenced by @_ryannystrom's RNFrostedSidebar This implementation uses iOS 8's new

Evan Dekhayser 429 Oct 21, 2022
Swipable tab and menu View and ViewController.

SwipeMenuViewController Overview SwipeMenuViewController provides SwipeMenuView and SwipeMenuViewController. This is very useful to build swipe-based

Yusuke Morishita 1.2k Dec 29, 2022
Interactive view transition to display menus with flowing and bouncing effects in Swift

FlowingMenu FlowingMenu provides an interactive transition manager to display menu with a flowing and bouncing effects. The Objective-C countepart is

Yannick Loriot 975 Dec 21, 2022
Control your display's brightness from the macOS menu bar. Simple and easy to use.

MonitorControl Lite Control your display's brightness from the macOS menu bar. Simple and easy to use. About MonitorControl Lite is a simplified versi

null 62 Dec 11, 2022
📷A simple and convenient way to manage your webcam's picture settings, right from your menu bar

Viewfinder A simple and convenient way to manage your webcam's picture settings, right from your menu bar. About • Download • Building from Source • C

Lukas Romsicki 31 Dec 25, 2022
Slide-Menu - A Simple Slide Menu With Swift

Slide Menu!! Весь интерфейс создан через код

Kirill 0 Jan 8, 2022
a simple macOS menu bar application that shows you the lyrics of current playing spotify track.

lyricsify a simple macOS menu bar application that shows you the lyrics of current playing spotify track.

Krisna Pranav 4 Sep 16, 2021
SwiftySideMenu is a lightweight and easy to use side menu controller to add left menu and center view controllers with scale animation based on Pop framework.

SwiftySideMenu SwiftySideMenu is a lightweight, fully customizable, and easy to use controller to add left menu and center view controllers with scale

Hossam Ghareeb 84 Feb 4, 2022
Barber lives in your macOS menu bar and keeps track of what needs to be updated.

Barber Barber is a macOS application to keep track of application updates easily. It lives in your menu bar, and uses homebrew to determine what's out

Max Ainatchi 1 Nov 30, 2021
A Slide Menu, written in Swift, inspired by Slide Menu Material Design

Swift-Slide-Menu (Material Design Inspired) A Slide Menu, written in Swift 2, inspired by Navigation Drawer on Material Design (inspired by Google Mat

Boisney Philippe 90 Oct 17, 2020