10Clock 0.0.20

10Clock 0.0.20

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2016
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Joe Daniels.



10Clock 0.0.20

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:

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:

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

License

10Clock is released under the MIT license. See LICENSE for details.