Swiftpack.co - bdaralan/ValueRow as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by bdaralan.
bdaralan/ValueRow 0.2.0
A commonly used view for SwiftUI's List and Form
⭐️ 0
🕓 1 year ago
iOS macOS watchOS tvOS macCatalyst
.package(url: "https://github.com/bdaralan/ValueRow.git", from: "0.2.0")

ValueRow

A commonly used view for SwiftUI's List and Form. The view contains an image, a leading label, and a trailing value.

Highlight Features

  • Supports multiline text: Label and Value.
  • Supports individual font: Image, Label, and Value.
  • Supports tap or long press action: Image, Label, and Value.

Sample Code

import ValueRow

struct CheckoutView: View {
    
    var body: some View {
        Form {
            Section("ITEM") {
                ValueRow("Name", value: "Ice Cream")
                    .withContent(alignment: .firstTextBaseline)
                    .withValue(lineLimit: 2)
                
                ValueRow("Price", value: "$4.00")
                    .withValue(font: .body.monospacedDigit())
                
                ValueRow("Quantity", value: "3")
                    .withValue(font: .body.monospacedDigit())
            }
            Section("TOTAL") {
                ValueRow("Subtotal", symbol: "plus.circle", value: "$12.00")
                    .withValue(font: .body.monospacedDigit())
                
                ValueRow("Discount", symbol: "minus.circle", value: "$3.00")
                    .withValue(font: .body.monospacedDigit())
                
                ValueRow("Total", symbol: "equal.circle", value: "$9.00")
                    .withLabel(font: .title3.weight(.bold))
                    .withValue(font: .title3.monospacedDigit().weight(.bold))
            }
        }
    }
}

GitHub

link
Stars: 0
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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