Coder Social home page Coder Social logo

flatdatepicker's Introduction

What is FlatDatePicker

Before iOS7 beta was announced, I developed this flat date picker for Xing app, which we applied for Evernote DevCup contest (You can vote us from this url: https://www.hackerleague.org/hackathons/evernote-devcup-2013/hacks/xing ). Althought it is not a real flat design, it includes gradient to provide the depth and illusion of scrolling. But if you look at iOS7 new date picker design, it is the same concept, it still provides some sort of reflection to reality. So, before iOS7 was officially released, you may want to try this control, and I think it is a good match to FlatUIKit.

And also watch the sample app video here: http://youtu.be/ROgQzdq8CXg

What's in FlatDatePicker

  • Comply with Interface Builder
  • Easy to customize the font and colors throught UIAppearance
  • Can be placed as a subview in any view
  • Comply with UIControl protocol
  • Flat and elegant

How to install

Manual

  1. Drag & drop the SSFlatDatePicker into your project
  2. Link with Quartz Core framework
  3. You can either use [[SSFlatDatePicker alloc] initWithFrame:] to add SSFlatDatePicker as a subview of your UI
  4. Or, you can drag a UIView retangle in Interface Builder, set its custom class as SSFlatDatePicker, and link to the IBOutlet in your source code.
  5. You can hook the changed value throught monitoring the UIControlEventValueChanged event.

CocoaPods

SSFlatDatePicker is in cocoapods now, you can find it and install it throught pods command.

flatdatepicker's People

Contributors

asselinpaul avatar readmecritic avatar syshen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flatdatepicker's Issues

iOS 5?

how do I make this work on iOS 5?

I replaced the UICollectionView classes with the P*TCollectionView classes, but it's a no-go, nothing was being shown on screen.

If SSFlatDatePicker's date is set to a month with 30 days and it is then set programmatically to the last day of a month with 31 days it crashes

Thank you for publishing this widget. It loads much faster than the iOS6 UIDatePicker.

I believe there is a bug as described in the heading:
I believe it tries to scroll the day to 31 which is 1 more than the number of items in the day scrollview when the scrollToItemAtIndexPath is invoked.

In this part of setDate:

NSInteger currentDayIndex = [self.scrollerDay currentSelectedIndexPath].row;
if (dateComponents.day != currentDayIndex) {
[self.scrollerDay scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:dateComponents.day-1 inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredVertically animated:animated];
}

I believe a fix is to add a line to the if section for month above like this:

NSInteger currentMonthIndex = [self.scrollerMonth currentSelectedIndexPath].row;
if (dateComponents.month != currentMonthIndex) {
[self.scrollerMonth scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:dateComponents.month-1 inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredVertically animated:animated];

[self.scrollerDay reloadData]; // ghr1234

}

Regards

ghr1234

Broken build in SSFlatDatePicker 0.0.6

Installed with the cooapods:

screen shot 2014-02-19 at 4 39 00 pm

Semantically, there needs to be a else, or a simple return before the end of the method scope. I'll return 0 locally just get past this.

month not set correctly

Having a strange issue. when setDate is called at time of controller's viewDidAppear, the month is not set correctly. Day & year are correct. When called later in the controller's code, setDate works correctly for year, month, day.

Dynamic Collection Sizing

I believe line 462 of SSFlatDatePicker.m should be "return numberOfItems". Otherwise, the delegate returns 0 for the size of each collection view. The original code ultimately causes a crash in my project when instantiating the control outside of Interface Builder.

New crash

Hi,
I wanted to test FlatDatePicker, so I downloaded the demo project and run it, however, I'm facing that problem/crash:

screen shot 2014-03-19 at 10 56 31
Can you please take an urgent look on it?
Thank you.

Can't load date automatically

Hi,
i've added SSFlatDatePicker to the view programmatically.
I try to load today's date but it always loads "1 January 1913".
[theDatePicker setDate:[NSDate date] automatically:YES]; - doesn't help
[theDatePicker setDate:[NSDate date]]; - doesn't help.

When nslog the [NSDate date] it gives current date.
Tried to load the date via NSDateComponents.
NSLog gives the loaded data but datePicker not.

Any help please.

Scroll speed

Scroll speed is ok for time, year or month but it's slow for days.
It takes 5-6 scrolling actions to get from 1 to 31.

The ability to make scroll a little faster would be much appreciated.

When passing NSDate to setDate, min date on picker is selected

I am passing an NSDate* to two pickers, one in Date mode and one in Time mode. Date is initialized to some non-null date (e.g. May 14, 2014 3:52 PM). When I use method setDate: or setDate:animated:, the date and time picker set selectors to the minimum allowed date and time (e.g. Jan 01, 2000 1:00 AM). This was previously only happening on 64 bit devices, but is now happening on all devices in simulator running iOS 7 and 7.1. Testing has only been done in the simulator so I cannot confirm if the issue occurs on device as well.

IOS 7

Hi,

I have a problem with an App on IOS 7 (compiled with IOS7 SDK, target Version 6.). The gradient of the selected date never shows up correctly.

Can you help?

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.