scroll top navigation bar similiar to flipkart app ios - 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.

Related

Modal UIViewController from middle of the screen

I have a transparent custom navigation bar like the one on this picture:
I would like to have a modal view that appears from just under the navigation bar up to half of the screen and make it feels like the navigation bar is expending until half of the screen. And I would like to animate it like if it is sliding down. It will just contain a UILabel, and it will appear when I click on the "i" information button on the top right corner.
I don't know how to make a translucent modal view appears from the middle of the screen instead of from a border. Especially since my navigation bar is transparent and my modal view should not appears behind it while appearing. Do you have any example or tutorial to help me do that?
I am coding in Swift :)

UITabBar focus and moving layout of view on tvOS

One of the common behaviours of Apple's AppleTV apps (like Movies and Television Shows) is that they start with a UITabBar visible, and all of the view's content is rendered in the space below the tab bar. Once focus moves from the tab bar to some content on the screen, the tab bar slides off the top of the screen, and the content moves/scrolls up to fill in the space that's now available. This process reverses itself if the tab bar reappears.
Is there an easy way to accomplish this behaviour (like a check box or something?), or must I implement the didUpdateFocusInContext:withAnimationCoordinator: method in various places, and manually tweak the frames or scroll the content or something?
Select the Tab Bar object in the Tab Bar Controller scene in Storyboard mode and uncheck "Translucent". The items in the views should now move upwards when the tab bar moves upwards.
The UITabBar class also has a translucent property

Add a UIImageView to the back of NavigationBar (NOT background image)

I am trying to add a UIImageView to the back of a navigation bar.
The reason is because I want to create a UITableView whose navigation bar is actually a picture (with back button on the left) but I want the picture to scroll with the tableview and when the picture is fully scrolled out. The navigation bar is shown as per normal.
My solution to this problem:
Add a UIImageView to the top of the UITableView and make the navigation bar transparent. Set a contentOffset for the UITableView which is a subclass of UIScrollView so that when the view is presented, it looks like the picture is filling the navigation status bar.
Problem:
If I scroll up, instead of bouncing back, the transparent status bar is shown (with a color of the background as it is transparent).
Possible way to solve this new problem:
I was thinking of trying to limit the ScrollView size to get around with problem but failed.
So I feel is it possible to add the UIImageView to the "back" of the navigation bar so that it is there without any offset? Since that way, my life will be much easier.
Any suggestions on solving this or another new approach to get the same UI/effect?
Related question.
I would do this by adding either a table header or cell at the top of the table which contains your image.
Create the table view so that it extends all the way to the top of the screen. Extend Under Top Bars option. I have not done this with a UITableViewController but I have done this with a UITableView embedded inside a UIViewController's view with the top constraint set to 0 for the view rather than the top layout guide.
Now when you run this your table will fill the whole screen and the top header or cell will be at the top showing your picture.
When you scroll you can either use the UIScrollViewDelegate to detect the movement or implement tableView:didEndDisplayingCell:forRowAtIndexPath:
I'm not 100% sure when you want the navigation bar to go non clear. If its when the image goes off screen then didEndDisplayingCell should be good. If its when the cell bottom passed under the bottom of the navigation bar then scroll view might be your only option.
This will also bounce as you expect when you pull down and it should snap back to the top.
Hope this helps.

Mimic iOS 7's Home Screen Search Bar on my app

I want to implement a search bar in my app which mimics the one on iOS 7's home screen. When I pull down, I want it to bounce down while having enough room on top for the status bar, and I want my current view to move down to make room for the search bar as well. How should I go about with this?
My current thought is to make a new UIView class, add a UISearchBar to it and add that view to my current view (So that I can scroll down to display the search bar). But is there a better way to do this?
This is how it looks like on the iPhone home screen
http://static.trustedreviews.com/94/000028d08/1a0e/Spotlight-Search.jpg
As you said you could create a UIView with a search bar in it. Add it to your main view and set your searchView origin.y to be less than 0 so it will hide below the top of the screen.
Next you could use a UIPanGestureRecognizer to track the dragging of your finger and update the origin.y of your searchView while you drag..

How to build full-screen scrollview and hide nav bar without moving anything

If you look at a photo fullscreen in the iOS 7 photos app, the nav bar and toolbar fade away but the underlying scrollview isn't scaled or shifted. I've been trying to recreate the effect in Interface Builder using autolayout but every time I hide the nav bar it pulls the scrollview up.
What I start with:
What happens:
What I want to happen:
Has anyone implemented this before? It seems like no combination of autolayout constraints, scrollview insets, and automaticallyadjustscrollviewinsets is giving me what i want.

Resources