Can I move from a login View to a SplitView in an iPad application? - ipad

Hope there is not an answer yet (I've checked). Can I introduce a login View in my application that enables a SplitView by using a button or something?
I've checked MGSplitViewController, but I'd like to use something more light and minimal.
If it's not possible, can I introduce a login View in my DetaiView that enables a TableView?

You can transition between arbitrary view controllers in iOS. The usual ways are using modal presentation (I like to present splash screens with a cross-dissolve animation to the root view controller of the app), or pushing/popping with navigation controllers. You can also programatically swap between multiple views in a view controller via setting the "view" property.

Related

Bottom toolbar for all screens in iOS

I am new to iOS development and have a question about what component I should be using for a particular UI aspect. The app I am working on has need for a toolbar to go across the bottom and at times to be visible across all screens. This toolbar is going to be used to manage the playing/pausing of some audio files which will play as the user navigates between screens within the app. My question is should I be using a Toolbar, a Navigation Bar or something else to achieve this?
To create such a toolbar you can use whichever component you want. There is no built-in solution on iOS for such a scenario and there is anything in the human interface guidelines that may help you to make this decision.
From my perspective, the problem here is how to make this toolbar visible on all your screens. This depends on your view controllers hierarchy which I know anything about.
Navigation controller
If you use UInavigationController to organize your screens you can use it's built-in toolbar to achieve your goal. The drawback is that the UIToolbar of UINavigationController is per item view controller so you will need to configure it each time a new UIViewController is pushed on the stack.
Containment
The general solution is using the containment API. You can create let's say root view controller of your application which will contain your toolbar and will host other view controllers of your application. For the presentation purpose, I configured it on a storyboard using a container view. You can see it on the image below.
Modal presentations
Neither of above solutions will work when you decide to display a view controller modally. In this case, you will need to make additional effort to put the toolbar in such a view controller.
Other options
You probably won't be able to achieve that using UITabBarController unless you are very stubborn. But if you are new to iOS I don't recommend trying. The same is for UIPageViewController. I'm not sure about UISplitViewController because I have a very little experience with it.

How to Share a View Across a Navigation Hierarchy with No Animation?

I have a simple Navigation View Hierarchy that has 2 views it goes between. I wanted a customized navigation bar, so I have the default one hidden, and I've implemented a Container View which is shared between the 2 views in the nav hierarchy.
Everything works as I want it to, except when I segue to the lower or higher view the top bar appears slides away and reappears on the new view. I would like it to appear stationary when I push or pop to other views in the hierarchy.
Is there an easy way to do this? Or should I delete my custom shared Container View and try to make this work with the Navigation Bar (which I have currently "hidden")?
I had to do this for a client once. The way we did it was, like you said, make an encompassing view controller that housed a container view. Within this container view, we embedded a UINavigationController and would manually pop and push UIViewControllers to its navigation stack. Of course you want to hide the UINavigationController's nav bar.
It sounds like you sort of implemented this, but instead you just embedded a plain old view controller inside your custom navigation controller, and then segue to another view controller that is also embedded in the custom view controller? Ideally you want one instance of this custom nav controller with an embedded UINavigationController. I believe you will have to do all the view controller transitions programmatically.
Opinion: Personally, I would recommend against doing this. I believe that an app should feel like an extension of the OS it's on. A user should feel it's a part of their phone. Using the native navigation bar also decreases the level of effort a user is required to put forth to understand your app.
I know you're thinking "but it's just a nav bar" but we're talking about the same people that will potentially uninstall an app if it takes longer than 2.5s to load.
I wanted a customized navigation bar, so I have the default one hidden
That's your mistake. The way to get a customized navigation bar in a UINavigationController interface is to initialize it with init(navigationBarClass:toolbarClass:). Now the built-in navigation controller is using your navigation bar! And from there on, all will be well.
https://developer.apple.com/reference/uikit/uinavigationcontroller/1621866-init

iPhone popover controller present view controller fullscreen

I am using a third party popover controller on the iphone and have ran across an issue. The one I'm using is WYPopoverController but have tried using FPPopover and it has the same "issue" since they work in a similar way. Here is the deal:
I have a notifications button in my app which pops up a popover controller which contains the notifications feed. It's like the Facebook app. You can see it on the below image.
Now what I want to do it so present a view controller on top of everything and in full screen. The way that popover controller works is that it ads its view directly to the applications main window and its not nested in the view hierarchy so I get a warning saying presenting view controllers on detached view controllers is discouraged and it does not present full screen as well (I know thats logical). If I present it on the parent view controller (the red one in the background) it gets presented below the popover view.
How to fix this?
I was thinking about using a new UIWindow instance and using a root view controller there. Is this an OK solution or is it a hack? If it's ok then how do I accomplish this? I want the presentation and dismissal to be animated :)
I want it to look like Facebok Paper app when you tap an item in the notifications feed.

Creating a custom navigation controller that controls two views

So I am creating an app for iPhone and iPad. I am currently working on the iPhone version. I need to implement a custom navigation controller that controls only both view controllers that are on the screen. It's better to demonstrate the situation with a few pictures.
So what I want to do is have a navigation controller that can control both of my view controllers and I can push a new view controller on the bottom or on the top with the other staying as it is. I have no problem with doing the basic code like pushing a new view controller, animating the transition etc. What I am asking is more about the "correct way" of making this. Also how can I link the IBOutlets in navigation controller to the custom view controllers in Xcode, if I try to drag it to my view controller, it won't let me, I think it's because they're in different groups(see picture 2). Is there any way to do this?

Objective-C - Understanding view controllers

I understand that view controllers help control multiple views in an application, but I have trouble understanding when to use them.
If I have an application with a main page, several views with a "hierarchy" structure, and an about page not connected with the hierarchy, what files should my application have? An appdelegate, navigation controller and view controller? More than one view controller? Just a navigation controller?
Also, should they all be contained in one .xib file, or multiple .xib files?
Any help would be greatly appreciated.
Thanks.
A good habit is to have a UIViewController for each page you want to show. If I get the structure of your app you should have a main page (with many other UIViews inside it) and another page (about page). If that's true I suggest two UIViewControllers.
The UINavigationController is a subclass of UIViewController that lets you "navigate" among the pages. It's not strictly necessary but suggested (you can also implement your self a custom navigation system, but it's easier to exploit the one Apple offers you). Another navigation system is the one based on UITabBarController, if you want to take a look.
Assuming I get the structure of your app you should need two .xib file, one for each page you have.
The app delegate is conceptually different from a view controller, you'll have just a single app delegate, automatically created by Xcode (you can, of course, modify it to fit your needs).
Each "screenful of content" (Apple uses this term) should be handled by it's UIViewController or more likely a subclass of it. The point of view controller is to handle view appearing or disappearing (going on/offscreen), device rotation, memory management, navigating to other view controllers and so on. If you are creating your UI with IB, then each of those view controllers would most likely have it's own .xib file.
Each view controller has one view (it's view property) that acts as main view for each "screenful of content" to which you then add your subviews.
UINavigationController and UITabBarcontroller are there to help you control the hierarchy of your app. They only act as containers for other view controllers and don't contain any UI except navigation bar or tab bar. Using tab bar controller you can have multiple view controllers which act exactly like browser tabs. Using navigation controller you can have a stack-like navigation where new view controllers are pushed from right to left and are popped from left to right when user goes back to previous view controller. You can even have a view controller inside navigation controller inside a tab bar controller.
If you don't want to use tab bar or navigation controller, you can navigate through your view controllers by presenting them modally using presentModalViewController:animated: and dismissing by dismissModalViewControllerAnimated:. If you send YES for animated parameter of these methods, you will get an animation specified by the modalTransitionStyle property of view controller being presented or dismissed. Possible animations are slide in from bottom (default), horizontal flip of entire screen, fade in/out and half-page curl.
There are also some Apple-provided subclasses of UIViewController that help you setup your UI quicker like UITableViewController which is basically a view controller that contains a table as it's main view and conforms to 'UITableViewdataSourceanddelegate` protocols which are required to define how each cell looks and what it contains.
On iPad there is one additional container controller UISplitViewController and one additional way to present new view controllers using UIPopover.

Resources