Component

Floating Action Button

Learn to add Floating Action Button to your iOS App (Supports Xcode 16 and iOS 18)

Floating Action Button

Just copy the below code and modify according to your needs.

var body: some View {
    VStack(spacing: 20) {
        // ...
    }
    .frame(maxWidth: .infinity, maxHeight: .infinity)
    .overlay(
        VStack {
            Spacer() // Pushes the button to the bottom
            HStack {
                Spacer() // Pushes the button to the right
                Button(action: {
                    // Button Action here
                }) {
                    Image(systemName: "plus")
                        .foregroundColor(.white)
                        .padding()
                        .background(Color(.green))
                        .clipShape(Circle())
                        .shadow(color: Color(.gray), radius: 2.5)
                }
                .padding()
            }
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity)
    )
}

Time to build your iOS App?

ShipiOS provides you SwiftUI boilerplate, How-to Guides, Components Library and extra rewards!

Get ShipiOS Package
ShipiOS.App

I told you it's more than just a boilerplate :)

Made with ❤️ on 🌍

Need help? Reach out on:

© Copyright 2024 ShipiOS.App - All rights reserved.