Search code examples
iphonexcodecalendartapku

Xcode Event only showing marker not name - TapKu?


I have just implemented the tapku library calendar into my app. The calendar displays a event list under the calendar. (cell view)

I have it so its shows a date using this code - @"2012-08-09 00:00:00 +0000".

How would i make it so that when the user click on the date above it shows a message like "Your birthday" in the cell below?

I used this to help me with the initial part - http://developinginthedark.com/posts/iphone-tapku-calendar-markers


Solution

  • If you want to replace "." with any string, you will have to edit the following method TKCalendarView.m:

     - (void) drawTileInRect:(CGRect)r day:(int)day mark:(BOOL)mark font:(UIFont*)f1 font2:(UIFont*)f2{
    
    NSString *str = [NSString stringWithFormat:@"%d",day];
    
    
    r.size.height -= 2;
    [str drawInRect: r
           withFont: f1
      lineBreakMode: UILineBreakModeWordWrap 
          alignment: UITextAlignmentCenter];
    
    if(mark){
        r.size.height = 10;
        r.origin.y += 18;
        // Editing done here .......
        [@"edit" drawInRect: r
                withFont: f2
           lineBreakMode: UILineBreakModeWordWrap 
               alignment: UITextAlignmentCenter];
    }
    

    }

    Also if you want to enter longer string make sure to decrease the font size of label and other sizing properties of the label. Label here refers to (dot).