How to mimic Android Bar on iOS? - ios

my designer created this layout:
How can I mimic that on iOS? I tried creating a Segmented Control but didn't work well because it can't be customized after iOS7. So at the moment I'm thinking about a UIPageControl with custom dots like explained here: Customize dot with image of UIPageControl at index 0 of UIPageControl
My problem is also with the concept. Segmented controls are said to be used to flatten/filter results according to iOS human guidelines while UIPageControl has actually different pages...
Is this the best approach? If so, can I make it look like the Android Tab bar?
Segmented control with custom image
UIPageControl with custom image
UITabBar on top (read too many bad things about this approach)
something else
If UIPageControl is indeed the best/correct/possible approach how can I make it look as close as the image? And also move it to the top?
Thanks!

Short answer: Don't do that. You're trying to implement Android controls on iOS. That leads to user confusion and an app that doesn't feel like a native app.
Instead, have your designer create a native app design for both platforms.
It looks to me like the closest analog to what you're trying to do is a tab bar and a tab bar controller (UITabBarController).
EDIT:
If you must implement this UI on iOS, you might have to roll your own. You'd create a new custom parent view controller with a child view controller that you could swap out, and a custom control that triggers the swapping. Conceptually it would be a lot like a tab bar controller.
You could probably set it up using a container view and an embed segue (The embedded view controller would be the starting child view controller) and then use the built-in support for managing child view controllers to swap out the child view controller when the user taps on your control. I've done this sort of thing before. It isn't that hard, and is pretty well documented.

Related

Name of iOS ui element

How does this half screen scrollable pop up elememt is called in iOS? Have seen it in many apps so I guess it should be native one.
Even though it's common, it is not a standard UIKit element. It's a custom presented view controller (not a standard configuration). You'll need a custom transition animation and presentation controller along with gesture recognizers for dismissal. (There are lots of tutorials showing you how to do that.)
New in iOS 13, all presented view controllers have this general configuration by default (called "sheet" or "card"), but not half-screen like the one you've shown (they almost fill the screen).

Xcode Swift how to place UIViewController beneath parent UIView Controller

I would like to make similar effect that Facebook app has. So I would like to create navigation slide-out effect.
But when I place UIViewController with menu beneath parent UIViewController with content and then I move parent view aside my menu doesnt show up. Everything I can see is black screen. But menu frame is in the right position.
Any sugestion what should I do?
Content view will be separate UIViewControllers.
I was in the same situation than you and finally I used a custom class which is inspired on FaceBook and Wunderlist apps and is really simple to add into the project:
https://github.com/John-Lluch/SWRevealViewController
The child view controller is always above parent view controller's view.
I think the old and the new view controllers should be siblings and use a parent view controller to add them both.
In fact, the child controllers of native UINavigationController are siblings rather than child-parent relationship.
I would urge you not to do this on your own but to use one of the many libraries out there that have been heavily tested by many contributors. One of the good ones is MMDrawerController but there are many others. Take a look at cococontrols for many more examples.
I've previously implemented a similar mechanic to this using custom transitions, which were introduced in iOS7. For example: could present the menu modally, but using a custom transition have it appear from the left and only take up a proportion of the screen.
Using custom interactive transitions will also allow you to use a pan gesture recogniser to drag your main view controller back on top of your menu - like in the Facebook app.
Here's a good tutorial on Custom Transitions: http://www.thinkandbuild.it/ios7-custom-transitions/

How to implement page switch by scroll gesture which is already implemented in iOS7?

It's nice that back to previous page is so easy by swipe gesture in iOS7, Apple has implemented for you already. We like this feature, but how to implement it on iOS6? Any resource can take reference? Such as open source or design solution.
Please share and thanks in advance.
I'd probably be inclined to use UIPageViewController (which is a nice control that offers swiping between view controllers). If you really want to reproduce the UINavigationController iOS 7 UI (swiping from edges rather than anywhere on the page, all of the navigation bar UX, etc.), it might take a little work. But if all you need is a nice simple swiping between view controllers, UIPageViewController might be a good place to start.
See the Page View Controllers section of the View Controller Catalog for iOS.

multiple "content views" on the same xib

I have a ViewController (with navigation) that needs to show 7 different content layouts. I want to keep the same background and nav, the only thing that needs to change is the central UIView.
If I have 7 different UIViews on the same xib/storyboard, can I hide the ones I'm not using or will that ding performance?
Using segues won't work either because they make a mess out of my custom navigation and animations.
Is there a better way to accomplish what I am trying to do? Thanks for suggestions
solution
My design is too custom for using view controller containment so I decided to mimic the idea with a custom UIViewController and two UIViews. It's not too bad and it works rather quickly.
You should look into using view controller containment, then you can load your views from separate nib files and still provide your custom navigation and animations from your container view controller.
Note: This is only really supported from iOS 5.
Generally, it's a good idea to unload views that aren't visible, however, if your views aren't using too much memory (and/or cpu time) hiding them when they're not in use should work fine.
View controller containment is probably what you should be doing if each view has its own unique functionality (i.e. view 1 is a map, view 2 shows some about text, view 3 is an image gallery). UITabBar might be useful, but it depends on your app.
The performance hit would depend on your views' contents. If you haven't done so already, invest some time into learning how to use Instruments (apple's diagnostic tool). Watching the video titled "Optimizing App Performance with Instruments" in the developer resources would be a good start.
My design is too custom for using view controller containment so I decided to mimic the idea with a custom UIViewController and two UIViews. It's not too bad and it works rather quickly.

Place UIToolBar above UISplitViewController?

I'd like to place a UIToolBar above a UISplitViewController but Interface Builder will not let me do so (using the standard split view template as a start). I know I can implement different tool bars in each of the two views within the UISplitViewController, but I want one seamless bar that lies outside the frame/bounds of the controller, directly above it and right under the status bar. Please help.
Thanks.
This is not supported by the UISplitViewController. If you need this sort of UI you would typically create a custom setup to achieve this.
I'd construct a setup using two UINavigationControllers that are controlled using my App Delegate and just take it from there. There will be some extra work for you, handling rotation, but that's to be expected when doing custom stuff.
This shouldn't be too hard.

Resources