Question

I have been looking at how the mini-calander date is displayed. Is it done with NSCalendar or using open source projects?

I can't seem to find out how to do it. If anyone knows how its done or a tutorial about it that would be great. When the date is clicked it opens out a UIDatePicker. I expect it must be done using NSCalendar but cannot see anything about it.

Screenshot of Calendar Date

Was it helpful?

Solution

Typically, you would use NSDate.

Get the current day and month, then create labels the size of the icon, center the text and add them to the subview of the icon. I'm on my phone at the moment so I can't give a large description. But that would be the way I would do it.

EDIT

To answer your comment of adding a UILabel to the titleview of the navigationbar (navigationItem), I have added a UISlider to the navigationItem.titleView:

CGRect frame = CGRectMake(50, 150, 220, 23);
slider = [[UISlider alloc] initWithFrame:frame];
[slider addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
[slider setBackgroundColor:[UIColor clearColor]];
slider.continuous = YES; // Make the slider 'stick' as it is moved.
[slider setMinimumValue:0];
[slider setMaximumValue:((float)[numbers count] - 1)];
//slider.transform = CGAffineTransformMakeRotation(M_PI * - 0.5);
self.navigationItem.titleView = slider;

You can do the exact same with adding a UIView(1) that contains several other UIViews(2) with Labels inside those UIViews(2), just like how the image posted earlier has done... Then add a control event or gesture recognizer to the UIView(2) that allows some type of action to occur...

Honestly, I have come to realize, almost ANYTHING is possible in app development. It just matters how your approach your problem and if your up for the challenge...

If your still having issues, send a comment and I'll do exactly what your trying to do, but it is a good learning experience doing it yourself... But i'm here to help :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top