Present a view controller just before the UIDocumentBrowserViewController to be shown at launch - ios

Here are the facts: I have a document based app using iOS 11's UIDocumentBrowserViewController. And as noted in the documentation, I set it as my root view controller:
Always assign the document browser as your app's root view controller. Don't place the document browser in a navigation controller, tab bar, or split view, and don't present the document browser modally.
I have an animated launch screen in another view controller and in an usual app, it is the root controller. But here it can't be...
So my problem is that I can't achieve the smooth transition between the launch screen and the animated splash view controller.
I've tried to perform the segue unanimated to the splash in the viewWillAppear and in the viewDidLoad of the browser view controller... But between the launch screen and the splash screen, I have a glimpse of 1 second or two on the browser...
I even tried to present it over the browser view controller inside the applicationDidFinishLaunching but I have the same result...
So if anyone has a clean way of doing it, I'm interested. I would not like ending by inserting savagely views over the browser, if you see what I mean. 🤔
Thanks in advance.

Please watch the Managing Documents in your iOS apps WWDC session tomorrow. This restriction is about to get lifted. You can present the document browser modally full-screen over your splash screen, as long as you do not dismiss it afterwards (it needs to be at the "root" of your app for usability reasons). Don't forget to release any memory used by your splash screen once you present the browser.
However, I think a cleaner design would be to present your splash screen over the browser in viewWillAppear, as you suggest. If that doesn't work, could you please file a bug at bugreport.apple.com? Thanks.

Related

Custom animation in Launch Screen

I have created a new project in Xcode 7 using Swift. I noticed that the launch screen is stored in the storyboard file.
So I think if it could be customised by referring it to my CustomLauchScreenViewController. However, when I set the custom class name in LaunchScreen.storyboard, it throws an error:
Launch screens may not set custom classnames
So what is the best way to customize the LaunchScreen? I intend to use the LaunchScreen to load some data before launching the main screen.
That's not the purpose of the launch screen. What you can do however if have your first initial viewController 'act' as a launch screen. Just have it display the same image as the launch image and do what you need to do in there. Once you are done, move to your main viewController from there.
The launch screen is shown before your app starts executing in order to provide a transition from the Springboard to your app while it is loading. According to Apple interface guidelines,
A launch file (or image) provides a simple placeholder image that iOS displays when your app starts up. The placeholder image gives users the impression that your app is fast and responsive because it appears instantly and is quickly replaced by the first screen of your app.
To achieve a transition, remove the class from LaunchScreen.storyboard and set it similar to 0% loading transition. Create a new controller in your Main.storyboard and set CustomLauchScreenViewController there and assign this as initial view controller.
Set CustomLauchScreenViewController as your root view controller in your app delegate. When launch screen will be replaced by your this controller, transition is too smooth to feel any difference. After loading the data, change your root view controller to required View Controller.

iOS UINavigationController loading to white screen but app is running

I'm developing an app with a single ViewController. When I run the app, it goes to that default LaunchScreen that is included when you start the file, and then proceeds to the ViewController. Everything is fine, it loads and does everything it's supposed to, which includes some audio feedback.
From my storyboard then, I've clicked on the existing ViewController and then Editor -> Embed In -> Navigation Controller. Navigation Controller appears, the Storyboard reflects the Navigation Bar on both screens, and the Navigation Controller has "Is Initial View Controller" checked. Great.
Now, however, if I run the app, the LaunchScreen goes and then a blank white screen follows. No navigation bar, none of the original interface. However, I still get my audio feedback - the app is running just fine.
So what's going on?
Let me know if there's anything you'd like to see (code, screenshots, etc.).
I was using PixateFreestyle to style some elements. At some point it seems I had rather heavy-handidly added:
view {
background-color:#ffffff;
}
Which covered the views nested in the root view controller. Figured it out when I noticed copying my classes to another project resulted in the same issues and started commenting out chunks. Took out the Pixate initialization and regained my view.
Thanks to everyone who offered help. If nothing else, I learned more about debugging iOS apps.

Getting a black screen using the SWReveal Controller

I am having an issue with a black screen appearing on my app using the SWReveal Controller. I had it going fine with a view controllers set up and behaving as expected, not sure what has changed to cause this. The initial splash screen displays then straight to a black screen. I have tried reseting the simulator and readding the intially controller but it seems to get upset when I reconnect the segues to the relevent views.
Any direction on this would be great. I don't want to redo the app; I’d rather figure out the root, in case this happens on another app further down the development life-cycle.
Follow this link.
http://samwize.com/2015/03/25/setting-up-swrevealviewcontroller/
You have to set front & rear view controllers.

how to present a login, with UISplitViewController?

I'm trying to build a universal iOS app. So, in Xcode I started with a Master-Detail template.
In the iPhone version of this, my first view is a list of items, and I have a "Logout" button in my Navigation Bar. When the user launches for the first time, a view-controller is presented, modally, on top of my normal "master" view. It just asks for a user/pass, lets the user log in. If the user hits the "Logout" button, some cleanup occurs, and then they are presented with the Login screen again.
On the iPad side of things, I'd like to have a UISplitViewController - as that interface matches well with what I'm trying to do. I'd like to do this in a similar fashion -- present the user with Login the first time they launch. Then later on, if they decide to leave the app, they can hit Logout, and be presented with Login options again.
I'd prefer to cover the entire screen with one view (just user/pass/login button), but am having trouble figuring that out, especially if the "master" view is visible.
So, the question is this: what is the preferred way to show a login screen, with a UISplitViewController in the mix, so that the user can't do anything else but login?
This really sounds like a personal choice/design decision.
You could have the "master" view be the login screen and have the "detail" be just a splash screen or cute kitten photo that says "please login"
You could also have a single UIView be the "initial" view page and have that segue into the splitview
I think you're quite open in the "how" of it so perhaps I'm not quite understanding your question.

How to make the landscape view look same as the portraitView while using a splitViewController?

What I meant is, When we use a UISplitViewController project
In portrait mode, whole window will be covered by the view and a popoverController will be presented to navigate to other views. In landscape mode, 40% of the window will be covered by a tableView using which we can change the view/page. And navigation button as well as popoverController will be hidden.
What I want is,
Even in landscape mode, it should be like portrait mode. No tablewView should be there. Whole window should be covered with the view in landscape mode. For navigating to other pages, a navigation button as well as the popoverController should be there.
How can I do this?? Plz help me...
Login to your developer account, goto dev forums and search for "UISplitViewController settings.app". there's lots of talk about that there. The summary is you can't do it though that controller apparently has some private features which make it possible (file a bug report telling apple they should expose that capability). There is a long discussion about building a splitview controller from scratch that mostly works this way. Alternately, rethink your design.

Resources