Giter Club home page Giter Club logo

midatepicker's Introduction

MIDatePicker

A lightweight, non-invasive, fully customizable DatePicker

Setup

  • Copy the "MIDatePicker" folder to your project.
  • Create a new instance with just a line of code
  datePicker = MIDatePicker.getFromNib()
  • Set the delegate and edit the MIDatePicker.Config struct to customize the date picker's UI and behavior
  datePicker.delegate = self
  
  datePicker.config.startDate = NSDate()

  datePicker.config.animationDuration = 0.25

  datePicker.config.cancelButtonTitle = "Cancel"
  datePicker.config.confirmButtonTitle = "Confirm"
  
  datePicker.config.contentBackgroundColor = UIColor(red: 253/255.0, green: 253/255.0, blue: 253/255.0, alpha: 1)
  datePicker.config.headerBackgroundColor = UIColor(red: 244/255.0, green: 244/255.0, blue: 244/255.0, alpha: 1)
  datePicker.config.confirmButtonColor = UIColor(red: 32/255.0, green: 146/255.0, blue: 227/255.0, alpha: 1)
  datePicker.config.cancelButtonColor = UIColor(red: 32/255.0, green: 146/255.0, blue: 227/255.0, alpha: 1)
  • Use the delegate's methods to interact with your view controller
  func miDatePicker(amDatePicker: MIDatePicker, didSelect date: NSDate) {
    // Do something when the user has confirmed a selected date
  }
  func miDatePickerDidCancelSelection(amDatePicker: MIDatePicker) {
    // Do something then user tapped the cancel button
  }

Demo

In this repository you can also find a demo.

Info

If you like this git you can follow me here or on twitter :) @MarioIannotta

Cheers from Italy!

midatepicker's People

Contributors

marioiannotta avatar nathanmrtns avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.