Custom View at the bottom of navigation bar - ios

I need to add a custom view just below the bottom of navigation bar. My requirement is that when certain condition meets, I need to show a view of 80 height which needs to be sticky, for all remaining subsequent screens. Its like what music streaming apps pandora, Spotify have it when you start playing a song but it is at the bottom, but I need to have a view at the top. Any helps

I am not entirely certain about all the mechanics of how you would do it, but You may want to start by adding the view that will have this sticky content to the root viewController or navigationController, and do it like suggested in this post:
iOS Floating Video Window like Youtube App

So, this is how I solved it, but instead of custom view at top, I end up showing at bottom only, requirements changed. To do that I was maintaining a root view controller which has tab bar inside it, and it also has custom view, so it was easy to manage that by this hierarchy, as root view controller can easily show and hide the view, and also it remains persistent irrespective which tab user go. But I still don't know how to do at top, which was original requirement.

Related

Using RealmSearchViewController with a UITableView

I'm developing my first app in swift, which has a table that shows data stored using Realm. I've managed to add stuff to the Realm and show it in a table. Afterwards I wanted to add search capability and stumbled upon these two guides: http://www.raywenderlich.com/81615/introduction-to-realm and https://realm.io/news/building-an-ios-search-controller-in-swift/. I would like to use RealmSearchViewController, but I can’t seem to fit it to my setup. I tried using a UITableViewController embedded in a Navigation Controller, but I need a button at the bottom of the screen, where the user should tap to add an entry to the list. I tried using a tableFooterView with a button, but it can only stick to the bottom of the table and not the bottom of the screen. I also tried using a Tool Bar and a Tab Bar in the Navigation Controller, but it doesn’t show as the table takes up the whole screen.
What I would like to achieve is something like Airmail for iPhone, where there’s a Tab Bar at the bottom that is hidden when the user scrolls. Above the Tab Bar I’d like a table with content from the Realm, and then a Search Bar, which is directly below the Navigation Bar. I’d like to use RealmSearchViewController as it makes searching a lot easier, but how can I adapt it to be used with a Table View and not a Table View Controller?
Any other suggestions as to how I can achieve the same functionality?
Thanks!
My recommendation would be to create a parent view controller that arranges the the view of RealmSearchViewController so that it doesn't cover the entire screen, and then arrange a UIButton at the bottom.
You can do this in a Xib/Storyboard by arranging a view and a button with autolayout and then simply add the view from RealmSearchViewController as a subview to the view in this parent view controller.

Common bottom view which is Present in all other views and it is pull-able in iOS

I want to Show a common bottom view,which is present in all other view controllers even Navigation view doesn't hide this bottom view and this view has pull-Up, Pull-Down animations For Example Gaana App in AppStore
You can either add the button on keywindow of the app or make different view and call it on a single viewcotroller
second one is better than the first.
I recommended use This library some modification you get you want click here

Setting up iOS Navigation Elements

