Swiftpack.co -  Package - pawello2222/UIUtils
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
pawello2222/UIUtils
A collection of useful SwiftUI components.
.package(url: "https://github.com/pawello2222/UIUtils.git", from: "0.2.0")

Language: Swift Framework: SwiftUI platforms

UIUtils

A collection of useful SwiftUI components.

Installation

UIUtils is available as a Swift Package.

import UIUtils

Components

ActivityIndicator

ActivityIndicator()
    .frame(width: 50)
    .foregroundColor(.orange)

BackgroundNavigationLink

NavigationView {
    BackgroundNavigationLink(
        destination: Text("Destination"), 
        action: { print("Navigating...") }, 
        content: Text("Go to...")
    )
}

LabelButton

LabelButton(text: "Label", imageName: "plus.circle.fill", color: .red)

NetworkImage

NetworkImage(url: URL(string: "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"))
NetworkImage(
    url: URL(string: "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"),
    loadingContent: Text("Loading..."),
    errorContent: Text("Error")
)

PageView

@State private var selection = 2

// ...

PageView(selection: $selection) {
    Text("Tab 1")
    Text("Tab 2")
    Text("Tab 3")
}

SplitPicker

@State private var selection = 2

let items = (1 ... 5)
    .map {
        PickerItem(
            selection: $0,
            short: "Short: \($0)",
            long: "Long text of: \($0)"
        )
    }
    
// ...

NavigationView {
    Form {
        SplitPicker(selection: $selection, items: items, showMultiLabels: true) {
            Text("Picker")
        }
    }
}

TabViewItem

@State private var selection = 1

// ...

TabView {
    Text("Tab 1")
        .tabItem(index: 1, text: "Calendar", imageName: "calendar")
    Text("Tab 2")
        .tabItem(index: 2, text: "Add", imageName: "plus.circle")
    Text("Tab 3")
        .tabItem(index: 3, text: "Cancel", imageName: "xmark")
}
.tabSelection($selection)

WebView

WebView(link: "https://google.com", blockOutgoingRequests: true)

License

UIUtils is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 0
Last commit: 5 weeks ago

Release Notes

0.2.0
5 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco