An open-source library to use with SwiftUI, It allows you to create Floating menu action button.

Overview

FloatingMenuActionButton

Example

Overview

This is an open-source library to use with SwiftUI. It allows you to create Floating menu action button.

Installation

Swift Package Manager

To integrate FloatingMenuActionButton into your Xcode project using Xcode 12, specify it in File > Swift Packages > Add Package Dependency...:

https://github.com/YugoMatsuda/FloatingMenuActionButton

Usage

[FloatingMenuItem] { return [ .init(iconName: "pencil", buttonAction: { showOtherView.toggle() }), .init(iconName: "camera.fill", buttonAction: { showOtherView.toggle() }), .init(iconName: "paperplane.fill", buttonAction: { showOtherView.toggle() }), ] } } ">
import SwiftUI
import FloatingMenuActionButton

struct ContentView: View {
    @State var isSelected = false
    @State private var showOtherView = false
    var body: some View {
        ZStack {
            if isSelected {
                Color.gray.edgesIgnoringSafeArea(.all)
                    .onTapGesture {
                        withAnimation(.easeIn(duration: 0.2)) {
                            isSelected.toggle()
                        }
                    }
            }
            
            VStack {
                Spacer()
                
                HStack {
                    Spacer()
                    
                    FloatingMenuActionButton(isSelected: $isSelected, floatingMenuItems: generateFloatingMenuItems())
                }
                .padding()
            }
        }
        .sheet(isPresented: $showOtherView) {
            Text("Other View")
        }
    }
    
    private func generateFloatingMenuItems() -> [FloatingMenuItem] {
        return  [ .init(iconName: "pencil", buttonAction: { showOtherView.toggle() }),
                  .init(iconName: "camera.fill", buttonAction: { showOtherView.toggle() }),
                  .init(iconName: "paperplane.fill", buttonAction: { showOtherView.toggle() }),
        ]
    }
}
You might also like...
Custom loading button with progress swiftui

CustomLoadingButton Simple Custom Loading Progress Button for SwiftUI Version 1.0.0 This version requires Xcode 11+ SwiftUI iOS 13+ macOS 10.15+ Insta

A SwiftUI button that expands to reveal more content.
A SwiftUI button that expands to reveal more content.

CUIExpandableButton A SwiftUI button that expands to reveal more content. CUIExpandableButton is part of the Crystal UI framework (under developement)

Cute Animated Button written in Swift.
Cute Animated Button written in Swift.

DOFavoriteButton Cute Animated Button written in Swift. It could be just right for favorite buttons! Requirements iOS 7.0+ Swift 1.2 Installation Cart

LTHRadioButton - A radio button with a pretty animation
LTHRadioButton - A radio button with a pretty animation

LTHRadioButton Slightly inspired by Google's material radio button. The clip below has 3 sections: full speed, 25% and 10%, but after converting it to

Multiple state tap-to-toggle UIButton (like old camera flash button)
Multiple state tap-to-toggle UIButton (like old camera flash button)

Multiple State Toggle UIButton A UIButton subclass that implements tap-to-toggle button text. (Like the camera flash and timer buttons) Usage Just cre

iOS Pod for a Soft UI (Neumorphic) Button for UIKit written in Swift
iOS Pod for a Soft UI (Neumorphic) Button for UIKit written in Swift

iOS Pod for a Soft UI (Neumorphic) Button for UIKit written in Swift

iOS 7-style bouncy button.

SSBouncyButton SSBouncyButton is simple button UI component with iOS 7-style bouncy animation. Take A Look Try It! pod 'SSBouncyButton', '~ 1.0' Use

Flat button with 9 different states using POP
Flat button with 9 different states using POP

VBFPopFlatButton Flat button with 21 different states and 2 types animated using pop. These are some examples of both types in different states: And h

Flat design pressable button for iOS developers.
Flat design pressable button for iOS developers.

HTPressableButton HTPressableButton is designed for iOS developers to be able to spend time developing ideas, not building basic buttons. These stylis

Owner
ugo
ugo
Material Design Floating Action Button in liquid state

LiquidFloatingActionButton [] (https://github.com/Carthage/Carthage) LiquidFloatingActionButton is floating action button component of material design

Takuma Yoshida 3.8k Dec 29, 2022
Easily customizable floating button menu created with SwiftUI

FloatingButton Easily customizable floating button menu created with SwiftUI We are a development agency building phenomenal apps. Usage Create main b

Exyte 715 Dec 30, 2022
Customizable download button with progress and transition animations. It is based on Apple's App Store download button.

AHDownloadButton is a customizable download button similar to the download button in the latest version of Apple's App Store app (since iOS 11). It fe

Amer Hukić 465 Dec 24, 2022
Revamped Download Button. It's kinda a reverse engineering of Netflix's app download button.

NFDownloadButton Revamped Download Button Requirements Installation Usage License Requirements iOS 8.0+ Swift 4.2+ Xcode 10.0+ Installation CocoaPods

Leonardo Cardoso 433 Nov 15, 2022
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.

A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code. Preview You'll be

Lorenzo Greco 2.3k Dec 31, 2022
A fully customisable swift subclass on UIButton which allows you to create beautiful buttons without writing any line of code.

JSButton Demo $ pod try JSButton ...or clone this repo and build and run/test the JSButton project in Xcode to see JSButton in action. If you don't ha

Jogendra 12 May 9, 2022
Customizable and easy to use expandable button in Swift.

ExpandableButton Requirements iOS 9.0+ Installation CocoaPods: Add the following line to your Podfile: pod 'ExpandableButton' #for swift less than 4.

Dmytro Mishchenko 98 Dec 5, 2022
IGStoryButtonKit provides an easy-to-use button with rich animation and multiple way inspired by instagram story/stories.

Introduction Have you ever seen UI like instagram story, haven't you? Actually, features like instagram story have been implemented in many applicatio

mutation 34 Nov 8, 2022
Lickable-Button We made the buttons on the screen look so good you'll want to lick them

Lickable-Button We made the buttons on the screen look so good you'll want to lick them. - Steve Jobs A little SwiftUI button project at WWDC 2021 Lic

Nate Thompson 14 Dec 29, 2021
Craft that perfect SwiftUI button effect 👌🏼

buttoncraft (SwiftUI 3.0 App) Experimenting with SwiftUI 3.0 whilst creating a practical app to craft that perfect button style. ✈️ Testflight https:/

An Trinh 188 Dec 28, 2022