I am having difficulty figuring out how to set up my UINavigationController to get the result I want. Most succinctly, I want to mimic the navigation of the app BriefMe.
Specifically, I want:
a main view (v#1) that segues to a new view controller (v#2) with an embedded UIWebView
to permanently hide/disable the navigation bar and toolbar on v#1, but I do want a toolbar on v#2 (ideally which shows/hides on swipe -- I figure this can be solved with a UIGestureRecognizer if not through the NavController's hide on swipe/tap property)
v#2 to segue back to v#1 on a swipe from the left edge of the screen, just like the default NavController behavior, shown here.
I've run into two problems with my attempt to set this up:
I can't permanently hide the navigation/toolbar on v#1 while leaving v#1+#2 embedded in a NavController. Without the NavController, I don't retain the swipe-to-segue functionality when v#2 is at the top of the stack
Allowing the WebView to scroll disables/'intercepts' the swipe-to-segue functionality. My only thought is to disable interaction with the WebView, place the WebView in a ScrollView, and allow only vertical scrolling on the ScrollView. Will this allow the swipe-to-segue to work?
If I understand your questions correctly:
We’re still popping a controller from the stack during the transition. We just add the navigation bar as a subview of the controller’s view at the top of the stack and then set up the back event manually.
We ended up using a version of the answer specified here. We added an extra invisible thin column overlaying the left side of the webview because some webviews were still giving us trouble.
Hope that helps!

How do I make a now playing bar like in media player apps in iOS with XCode?

I am making a media player app. I have UITableViewControllers that are embedded in Navigation Controller. I would like to somehow make a view that would overlay potentially multiple (2?) of these tableviewcontrollers (one that shows the user's playlists, and the next would show the tracks in the playlist), but only at the bottom, like a now playing bar in (e.g.) Spotify's iOS app (as in the left bottom side of this
or as in this
I have tried to drag a Container View into my Navigation controller (in which my TableViewCell is embedded), but it won't let me drop it there.
It looks like I can drag the Container View into my TableView, but then how would it remain there when i navigate between tableviews?
Trying to follow #Rintaro's suggestion, but I'm a little new to XCode. How did you do this? So I made a single view application, i added a container view to the first VC, it's imm drawing it somewhere else in the storyboard, but i can't figure out how to tell that view that it's a navigation controller. also, as soon as i add a second container to the first VC and tried to size it, the first container disappears! It is still listed in the hierarchy on the left, and still has an arrow pointing out of it, but the view controller that was added and was being pointed to is also invisible?!
UPDATE: This works very well, but it has a problem with orientation changes. how can i make this work in both orientations? (I hypothesize that it currently positions the "nowplaying view" off screen when the orientation changes).
Basically, view hierarchy like that is constructed like this:
Using two "Container View" in initial view controller, one for Navigation Controller, one for "Now Playing Bar" view controller.
ADDED:
"Main Container View Controller" would be your own UIViewController subclass. It will have responsibility to show/hide "Now Playing Bar".
Workaround for Interface Builder strange behaviors.
You can set Auto Layout constraints like following. Maybe you might want to select the view from the left menu.
Note that, you should uncheck Constrain to margins check box.
Container View for Navigation Controller:
Container View for Now Playing Bar Controller:
And then, Update Frames from the menu:
If you are manually placing any buttons with absolute coordinates, make sure that you update the coordinates of them when the rotation is changed.
Obviously you need to create a custom UIView class, where you will show this menu. And when you will create it, add it to your view just like here:
float y = ROOTVC.view.frame.size.height - 49;
[self setFrame:CGRectMake(0, y, 320, 49)];
[ROOTVC.view addSubview:self];
[ROOTVC.view bringSubviewToFront:self];
I would simply add a nowPlayingView to the appDelegate.window and adjust either:
The window.rootController.view frame to avoid overlapping the nowPlayingView.
If window.rootController.view is a UIScrollView, adjust its contentInset.bottom to avoid overlapping the nowPlayingView. You can also use transparency/translucency with this solution.
Add a dummy toolbar to the controller that will get covered by the nowPlayingView.
If your window.rootController is a UINavigationController, then you have to probably do the above fore each controller you push. The nowPlayingView will stay unchanged on top.

Persistent header in app with UINavigationController

I have a nice iPhone app built that uses a UINavigationController to navigate through a series of tableviews. I now want to add a persistent banner at the top of all of my views, either above the navigation bar or just below it. I do not want it to scroll with the tableview, so I do not want to make it a custom first row.
Any ideas on the best way to approach this?
What I did to achieve this was to make a new UIView for each of the views that I needed the banner on, and placed the banner in there, and the table or other view below the banner. This doesn't keep the banner there persistently through the transitions which is what I really wanted, but I was able to get a non-scrolling header above my tables.
EDIT:
The "correct" way to do this now would be to have a root view controller that consists of your header, and a container view, and then all of the navigation and content goes inside your container view. Although this does require ios6+
You could customize your navigation bar so that it displays the "classical" bar and then, above or below it, it draws your specific content. See this post for more detail.

Resources