Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a method to customise the marker colours via the data source delegate and to detect long press in the calendar #192

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

superprat
Copy link

Method is - (NSArray ) calendarMonthView:(TKCalendarMonthView)monthView colorsForMarksFromDate:(NSDate )startDate toDate:(NSDate)lastDate

-(void)calendarMonthView:(TKCalendarMonthView *)monthView didLongPressDate:(NSDate *)date;

@fvermeulen
Copy link

You have to put this codeline in src/TapkuLibrary/TKCalendarMonthView.h otherwise it doesn't know the instance method for the selector

TKCalendarMonthView.h

  • (NSArray_) calendarMonthView:(TKCalendarMonthView_)monthView colorsForMarksFromDate:(NSDate_)startDate toDate:(NSDate_)lastDate;

@fvermeulen
Copy link

Can you add an Example how to use this? I get errors.

@superprat
Copy link
Author

Right you are, I forgot to commit that file

On 10-Oct-2012, at 6:23 PM, Fokke Vermeulen notifications@github.com wrote:

You have to put this codeline in src/TapkuLibrary/TKCalendarMonthView.h otherwise it doesn't know the instance method for the selector

TKCalendarMonthView.h

(NSArray) calendarMonthView:(TKCalendarMonthView)monthView colorsForMarksFromDate:(NSDate)startDate toDate:(NSDate)lastDate;

Reply to this email directly or view it on GitHub.

@superprat
Copy link
Author

I'm adding a bit more to customize the type of marker also, will upload a demo soon

On 10-Oct-2012, at 7:14 PM, Fokke Vermeulen notifications@github.com wrote:

Can you add an Example how to use this? I get errors.


Reply to this email directly or view it on GitHub.

@fvermeulen
Copy link

Hey thank you. I think i only need to know, what i have to put in the array.

@superprat
Copy link
Author

UIColor object

On 15-Oct-2012, at 3:45 PM, Fokke Vermeulen notifications@github.com wrote:

Hey thank you. I think i only need to know, what i have to put in the array.


Reply to this email directly or view it on GitHub.

@fvermeulen
Copy link

Thank you. It works ;)

…t's datasource delegate

-(void)calendarMonthView:(TKCalendarMonthView *)monthView didLongPressDate:(NSDate *)date;

if(markColor)
{
attrsDictionary = [NSDictionary dictionaryWithObjectsAndKeys:f2,NSFontAttributeName,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attributes for NSAttributedString such as NSFontAttributeName are available only for iOS 6 or newer. If one needs to use NSAttributedString for iOS 5 or older, it must be done by using CoreText (kCTFontAttributeName and such).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants