Swiftpack.co - AlmightyBeaver/HourPicker as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
AlmightyBeaver/HourPicker
An expandable SwiftUI hour picker for positive and negative hours.
.package(url: "https://github.com/AlmightyBeaver/HourPicker.git", from: "1.2.1")

HourPicker

An expandable SwiftUI hour picker for positive and negative hours.

Example

struct HourPickerExample: View {
    @State var hours = 2.3
    @State var isDecimalTimeFormatUsed: Bool = false

    var body: some View {
        Form{
            Toggle("Decimal Time", isOn: $isDecimalTimeFormatUsed)
            Button(action: {
                if hours == 2.3{
                    hours = -15.8
                }else {
                    hours = 2.3
                }
            }) {
                Text("Change hours externally")
            }.buttonStyle(BorderlessButtonStyle())
            HourPicker(hours: $hours,
                       title: "Title",
                       captionTitle: "Caption text here",
                       maxHours: 30,
                       isSignPickerVisible: true,
                       isDecimalTimeFormatUsed: isDecimalTimeFormatUsed)
            Text("Value: \(hours)")
        }
    }
}

GitHub

link
Stars: 2
Last commit: 1 week ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

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