Swiftpack.co - pawello2222/UIUtils as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by pawello2222.
pawello2222/UIUtils 0.2.0
A collection of useful SwiftUI components.
⭐️ 1
🕓 3 years ago
.package(url: "https://github.com/pawello2222/UIUtils.git", from: "0.2.0")

This repository has been archived. It is now a part of PhantomKit.

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: 1
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Related Packages

Release Notes

0.2.0
3 years ago

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