This Control is a beautiful time-of-day picker heavily inspired by the iOS 10 "Bedtime" timer.

Related tags

Date & Time 10Clock
Overview

#10Clock pods MIT Build Status

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

Install via CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ 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:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod '10Clock'
end

License

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

You might also like...
The most perfect Swift Timer you'll ever need.

Timerable ⏰ The most perfect Swift Timer you'll ever need. A protocol-oriented Timer Factory with all the features you'll ever need. I wrote it in bot

A timer that lets you know when your ramen is ready to eat!
A timer that lets you know when your ramen is ready to eat!

Dependencies Ramen Timer requires the following: Gifu SwiftySound On Xcode simply go to File Add Packages and input the names on the searchbar then

Egg timer app written in Swift
Egg timer app written in Swift

Egg Timer Our Goal This module will be a mix of tutorials and challenges. Most importantly, we want you to get comfortable with looking up how to do s

A "time ago", "time since", "relative date", or "fuzzy date" category for NSDate and iOS, Objective-C, Cocoa Touch, iPhone, iPad

Migration 2014.04.12 NSDate+TimeAgo has merged with DateTools. DateTools is the parent project and Matthew York is the project head. This project is n

A customizable date picker for watchOS and SwiftUI.
A customizable date picker for watchOS and SwiftUI.

Watch Date Picker A customizable date picker for watchOS and SwiftUI. Installation .package(url: "https://github.com/freyaariel/watch-date-picker.git"

SwiftMoment - A time and calendar manipulation library for iOS 9+, macOS 10.11+, tvOS 9+, watchOS 2+ written in Swift 4.

SwiftMoment This framework is inspired by Moment.js. Its objectives are the following: Simplify the manipulation and readability of date and interval

A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.
A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.

TimeZonePicker A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your

Timekeeper is an easy-to-use time measurement library written in Swift, with support for iOS, tvOS, watchOS and macOS.
Timekeeper is an easy-to-use time measurement library written in Swift, with support for iOS, tvOS, watchOS and macOS.

Timekeeper is an easy-to-use time measurement library written in Swift, with support for iOS, tvOS, watchOS and macOS. Installation Timekee

The goal is a simple iOS app that draws an analog clock of the current time

Qrono This is a work-in-progress. The goal is a simple iOS app that draws an analog clock of the current time (as well as displaying a digital readout

Comments
  • Revolutions count

    Revolutions count

    Hi! It's possible to count the number of revolutions? I would like to use 10Clock and add a [days] field that I could increment or decrement by doing rotations. Thanks for your help!

    opened by SuperLLN 6
  • Expose Head & Tail text for modification

    Expose Head & Tail text for modification

    By exposing the head & tail text for modification, it's enabling i18n of the clock. Namely an app can pass localized strings to the clock.

    Thoughts?

    opened by PhilibertDugas 2
  • Alarm clock drag issue from inside Arc

    Alarm clock drag issue from inside Arc

    Hi, I want to use your library but there should not be any drag from unhighlighted layer(lowest layer) and not from inside arc and drag only happen from highlighted layer(upper layer) like Apple alarm clock.Could you please help me on above scenario.

    opened by Abhi-philips 0
  • Inaccurate duration in center

    Inaccurate duration in center

    Sometimes you get inaccurate duration in the center of the clock. 3:20 to 7:20 would produce "2hr55min". This can be fixed by changing the following line to include round()

    func updateWatchFaceTitle() {
    ...
    var fiveMinIcrements = Int(round(((tailAngle - headAngle) / twoPi) * 12 /*hrs*/ * 12))
    
    opened by otoury 0
Owner
Joe
Apple / iOS
Joe
A basic countdown app that allows the user to create, edit, and delete events. Each event contains a live countdown timer to a specified date and time.

Event Countdown App (iOS) Created by Lucas Ausberger About This Project Created: January 4, 2021 Last Updated: January 8, 2021 Current Verison: 1.1.1

Lucas Ausberger 1 Jan 8, 2022
Better time picker for iOS.

TimePicker Better TimePicker for iOS Requirements Swift 5.0 iOS 10.0+ Xcode 10.2+ Installation The easiest way is through CocoaPods. Simply add the de

Oleh 14 Oct 21, 2022
Custom Time Picker ViewController with Selection of start and end times in Swift 🔶

LFTimePicker Custom Time Picker ViewController with Selection of start and end times in Swift ?? . Based on Adey Salyard's design @ Dribbble One to tw

Awesome Labs 65 Nov 11, 2022
Basic iOS app template for Integrate Branch Day.

Integrate-Branch-Day-Template Basic iOS app template for Integrate Branch Day. How to prepare for Integrate Branch Day: Install Xcode via Self Service

null 0 Oct 19, 2021
NasaApod - iOS, Swift, MVVM, Consuming NASA Astronomy Picture of the Day API for any selected date

NasaApod iOS, Swift, MVVM, Unit Tests Consuming NASA Astronomy Picture of the Da

Vishal Singh 1 Jan 10, 2022
Convergent Demo Day: StepCity mobile app

Convergent Demo Day 2020 Problem: Our daily lives have been upended by the pandemic and it has been harder to motivate ourselves to workout. Dr Dunton

Kelly Chiu 0 Dec 28, 2021
On This Day is a cross-platform smartphone application built with Flutter, fetching facts from the NumbersAPI

On This Day is a cross-platform smartphone application built with Flutter, fetching facts from the NumbersAPI. There are three ways to fetch facts, by date (MM/YY format), by day of the year (1-366) and randomly.

null 1 Jun 19, 2022
Swifty Date & Time API inspired from Java 8 DateTime API.

AnyDate Swifty Date & Time API inspired from Java 8 DateTime API. Background I think that date & time API should be easy and accurate. Previous dates,

Jungwon An 182 Dec 1, 2022
Swifty Date & Time API inspired from Java 8 DateTime API.

AnyDate Swifty Date & Time API inspired from Java 8 DateTime API. Background I think that date & time API should be easy and accurate. Previous dates,

Jungwon An 182 Dec 1, 2022
Schedule timing task in Swift using a fluent API. (A friendly alternative to Timer)

Schedule(简体中文) Schedule is a timing tasks scheduler written in Swift. It allows you run timing tasks with elegant and intuitive syntax. Features Elega

Luo Xiu 1.8k Dec 21, 2022