Component

Spinners

Learn to add Spinners to your iOS App (Supports Xcode 16 and iOS 18)

Spinners

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

import SwiftUI

struct SpinnerExampleView: View {
    @State private var isLoading = false

    var body: some View {
        VStack {
            if isLoading {
                ProgressView("Loading...")
                    .progressViewStyle(CircularProgressViewStyle(tint: .blue)) // Customize color
                    .scaleEffect(1.5) // Adjust size
                    .padding()
            } else {
                Button("Load Data") {
                    loadData()
                }
                .padding()
            }
        }
        .navigationTitle("Spinner Example")
    }

    private func loadData() {
        isLoading = true

        // Simulating a network call
        DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
            isLoading = false // Stop loading after 2 seconds
        }
    }
}

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.