How to create paging with a menu at the top? - ios

I'm trying to create something similar to the following:
You see the dates at the top just underneath the search bar? Is that a nested tab view as I'm guessing? Is there a way to do it with the default components or do I need to create a custom view?
I'm not looking for a coding answer per se. I just want to know if there's a standard way of achieving this before trying to implement my own solution.
EDIT:
For future reference I found a library that does exactly this.

Apple's documentation states :
The tab bar interface displays tabs at the bottom of the window for selecting between the different modes and for displaying the views for that mode. This class is generally used as-is, but may also be subclassed.
https://developer.apple.com/documentation/uikit/uitabbarcontroller
So I would guess that it is a custom solution.

Related

How to create compose bar button item like in Messages app

The Messages app on iOS places two bar button items next to the large title text "Messages" in the master view controller with a circled style.
How do you make your own bar button items in the navigation bar have this same behavior?
I think this demo project should give you enough hints to help you.
Addendum: You may be already aware of this, but in case you specifically wanted a search bar as well, there is also a UISearchController ViewController to help with getting user input and populating a TableView with results.
Addendum: Looking into it further, there’s already an SO answer covering this. Additionally, consulting the API reference show that setToolbarItems already supports adding an array of UIBarButtonItem
As far as custom buttons are concerned, check out this reference, there’s a section on customizing appearance. Additionally, the constructor for UIBarButtonItem conveniently supports taking a UIImage as well. If what’s there is insufficient to accomplish what you need, you can always subclass UIBarButtonItem and change the views there.

Xcode 9 Swift 4 Tabbed Page

I know how to use tabBarController.
But I dont Know How to Create A Tabbed Page Like The Attached Image.
Whats The Name Of This Type Of Tab?
This is not any type of Tab. You can use a collectionView or a stackView for "Tabs" and a UIPageViewController for changing viewControllers.
You can check CocoaControls for similar controls, download source code and check their construction. You can possible do it with SegmentedControls (Or Custom UIViews for single Tab and draw in ScrollView) and UIScrollView as Content View (with Pagination On) as well, but it depends how much customisation is needed.
Trust me, it's REALLY tricky to obtain what you want with the iOS components. There are a lot of details that you will miss.
When I tried myself to build the same thing, it was like "ok I think I am reinventing the wheel, is not straight forward as I though, it require a lot of work"
You know you have to consider a lot of stuff like an User that start to scroll as a crazy between the pages and then tap on one tab bar button, and so on. Trust me, it's easy to have a working implementation, but it's really really difficult to obtain a PERFECT implementation
I decided to go for a library
https://github.com/aokizen/SPSlideTabBarController
https://github.com/xmartlabs/XLPagerTabStrip
but there are others that are all good to achieve what you want
Anyway if you want to go for your personal implementation I suggest a Segmented Control in the upper side and a PageViewController (maybe inside a Container View)

How to make an iOS Side Navigation Drawer like the one in Gmail

I have checked out several libraries, videos and online blogs on how to make a side navigation drawer in iOS, but none of them have been able to provide a simple solution to create a side navigation drawer where you are not limited to just a TableView. I want to be able to add different UIViews to the side drawer. This is the kind of Side Drawer I am trying to create :
Screenshot
Most of the libraries cant allow custom views inside the side drawer, but I want to create a small view like this at the top of the drawer UITableView.
So far, I have tried these libraries but each of them lack an essential feature :
https://github.com/mutualmobile/MMDrawerController : Only supports a list of items(basically only a tableview) and not custom views like the one I want to add and like the one gmail has, which displays the profile picture along with the email id.
https://github.com/jonkykong/SideMenu : Same Reason.
https://github.com/handsomecode/InteractiveSideMenu : Animation is too fancy.
https://github.com/evnaz/ENSwiftSideMenu : Only supports a TableView in the side drawer.
After having developed a few android applications, I was quite surprised that iOS didn't have an equivalent of the android DrawerLayout, and when I searched for libraries I could not find a single one that had the right classic design that is most used. I read somewhere that adding a side drawer was a bad design choice, but in my application, I have already used all of my screen space and need a way to give the user quick access to 20-25 list options along with a small view at the top. I figured adding a side drawer was the perfect way to do so, but unfortunately I haven't gotten very far trying to make it.
All help will be appreciated!
SlideMenuControllerSwift will let you stick any viewController with any layout you want into your menu. Its really not that hard to make your own slide out either. Your options are: 1. You make a container and every view in the app goes int he container along with the menu and the container animates the menu in an out. Or 2. You just make a menu singleton and when it gets triggered it adds its view on top of the main window, which will cover the current view controller.
You can try this one also, NavigationDrawer

Create vertical tabbar for ipad

Today I tried to implement a vertical tabbar for iPad. I checked a lot of questions on Stackoverflow and other sites but couldn't find the appropriate answer. Here are what I found:
https://github.com/futuresimple/FSVerticalTabBarController
https://github.com/nst/SEVerticalTabBar
https://github.com/NOUSguide/NGTabBarController
In my opinion, the third component is great. However, I guess I'll have to customize a lot before I can use to create this following UI:
So do you know any components/libraries that match my UI? It would be great if anyone can suggest me a correct one. Thanks.
Try to use FSVerticalTabBarController. I have used it and it is easy to modify...
You can try this component IIViewDeckController. Its very light weight.
Usually it will be used for Stackview, left Menu kind of UI.
But you can do a small trick like below to achieve your design above.
Steps:
The component have left, right, top, bottom and center stack of controllers.
Use a UITableView on your LeftViewController to design your above UI.
Each index will act as a container of OneViewController.
Clicking one cell of your tableview will place the appropriate ViewController in the center controller of IIViewDeckViewController.
Its very easy, I guess you will like it. Just take some time to go through their examples.
Hope it will be useful
I translated futuresimple/FSVerticalTabBarController into Swift 5.
My repo is https://github.com/coyingcat/VerticalTabBar
Apple's doc Implementing a Container View Controller is great also

implementing uitabbar to uitableview

I want to put a uitabbar into a section in uitableview, I have hard time looking a way for it, since I just started doing XCODE in less than a month. Anyone there know the solution for it? Any help is appreciated, and if possible, could you share a link for the tutorial or examples as well. Thanx in advance.
You can't do it in this way. They both are different things but you can have UITableView inside the uitabbar view. But vica-versa is not allowed ...this is not feasible and also not proper as per apple's guideline. So, please make sure not to use in this way...rather go for some other alternative :
like put Custom UIToolBar in header of tableView , having look & feels like Tabbar.
You cannot put a tab bar into a tableview.
I you want to use a tab bar, use it as a sub view of a UIView.
The UITabBar is supposed to contain other views. So no, you cannot add it to your table view. To get the look and feel of the Groupon app, there are two things you could do:
1. Create a custom tableviecell as advised above.
2. Since the toolbar (which looks like a tabbar) is outside the actual table, you can have it as a separate view and reduce the size of the table to accommodate it. Or add the toolbar to the footer view of the table.

Resources