Download code
If you know how to install svn, or your computer already installed svn, you can just use svn download codes:
svn checkout http://iphonecal.googlecode.com/svn/trunk/ iphonecal-read-only
or, you can down codes from this two links:
http://iphonecal.googlecode.com/svn/trunk/TdCalendarView.h
http://iphonecal.googlecode.com/svn/trunk/TdCalendarView.m
Create a iPhone application project
Once you downed codes, you need create an iPhone application project. Open Xcode, click "File"->"New Project..." Menu, with the opened dialog, select View-based Application.
After you create project, click "Project"->"Add to project...", select downloaded files, keep "Copy items into destination group's folder" selected.
Setup view class
Open your nib file.
select which view that you need as calendar, set it's class as TdCalendarView.
Ok, run your program, you will see your calendar.
If you have trouble follow this tutorial, you can use my demo project as your start & code template. Download url is http://iphonecal.googlecode.com/files/TestiPhoneCal.zip .
Chinese Version/中文版








13 评论:
Can you mail your code to me?
I will review it for you.
My email: tinyfool@gmail.com
Love what you did with this class.
I am wondering though. How do you set the day flags?
I have added this class to a flip view. One side is your calendar and the other is my data. Once I set data for a specific date I want to reflect those changes on the calendar.
TdCalendarView have a method "setDayFlag", you can use it.
how i setup the sunday as first day of week? good, not only show sunday as first day of week, also show the correct date?
sorry, Néstor.
Now, only way is you self modify the code, sorry.
i'm not sure about the sebtence of "set it's class as TdCalendarView. " does it means we have to change the name of the original xib file(says, the calendarViewController.xib -> tdCalendar View, dooen't it?
but i got a blank view on the simulator.
Hi,
thanks for this component, it seems like it could be very useful for my current project. How easy is it to customize the calendar though? Can you change the colours and width etc?
Thanks in advance,
Conor
Thanks for the tutorial, very useful, Can you please mail me the code. thanks a lot.
Thanks for the sample code. I was just asked at to create a calendar page and I did nit know that iPhone SDK did not have built in framework.
Just need to add another string in each cell. Excellent Job!
I am a newbie in this iPhone world, so if this is impossible, please let me know. Can you give me snippet of code or point me in the direction of a solution. I need to be able to click on a date, then present a UITableView that will display a list of actives for that date.
Nice code. I am using in an iPad app that I am building. Can you tell me how to highlight the date that has been previously selected? I select the date, when I return to the control, I would like to see that date shown and highlighted just as it is shown when selected. Thanks!
Thanks for the calendar, i have only a nooby, so here it comes my question, how can i change the numerical format of the month to, for instance, march and so on?
i think i have to look into this line:
NSString *title_Month = [[NSString alloc] initWithFormat:@"%d - %d",currentMonthDate.month,currentMonthDate.year];
Post a Comment