Code Monkey home page Code Monkey logo

Comments (3)

wassupdoc avatar wassupdoc commented on September 23, 2024

I got the same issue. I had to override the buttonTap methods and added a highlight only method

#import 
#import "TKCalendarMonthView.h"

@class TKMonthGridView;
@interface TKCalendarMonthView (ButtonResponse)

- (void) leftButtonTapped;
- (void) rightButtonTapped;
@end


@interface TKMonthGridView (Highlight)

- (void) hilightDay:(int)theDayNumber;
@end

@implementation TKCalendarMonthView (ButtonResponse)

#pragma mark LEFT & RIGHT BUTTON ACTIONS
- (void) leftButtonTapped{
    [self moveCalendarMonthsDownAnimated:TRUE];
    [[deck objectAtIndex:1] hilightDay:1];
}

- (void) rightButtonTapped{
    [self moveCalendarMonthsUpAnimated:TRUE];
    [[deck objectAtIndex:1] hilightDay:1];
}

@end


@implementation TKMonthGridView (Highlight)

- (void) hilightDay:(int)theDayNumber{
    int i = 0;
    while(i < [dayTiles count]){
        if([[[dayTiles objectAtIndex:i] str] intValue] == 1)
            break;
        i++;
    }
    [selectedDay setSelected:NO];
    selectedDay = [dayTiles objectAtIndex:i + theDayNumber - 1];
    [[dayTiles objectAtIndex:i + theDayNumber - 1] setSelected:YES];
    
    
    [self bringSubviewToFront:selectedDay];
    //  [delegate performSelector:@selector(dateWasSelected:) withObject:[NSArray arrayWithObjects:self,selectedDay.str,nil]];
    //[delegate calendarMonth:self dateWasSelected:[selectedDay.str intValue]];
}

@end

its basically those delegate methods at the end in the highlight method that I commented out causing the issue. Also be aware that the way the TKCalendarMonthView.h and .m files is setup now prevents overriding with categories. I had to move the interface declaration for TKMonthGridView into the .h file(its currently in the .m) Devin any reason for this? I could have just added these methods directly into the code but I was trying to practice with using categories to override.

from tapkulibrary.

elprl avatar elprl commented on September 23, 2024

Cheers for the response.

I ended up with a simpler workaround - I set the [[deck objectAtIndex:1] selectDay:0];
in the leftButtonTapped and rightButtonTapped methods. The in the selectDay method I tested for zero and didn't call the selector.

from tapkulibrary.

devinross avatar devinross commented on September 23, 2024

This is suppose to happen because when you go from December to January, a new date is selected.

from tapkulibrary.

Related Issues (20)

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.