Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/workingdog/clocktimepicker
ClockTimePicker is a SwiftUI view of a clock with draggable hour and minutes hands for selecting the time of a date.
https://github.com/workingdog/clocktimepicker
clock swiftui time
Last synced: about 5 hours ago
JSON representation
ClockTimePicker is a SwiftUI view of a clock with draggable hour and minutes hands for selecting the time of a date.
- Host: GitHub
- URL: https://github.com/workingdog/clocktimepicker
- Owner: workingDog
- License: mit
- Created: 2020-02-05T06:44:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-11-05T13:20:38.000Z (about 3 years ago)
- Last Synced: 2024-10-07T12:19:11.437Z (about 1 month ago)
- Topics: clock, swiftui, time
- Language: Swift
- Homepage:
- Size: 2.06 MB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License.txt
Awesome Lists containing this project
README
# SwiftUI Clock Time Picker View
## Clock with hands
**ClockTimePicker** is a SwiftUI view that displays a clock with the hour and minutes hands.
These hands can be dragged around the clock face to select the desired hour and minutes of your date.The main element is **ClockPickerView.swift**.
Use it like a *DatePicker*, such as:
@State var date = Date()
ClockPickerView(date: $date)As the clock hands are changed, the *date* hour and minutes are updated.
To customise the looks of the clock, use
@ObservedObject var options = ClockLooks()
and change the options as desired.
## Clock without hands**ClockTimePicker** can also display a clock without hands, more suited to iPad and Mac. To display it set the options as:
options.withHands = false
To pick the hour and minutes, tap on the center **hour : minute** to display either the hours or the minutes set.
Note: adjust the sizes and colors using **options** to suit your device.
## Installation
Include the files in the "Sources/ClockTimePicker" folder into your project or use [Swift Package Manager](https://github.com/apple/swift-package-manager). See [ClockPicker](https://github.com/workingDog/ClockPicker) for an example use.
### Swift Package Manager
Create a Package.swift file for your project and add a dependency to:
dependencies: [
.package(url: "https://github.com/workingDog/ClockTimePicker.git", from: "1.1.0")
]Using Xcode
Select File > Swift Packages > Add Package Dependency...,
https://github.com/workingDog/ClockTimePicker.gitThen in your code:
import ClockTimePicker
## Screenshots![im01](Images/picture1.png) ![im03](Images/picture3.png)
![im04](Images/picture4.png) ![im05](Images/picture5.png)