Consider marking event handler as ‘passive’ to make the page more responsive

I am using hammer for dragging and it is getting choppy when loading other stuff, as this warning message is telling me. Handling of ‘touchstart’ input event was delayed for X ms due to main thread being busy. Consider marking event handler as ‘passive’ to make the page more responsive. So I tried to add … Read more

How to add a touch event to a UIView?

How do I add a touch event to a UIView? I try: UIView *headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, nextY)] autorelease]; [headerView addTarget:self action:@selector(myEvent:) forControlEvents:UIControlEventTouchDown]; // ERROR MESSAGE: UIView may not respond to ‘-addTarget:action:forControlEvents:’ I don’t want to create a subclass and overwrite – (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 16 Answers 16

What’s the best way to detect a ‘touch screen’ device using JavaScript?

I’ve written a jQuery plug-in that’s for use on both desktop and mobile devices. I wondered if there is a way with JavaScript to detect if the device has touch screen capability. I’m using jquery-mobile.js to detect the touch screen events and it works on iOS, Android etc., but I’d also like to write conditional … Read more