Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joedaniels29/10Clock
This Control is a beautiful time-of-day picker heavily inspired by the iOS 10 "Bedtime" timer.
https://github.com/joedaniels29/10Clock
Last synced: 3 months ago
JSON representation
This Control is a beautiful time-of-day picker heavily inspired by the iOS 10 "Bedtime" timer.
- Host: GitHub
- URL: https://github.com/joedaniels29/10Clock
- Owner: joedaniels29
- License: mit
- Created: 2016-09-01T14:18:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T05:18:30.000Z (over 4 years ago)
- Last Synced: 2024-07-27T20:20:01.060Z (7 months ago)
- Language: Swift
- Homepage:
- Size: 1.48 MB
- Stars: 570
- Watchers: 20
- Forks: 83
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ios - 10Clock - This Control is a beautiful time-of-day picker heavily inspired by the iOS 10 "Bedtime" timer. (Date & Time / Getting Started)
- awesome-ios-star - 10Clock - This Control is a beautiful time-of-day picker heavily inspired by the iOS 10 "Bedtime" timer. (Date & Time / Getting Started)
- fucking-awesome-ios - 10Clock - This Control is a beautiful time-of-day picker heavily inspired by the iOS 10 "Bedtime" timer. (Date & Time / Getting Started)
- fucking-awesome-ios - 10Clock - This Control is a beautiful time-of-day picker heavily inspired by the iOS 10 "Bedtime" timer. (Date & Time / Getting Started)
README
#10Clock


[](https://travis-ci.org/joedaniels29/10Clock)Dark and Mysterious🕶 | Light Colors🌻
:-------------------------:|:-------------------------:
 | ## Usage
The control itsself is `TenClock`. Add that to your view hierarchy, and constrain it to be square (thats kindof important).
to set times, do:
```swift
self.tenClock.startDate = NSDate()
self.tenClock.endDate = NSDate. //sometime later
```make the date today.
then, to get updates for when the date changes, adopt the protocol `TenClockDelegate`:```swift
import TenClock
class ViewController: UIViewController, TenClockDelegate {
//Executed for every touch.
func timesUpdated(_ clock:TenClock, startDate:Date, endDate:Date ) -> (){
//...
}func timesChanged(clock:TenClock, startDate:NSDate, endDate:NSDate ) -> (){
print("start at: \(startDate), end at: \(endDate)")
self.beginTimeLabel.text = dateFormatter.stringFromDate(startDate)
self.endTimeLabel.text = dateFormatter.stringFromDate(endDate)
}
// ...
```## Contributing
The goals of the project at this point should be testing for edgecase behavior and expanding customizability.
Please do contribute, open an issue if you have a question. Then Submit a PR! :D
## Install via CocoaPods
[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
```bash
$ gem install cocoapods
```> CocoaPods 1.1.0+ is required to build 10Clock
To integrate 10Clock into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!target '' do
pod '10Clock'
end
```## License
10Clock is released under the MIT license. See LICENSE for details.