I'm working on epub reader , simply I built the reader structure to get the path of html file load it on UIWebView
, then I paginate the chapter and view it ... as you know when you select a text in webView the menuController will appear and I have multiple features on it like add note , highlight text, share ..etc. every thing is working great , but i have a special case that some books contains big chapters (html file size about 180kb where the normal one usually is about 30-50kb) , in these kind of chapters when I select a text the UIMenuController
take too much time to appear ! at the end it is appearing and working well but its annoying to the users to wait this amount of time (we are talking here about 7 seconds !!) .. my build target is iOS 4 & 5 , and this is happened in the simulator and device .. can anyone provide a help ?
Edit:
canPerformAction in my ViewController :
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
BOOL can = [super canPerformAction:action withSender:sender];
if(action == @selector(copyPressed::) ||
action == @selector(addNotePressed:) ||
action == @selector(sharePressed:) ||
action == @selector(highlightPressed:))
{
can = YES;
}
if (action == @selector(copy:) || action == @selector(_define:) || action == @selector(selectAll:) || action == @selector(select:))
{
can = NO;
}
return can;
}
I'm working on an identical project and have just implemented the same functions with UIMenuController . I haven't noticed any delays showing the menu with large chapters. Could you describe the way your touch events are being handled in UIWebView along with any additional gestures etc. Also, is there javascript that's being run when the chapter loads?