Swiftpack.co - nashysolutions/Rotary as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by nashysolutions.
nashysolutions/Rotary 1.0.0
A wheel-like UI control for choosing options from a menu. This repository is no longer maintained.
⭐️ 0
🕓 3 years ago
iOS tvOS
.package(url: "https://github.com/nashysolutions/Rotary.git", from: "1.0.0")

This repository is no longer maintained

A wheel-like UI control component for choosing options from a menu.

Demo

Tap the following image to launch Appetize. The source for the demo app is available here.

Preview

Usage

import Rotary

struct Dancer: WheelOption {
    let name: String
    var wheelOptionTitle: String {
        return name
    }
}

let wheelControl = RotaryWheelControl<Dancer>()
wheelControl.rotationEnded = { [unowned self] dancer in
    self.label.text = "The current selection is \(dancer.name)"
}
wheelControl.layout([
    Dancer(name: "Joanne"),
    Dancer(name: "Stacey"),
    Dancer(name: "Rhian"),
    Dancer(name: "Cathy"),
    Dancer(name: "Robin")
    ])
wheelControl.styling = RotaryWheelStyling(
                                    font: <placeholder>,
                                    textColour: <placeholder>,
                                    spindleColour: <placeholder>,
                                    backgroundColour: <placeholder>,
                                    innerGrooveColour: <placeholder>,
                                    outerGrooveColour: <placeholder>
                                )
view.addSubview(wheelControl)

The closure 'rotationEnded' is called immediately after layout. If you do not want this behaviour, call layout before assigning the closure.

Installation

List this in your Package.swift manifest file as a Swift Package dependency. Releases Page.

Acknowledgment

Heavily influenced by the awesome team over at raywenderlich.com.

GitHub

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

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