Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/LeonardoCardoso/BedtimeClock
https://github.com/LeonardoCardoso/BedtimeClock
clock clojure objective-c swift ui
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/LeonardoCardoso/BedtimeClock
- Owner: LeonardoCardoso
- License: mit
- Created: 2017-03-23T10:35:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-25T11:02:54.000Z (over 6 years ago)
- Last Synced: 2024-08-01T13:30:29.834Z (3 months ago)
- Topics: clock, clojure, objective-c, swift, ui
- Language: Swift
- Homepage:
- Size: 9.8 MB
- Stars: 14
- Watchers: 1
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
## BedtimeClock
My sketches for iOS 10 bedtime clock. **Unfinished**.
![dragging-around.gif](Images/dragging-around.gif)
### Init
```swift
// Time jumps at each five minuteslet bedtimeClockView: BedtimeClockView = BedtimeClockView(
frame: CGRect(x: 0, y: 0, width: 320, height: 320),
startTimeInMinutes: 126, // Hour: 02:06, will display 02:05
endTimeInMinutes: 552 // Hour: 09:12, will display 09:10
)
```### Observer
Watch the changes using this snippet:
```swift
self.bedtimeClockView.observer = { start, end, durationInMinutes inprint(start, end, durationInMinutes) // Will print: 01:00, 09:00, 480
}
```### Palette
You can change the colors whenever you want. Let's say if you want to give an impression of enabling and disabling the clock. To do so, use this function:
```swift
// Change nil for the color of your choice
self.bedtimeClockView.changePalette(
trackBackgroundColor = nil,
centerBackgroundColor = nil,
wakeBackgroundColor = nil,
wakeColor = nil,
sleepBackgroundColor = nil,
sleepColor = nil,
trackColor = nil,
numberColor = nil,
thickPointerColor = nil,
thinPointerColor = nil,
centerLabelColor = nil
)
```
See below the full color reference:![palette.jpeg](Images/palette.jpeg)
## License
BedtimeClock is released under the MIT license. See [LICENSE](https://github.com/leocardz.com/BedtimeClock/blob/master/LICENSE) for details.