Git Product home page Git Product logo

ntmonthyearpicker's Introduction

NTMonthYearPicker

NTMonthYearPicker is a simple month / year picker component for use in iOS applications.

NTMonthYearPicker

Installation

Manual installation

  • Clone or download the repository
  • Drag the NTMonthYearPicker/NTMonthYearPicker folder into your project.

Using CocoaPods

  • Add pod 'NTMonthYearPicker' to your Podfile

Usage

Usage is identical to that of UIDatePicker. In fact, NTMonthYearPicker's public interface exactly mimics that of UIDatePicker.

To use NTMonthYearPicker in Interface Builder, drag a View component from the Object library into your view, then change the view's class from UIView to NTMonthYearPicker.

To see how to create a NTMonthYearPicker instance at runtime, check out the included demo iOS application NTMonthYearPickerDemo that shows you how to do this for both iPhone and iPad.

Notes

I created this component because the standard iOS UIDatePicker component only allows you to specify full dates i.e. day, month and year, but I had a use case in which the user needed to specify only the month and the year, or only the year.

I found a few other 3rd party iOS month/year picker implementations, but they either did not support many core properties of UIDatePicker such as minimumDate and maximumDate, or extended UIPickerView instead of UIControl, which meant that they would not emit UIControlEventValueChanged events like a UIDatePicker.

NTMonthYearPicker extends UIControl, exactly like UIDatePicker does, and re-implements all relevant functionality. I would have liked to simply extend the UIDatePicker class, but I don't know if this is possible. If it is, please let me know so I can rework this component.

Credits

NTMonthYearPicker was created by Arun Nair. If you use this code in your project, attribution is appreciated.

ntmonthyearpicker's People

Contributors

nairteashop avatar antonino-u avatar lennonhe avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  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.