UISplitviewController with sliding menu - ios

My split view controller is set as the root view controller in my app delegate.
I need to slide my split view to the right (master and detail view) about 200px, while sliding in a menu view from left to right (left of the split view) at the same time which has a width of 200px. So my split view would slide off the main view while the menu view appears. Ive tried adding a subview to UIWindow which I beleive is not the right way to do it. Ive tried adding my menuViewController to my split view controllers' master view controller. But it doesnt seem to work. Help please!!!

Related

Is it *possible* to make your own Tab Bar Controller?

I have a project where our tab bar has a big middle button (that extends above the tab bar) and other custom behaviors including a badge icon and colored labels.
I got "smart" and decided to just write my own tab bar and tab bar controller to go with it. The problem I've run into is that when one of the tabs is wrapped in a UINavigationController, that view always takes up the whole screen (you can't capture a UINavigationController into a small subview) and so I have to manually inset the content on those views.
Is there a smart way to handle this? It feels gross to just cut the content short on each screen by 100 points...that doesn't feel right at all.
What approach should I take...or should I just automate the content insets programmatically?
A tab bar controller is just a scroll view with a view at the bottom that toggles between the scroll view's offset. I assume you want the tab bar controller to be at the root of your app, so in the root view controller, add a UIScrollView.
Then add the views of the view controllers (the tabs) to that scroll view, and anchor them appropriately so that the scroll view scrolls. Make the heights and widths of these view controllers full screen. Before you add them to the scroll view, you must create a parent-child relationship between the root view controller and its tabs.
self.addChildViewController(tabOneViewController)
tabOneViewController.view.translatesAutoresizingMaskIntoConstraints = false
scrollView.addSubview(tabOneViewController.view)
tabOneViewController.didMove(toParentViewController: self)
tabOneViewController.delegate = self // so that your tabs can communicate back to the controller
// add constraints
Each of these view controllers will ideally be or contain the navigation controller for that section.
Then just add the tab bar to the view of the view controller, not to the scroll view (add this after the scroll view so that it sits above the scroll view). This tab bar is just a regular UIView, most often anchored to the view controller's bottom safe area. Because its a part of the view controller's view, and not the scroll view, it has no impact on the content behind it.
The benefit of a custom tab bar setup like this is that you can navigate between tabs on tap or by pan gesture. To navigate between tabs by tapping on the buttons in the tab bar, simply change the scroll view's content offset:
// this would move to the third tab
scrollView.contentOffset = CGPoint(x: view.bounds.width * 2, y: 0)
Add your bells and whistles and you're set.

Collection View in View Controller, Cell touching the top border of Collection View itself (embedded in navigation controller)

so, i'm trying to make horizontal scroll collection view in view controller. The View Controller is embedded in navigation controller. So the view controller have little spacing on top of cell. And if i resize it, the cell gonna sink. Simply, i want the little spacing dissapear. Normally like Collection View inside view controller without embedded in navigation controller
i want this
to this
i want this
Embed a navigation bar and then drag the collection view. This should hopefully work. If it doesn't let me know..

(Swift) Adding Pinned Navigation Bar to UICollectionView

I have a UICollectionView that scrolls with a bunch of images and I want to have a pinned Navigation Bar on the top that stays there even as you scroll. I moved the cell down in the UICollectionView in order to make room for a navigation bar and I dragged one into the View. I can see it in my story board however it is just a black view when I run the app. Can anyone please show me how to make this nav bar appear and how to make it stay pinned at the top even as you scroll. Thank you so so much. (I tried to attach photos of my problem but it says I do not have enough reputation to post images) I hope you guys are able to understand my problem and direct me in a way in which I could add a navigation bar that stays pinned on the top of a CollectionViewController
Drag a navigation controller into your storyboard. You probably want to position it just to the left of the view controller that has the collection view.
Delete the view controller that Xcode automatically attaches to the navigation controller.
Right click on the navigation controller and drag from root view controller over to your view controller where you have your collection view.
If necessary, move all segues that went to the collection view to the navigation controller instead.

DetailViewController in SplitViewController Displaying in Wrong Position

I'm using a storyboard and auto-layout for an iOS 7 project. I have a SplitViewController with the master view controller and detail view controller relationships set. The master view controller is correctly displaying aligned left, but the detail view is displaying centered, behind the master view, not aligned left like it should be: https://dl.dropboxusercontent.com/u/12009928/2014-03-19%2021.50.43.png
How can I fix this?
Have you checked the view on the Detail Controller, is it properly aligned to the edge of the view controller. Trying giving background colour (other than white) for your Detail View Controller and View to troubleshoot the issue

UIViewController transition from left to right beneath another UIViewControler

I have a container UIViewController with a child that acts as a menu. This loads the other child UIViewController. I would like the other UIViewControllers to animate in and out behind the menu which is semi-transparent. I have only been able to make it work when the other children are above the menu (shorter than the entire screen so menu has room on the bottom) but have not achieved a sliding effect behind the menu. Is this effect possible?
Assuming you are adding menuController view and new viewController view's as subViews to containerViewController view.
First add that new viewcontroller view as child to containerView's view.
Now that view will be on top of menu's view.
Now bring the menu view to top by
[containerView bringSubViewToFront:menuView];
Above instruction makes menu view to be on top of sliding viewController's view.Now do the sliding animation on new viewController's view.

Resources