Prevent web page from scrolling when double tap on UIWebView - ios

I have a UIWebView which loads a very long web page. It is the size of the screen. By default, when it receives a double tap gesture at the lower middle of the view, it scrolls down, and when it receives it at the upper middle, it scrolls up.
I have a UITapGestureRecognizer for detecting double taps attached to the view of my UIViewController. When a double tap is detected, a navigation bar appears; when another one is detected, it disappears. My problem is that, most of the time, when the user double taps for showing or hiding the navigation bar, the web page is scrolled simultaneously, which is pretty annoying.
is it possible to block this behavior on the UIWebView? Or even better, is it possible to prevent double taps from reaching the UIWebView?
Thank you.

Related

Starbucks App Modal View Controller with MapView And TableView

I'm looking to replicate the basic functionality of the Stores finder in the new Starbucks app but am unsure as to how I would go about implementing the sliding aspect of presenting the view:
The main aspect of the functionality I am trying to replicate is the ability to present the modal and have it dismissible by sliding it down off the screen or expand to full screen when scrolled up.
Also notice how the scroll bar doesn't overflow the modal (tableview)? I'm not sure if this is a tableview nested within a scrollview. Either way, the scroll seems to be controlling both the scrolling of the tableview and the moving of the modal at the same time, which is neat.
Update: I'm able to dismiss the Modal by sliding it down but still not able to expand to full screen when scrolled up without having the scrollview scroll when I pan. I want the scrollview to flash the scroll indicator but not do the scroll while I'm growing the containing view to full screen, and resume scroll after I reach full screen. All without having to disable bounce at least when scrolled downwards.

Swipe gesture not working on UIPageViewController when button clicked

I have created a UIPageViewController which I present on the screen.
The page view consists of 4 views. On top of each view I have added a UIButton over the top of the whole view to detect when someone clicks on a view.
Here is the view in interface builder. The whole of each coloured view has a button covering it:
When the user swipes I want the page view controller to go from one screen to the next.
Problem
When I go to make a swipe gesture, if I touch a button then it picks up the tap gesture for that button. So if I continue to slide my finger across the screen the page gesture doesn't work.
Goal
Even when I tap on a UIButton, if I don't lift my finger but instead make a swipe gesture, then I would like the UIPageViewController to turn page.
How can I override the touch gesture and instead make the slide gesture count and thus turn the page of the UIPageViewController.
Help much appreciated.

Need assistance regarding disappearing paste menu

In my messaging app I have HPGrowingTextView at the bottom and UITableview covering rest of the the view to show messages. When user tap on HPGrowingTextView I resize the UITableview and slide up the HPGrowingTextView so nothing hides behind keyboard.
But when user perform long press gesture on HPGrowingTextView everything works same but paste menu appears and then disappear.
How can I control the disappearing of paste menu.

Focused UITextField loses align and starts flickering when back to foreground

I have UITextField that is a first responder, when appropriate button is pressed application goes to background and opens Phone app. When I get back to my app instead of centre vertical alignment it appears as bottom vertical alignment and it appears/disappears after every second letter is inputed. I tried several solutions, but non of them worked. If I pop the screen, and come back to it again problem is fixed, but after going to background and foreground again this bug appears again.

Present UIPopoverController from a moving rect

Just got this weird problem, where I have a scroll view and buttons in the scroll view. I want to display a UIPopover from the button when touched, with UITextFields inside the UIPopover. The problem comes when the Keyboard appears. In certain cases, when the UIButton is so high in the view that the popover can only be displayed under it with the UIPopoverArrowDirectionUp, and when keyboard pops in, this popover cannot move any more up and therefore magically disappears to the top left corner (probably some Apple thing).
My solution is to check the frame of the UIPopover and to check that there is enough space for the keyboard, and if not, scroll the UIScrollView up with the buttons as well in order to be able to push the UIPopover up and so make sure that both the Keyboard and the popover fit.
So the question is: Is it possible to move the popover as the button moves?
Thanks

Resources