UIScrollView scrolls when clicking "Back" button in UINavigationBar - ios

I have a UIViewController with a paged UIScrollView (3 pages). My View always starts at the second page, the middle one. The problem is that when I hit the back button in the UINavigationBar, the UIScrollView scrolls to the first page, and after that it disappears (popped from Nav Controller's stack).
The visible animation behaviour is horrible.
I want the UIScrollView not to scroll when I hit the BACK button in the UINavigationBar.
The same happens when I drag the left side of the screen to the right (triggers the BACK behaviour).

With some good debugging I noticed out that the scroll view wasn't scrolling during the "Back" transition. It was just part of the left pages that were visible during the transition.
So with a simple [scrollView clipsToBounds] the problem was solved :).

Related

scroll top navigation bar similiar to flipkart app ios

I have a logo on a navigation bar. Beneath it, I have a searchbar with three bar buttons on its both sides.
The searchbar and bar buttons are put in a UIView which is beneath the navigationbar.
I want to implement a functionality where with a very small pinch of scroll on the tableview by user, the navigationbar should move above with animation with scroll up and should come down with animation for scroll down.
Along with this, the searchbar should occupy the position of the logo while scrolling up and should come at its original position when scrolling down.
This is the same functionality implemented in Flipkart app on the Home page.
I tried using SQTShyNavigationBar by Cocoa Controls
https://github.com/cbpowell/SQTShyNavigationBar, but that does not adjust the position of my search View.
Please help me with this.

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.

UIScrollView scroll strangely when UISearchBar begin editing

I have a view with a search bar and a scroll view.
My views layout like below.
UIView
UISearchBar
UIScrollView
UITableView(the first page)
UITableView(the second page)
The scroll view scroll strangely by steps below.
Make the scroll view scroll to second page
Touch the search bar
While showing search display controller,the scroll view scroll to first page strangely.
How to make the scroll view stay in second page?
Oh,no!!I hope I had enough reputation to post image.😂

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

UIButton stays highlighted until UITableView ends scrolling

I have my own custom navigation controller(that subclasses UIViewController) that has a stack for the view controllers. It has a custom navigation bar and a content view, where I add the view of the view controller at the top of my stack of view controllers.
Then navigation bar, which is a subclass of UIView, I didn't subclass UINavigationBar, because I don't need to, has a Back button, and another button which at this moment doesn't have any action connected.
My problem is that if I scroll a UITableView (that belongs to the current view controller on the stack) and I press either on my back button or on the other button, both of them stay highlighted until the UITableView ends scrolling. It's the weirdest behavior ever, and I don't understand why it happens.
Any suggestions please?
Apparently, if I call [button setHighlighted:NO] on my IBAction it de-highlights it even if the UITableView is still scrolling

Resources