Coder Social home page Coder Social logo

Comments (1)

chriswill0w avatar chriswill0w commented on July 26, 2024

I got it working on iOS5 :-). My solution:
-First convert the project to ARC: that means basically get rid off all the memory management stuff in the code of the timscroller like releases etc.
-then in the UITableView where you want to use the timescroller use custom cells instead of the standard ones
-in your custom cell class override the following method as follows:

  -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
[[NSNotificationCenter defaultCenter] 
postNotificationName:@"touchEventFromCell" object:event];
[super touchesBegan:touches withEvent:event];

}

-in the init method of the timescroller you have to add the following now:

  [[NSNotificationCenter defaultCenter] 
 addObserver:self
 selector:@selector(touchEventFromCell:)
 name:@"touchEventFromCell" 
 object:nil];

-and the following method has to be added to the timescroller class:

   - (void)touchEventFromCell:(NSNotification *)notification {

UIEvent * event = ((UIEvent *) notification.object);
currentEvent = event;
}

-currentevent is a property of timescroller that you can use in the following line of code:

        UIView *view = [_tableView hitTest:point withEvent:currentEvent];

-with the above code you get an event to use for the hittest since UIEventTypeTouches cannot be used with ARC. It is maybe not a nice solution but it works and performance is still the same.

from timescroller.

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.