How to make a view controller appear from the left and to not fill the full view? - ios

How to make a UiViewController appear from the right of the screen, the same way as this application(Break) does on iPad.
https://itunes.apple.com/us/app/funny-videos-pics-by-break.com/id342257973?mt=8
In fact, I would like that my UIViewController appears on the screen from a side and not to fill the entire UIView of my main ui view controller. The background view should also be darken.
To sum up, I would like to mimic the same Break's behavior.
Here is a picture if needed
Any idea ? Thanks for your time !

You may need to just do some manual work with UIViews. So rather than push a viewcontroller onto the stack you would overlay a semi transparent black view over your background view to darken it and then simply do an addSubView of the view you want to show on top.

Related

UIViewController transparent background colour

I'm trying to achieve the following behavioural attached in the image and I did it using vies with custom classes, the question is that how can I achieve this using view controllers,
the behavioural works as follow: when tapped and swipe left the previous screen should start appear but without pop from navStack, just slide to show and when user leave his finger will return to initial state which same as above image, I did it by adding a UIGestureRecognizer on this white slide edge start change the x position for the upper view but, both upper and previous are views not UIViewColtrollers, the question is how to implement this using UIView controllers or make the background colour of the upper view controller transition colour.
have any idea about this or do sth like this before to help ?

Add a UIImageView to the back of NavigationBar (NOT background image)

I am trying to add a UIImageView to the back of a navigation bar.
The reason is because I want to create a UITableView whose navigation bar is actually a picture (with back button on the left) but I want the picture to scroll with the tableview and when the picture is fully scrolled out. The navigation bar is shown as per normal.
My solution to this problem:
Add a UIImageView to the top of the UITableView and make the navigation bar transparent. Set a contentOffset for the UITableView which is a subclass of UIScrollView so that when the view is presented, it looks like the picture is filling the navigation status bar.
Problem:
If I scroll up, instead of bouncing back, the transparent status bar is shown (with a color of the background as it is transparent).
Possible way to solve this new problem:
I was thinking of trying to limit the ScrollView size to get around with problem but failed.
So I feel is it possible to add the UIImageView to the "back" of the navigation bar so that it is there without any offset? Since that way, my life will be much easier.
Any suggestions on solving this or another new approach to get the same UI/effect?
Related question.
I would do this by adding either a table header or cell at the top of the table which contains your image.
Create the table view so that it extends all the way to the top of the screen. Extend Under Top Bars option. I have not done this with a UITableViewController but I have done this with a UITableView embedded inside a UIViewController's view with the top constraint set to 0 for the view rather than the top layout guide.
Now when you run this your table will fill the whole screen and the top header or cell will be at the top showing your picture.
When you scroll you can either use the UIScrollViewDelegate to detect the movement or implement tableView:didEndDisplayingCell:forRowAtIndexPath:
I'm not 100% sure when you want the navigation bar to go non clear. If its when the image goes off screen then didEndDisplayingCell should be good. If its when the cell bottom passed under the bottom of the navigation bar then scroll view might be your only option.
This will also bounce as you expect when you pull down and it should snap back to the top.
Hope this helps.

iOS - pushViewController without sliding Background Image

Messing around with pushViewcontroller due to one of the awkward requirement :/
So there is a rootViewcontroller with 1 Background Image and UITableView with custom cells and there is a detailViewController with similar backgruound image with different views.
Requirement is:
On tap of UITableViewCell... the whole navigation animation should not affect the background image. Background Image should stay as it is and all other view should slide.
How I can slide only UITableView and display detail screen without changing background image ?
There is one possible solution is just add 2 child view controller and apply slide animation on both child. But in that case I have to keep on removing the child. I can't remove child because on tap of custom bottom back button I have to display the 1st screen instantly.
Any other possible solution or improvement ?
You can wrap your UINavigationController in a custom view controller that contains the background image. Then make sure your content view, as well as the pushed controller's views have a clear background.

Empty navigation bar appearing in subview

I am trying display a UITableView within a larger UIView in an iPad app, mainly because the data is pretty sparse and I'd like to have the table be a smaller area over a background image, rather than taking up the whole screen. The parent UIViewController is correctly set as the table data source and delegate, and the table looks/functions like it should. The whole view is embedded in a navigation controller; the overall UIView shows a navigation bar, as it should, that I can configure normally.
The problem is the UITableView subview also shows blank space at the top for a navigation bar--empty space above the first cell--and I can't figure out how to get rid of it. I know the space is related to the navigation controller, because when I delete the embed link in the storyboard, the space goes away. The table view doesn't present a UINavigationBar property or any other navigation-related properties that I can try to nullify.
I would post a screen shot but I don't have the rep yet.
Can anyone explain where the space is coming from and how to nix it?
I suspect the answer is related to the Top Layout Guide for the view, but I can't diagnose the specific problem.
Here's a workaround from the storyboard: Insert a UIView in the scene, then drag the UITableView into it as a subview. Check the box for the new UIView's "Clip Subviews" in the attribute window, and then use it as a mask, basically, to cover the undesired top margin of the table view. It works and doesn't require any coding, but there has to be a better way.

Flipboard ipad app: right menu panel slide effect

how to implement right panel slide effect like following picture? when click left area, the right panel is hidden.
picture url http://cdn.thenextweb.com/wp-content/blogs.dir/1/files/2012/02/photo.png
I think
it is not popover controller.
is it a view added by using "addSubview"? I don't think so because it is a navigation controller,it seems that view in navigation controller can't be added by using addsubview
is it a modal view? if yes, how to implement semi transparent background? if use UIModalPresentationCurrentContext to present modal view, parent view can't rotate when ipad is rotated.
Any help is highly appreciated! Thanks.
These are all likely highly customized view controllers, and view controller containers.
You can fully control the presentation of your view controllers by adding them as children of another view controller, and adding their views to the view tree manually -- using any animation you choose.
The dimming effect you see can be achieved by overlaying a "dimming view", for example a black 50% opaque view.

Resources