Is there a way to achieve the iTunes style modal view controller chain (see screenshot)?
I've looked around quite a bit but couldn't find any real questions about this. I'm not looking for a replacement or workaround, just want to know if it is possible to do with the current SDK (or iOS 5.0, although we are not supposed to talk about it a simple Yes/No would suffice).
For those who can not make it out from the image; iTunes on the iPad has this great feature where you can view a movie in a formsheet style modalviewcontroller, and if you click on another movie in that same modalviewcontroller it will create a new modalviewcontroller with the movie info you clicked on and will slide the 'old' one out (to the left). It will slide back in when the center modalviewcontroller is dismissed.
UPDATE:
I'm sure it has been done before, but I wrote my own implementation. It turned out not to be very difficult, although it misses some context-animations (like the flip from position), it is pretty usable. Since I wrote it for iOS 5, I will make the code public this fall when the NDA is lifted.
I suspect that it's a single modal view controller with a scrollview. The scroll view has a semitransparent background and displays several "pages". If you take that approach, I can't imagine it being too difficult to implement.
Related
I am fairly new to swift and iOS programming, and I've been watching video tutorials of people making things visible and not visible. When it comes to large scale projects I am start to doubt that they have one million features toggling between visible and not visible on the tiny screen.
So my question is, is I am making a tiny app how do I transition from basic view such as logging into a game and changing the login view to actually ingame. How do these type of things work?
What you're asking is the basics of programming on Apple platforms. This can't be simply explained in a single answer. Please, start reading this tutorial from Apple to get the understanding of the MVC concept and storyboards.
In short. You use the storyboard in Xcode to build your screens. Each screen is a scene in your program and represents a view controller. The view controller organizes how data is displayed on a screen and how to react to user input. You can create view controllers in code in Xcode and link these to the scenes (that are also view controllers) in the storyboard. In the code you can program the behavior of the different views that you put in each scene. Moving from onze scene to another is done with segues.
A segue can be made programmatically, you drag iT from onze view controller to the other. Or, in the storyboard boy dragging it from, e.g., from a button to the next view controller. You give the segue na identificeren and in prepare for segue (a method) you can program what data needs to be transferred from the existing to the destination view controller.
I have a SpriteKit game where I want to blur only a part of the screen (the board where the game is played). But at the same time, I want to be able to interact with the other elements (like UIButtons) on the screen. So basically I'm looking for something like a form sheet, but one that blurs what is under it and allows interaction with the main view controller.
So here's my problem. I've tried to:
put the UIVisualEffectView on my main view controller,
present another view controller modally with one of the standard presentation styles and have the UIVisualEffectView in there, or
present another view controller modally OVER full screen / current context and have the UIVisualEffectView in there.
None of these options work for me.
Options 1 and 2 don't actually blur. They produce a solid black box instead. (Although for some reason it blurs when I get a notification or when I pull down Notification Center or pull up Control Center. So I'm facing the same problem as this user.)
Option 3 does blur, but does not allow for interaction with the main view controller.
Does anyone know what else I could try? Or am I not using something correctly?
Unfortunately UIVisualEffectView simply doesn't work well with SpriteKit, even when using SKView. I've tried everything from A to zPositions.
I decided to recreate my UIButtons in the new view controller and present it modally OFS. That way I have access to the beautiful UIVisualEffectView blurring (SKEffectNode blurring isn't pretty at all IMO) and to my buttons. I hope Apple will work on the synergy of their frameworks in future versions of iOS and Swift. Then again, I'm not exactly an expert when it comes to app development, so if there is anything else I could've done I'd love to hear it :-)
I am trying to figure out how to create a "Now Playing" view similar to the one in the Music app and the Spotify app.
Here are a few images of what I'm trying to re-create:
Creating the view is not the problem. The part I'm having trouble with is how to keep the view on the screen at the bottom with the now playing information on it, but then when clicked, flicked, or swiped up, make it show like a modal.
Is this something that can be set up in Storyboard, or is it completely custom? How would you set this up?
Thank you in advanced for the help.
My guess is for Spotify it's custom as their implementation predates storyboards being... I'll use the term "friendly" to 3rd party developers.
However if you're building with the latest Xcode and iOS SDK this should be fairly easy to accomplish by building a container view controller wherein the child view would be everything in the upper quadrant, and you would effectively make that parent viewcontroller (with the now playing view area on the bottom) the root view controller.
As for the flicking / tapping, that's probably just a typical gesture recognizer that loads a modal. I can't recall if Apple's implementation is panning, but Spotify's is. My guess with them is as you as you tap down they load a new VC that's mostly obscured off screen and that's what actually gets panned in.
I'm trying to build an app that has lots of similarities to the Facebook App in terms of the "Storyboard". I'm tempted to do everything in code as I know best but I'd really like to figure out how to storyboard these more complicated UI's.
The Facebook App starts with a login view. When you log in, you get a tab view. In the main tab view, you have a table view. Within each table view are a user, post, and comment buttons which push to a new view.
So the way I am understanding it is we have UINavigationController with the .navigationBarHidden set to false. The first view controller here is the loginViewController. When the login button is pressed and the user is logged in, we performSegueWithIdentifier to a UITabBarController. The first tab is a UINavigationController with a UITableViewController as the first view controller. Clicking user, post, or comment pushes the appropriate view controller onto the NavigationController.
This all begins to seems a bit more complicated than just writing this all out in code. I'm also not even sure this implementation is correct with all these nested view controllers. I'm not sure this is all possible with storyboard as well: for example a navigation controller for pushing to comment, user, or post views doesn't seem possible with storyboard.
I'd like to know the correct way of implementing this kind of UI design. And should / could this be implemented using Storyboards?
Your design team may layout the app using a "storyboard" (physical objects -- not the digital version). Large apps are hard to piece all the little things together on a storyboard. Just too many wires going every which way.
Look at the FB app without internet access and you can see their basic building blocks easier. Its built in units (post at a time) that are added to a scrolled view. Search bar and menus at the top and buttons at the bottom with the scrolled view in the middle. The posts probably have some common base class with various types derived from it (picture, video, links, etc).
There is some sort of background process monitoring the position of the scroll view to dynamically load new stories if you get down within 1/3 of the way to the bottom. Within each post you can see the components if you look closely and think about what sort of block that is.
The IMDB app for iPhone seems to allow infinite drill downs and explorations from a movie detail page to a detail page of an actor who was in that movie, to that actor's first movie to that movie's director, etc.
What is the best way to build this in Xcode?
Be sure to check out Apple's UINavigationController documentation/sample code here. You can learn a lot about iOS development from looking at the sample apps.
The "infinite drill down" you're referring to is the act of "pushing" a controller onto the current stack of controllers. As you go back, you "pop" a controller off the stack to get back to the previous controller. If implemented properly, UINavigationController will handle things like making sure the Back button contains the title of the previous screen, keeping the screens in order, and the sliding motion.
Good luck!
You can create by using a UINavigationController and push the view one by one as you want.