layout views in slide menu in iOS - ios

I am using SWRevealViewController as a slide menu in iOS. When I created the rear viewcontroller (the slide menu) a xib file was created with .m and .h files. I do not use autolayout and set the simulated metrics size as None.
The view seems all right when slide in and out on iPhone except that when the view is presented on iPad I want the positions of the menus to also change as the view becomes bigger but it doesn't.
Originally the view is as the image below shows:
In order to move the "settings" menu to the bottom I have made changes to the view settings of "settings image", "settings button" and the extra UIImageView as below:
but I want the settings menu to also locate at the bottom of the view just like it is now on iPhone. How can I do that?

I have used "Masonry" library to sort this out.
It is pretty amazing.
Check out Masonry from GitHub

Related

Navigation bar not occupying entire screen

Im trying to create a UINavigationBar using storyboard but the UINavigationBar is not occupying the entire screen.
Following is the screen shot of my storyboard.
In storyboard, it appears to occupy full screen width but in my device, the width is not full. How can I sort this out?
select your viewController and go to XCode Menu - > Editor -> select Navigation Controller ,
for example
you get the output of
it works fine for any layout patterns
firstly you have to disable size classes and auto layout in the file inspecter for your view after then set your navigation bar property like as shown in screenshot. It will be applicable for all the devices.
1- Select your element.
2- Click triangle button at bottom right.
3- Click Add Missing Constraints
use autoresizing selecting your NavigationBar:-

Using Autolayout and universal storyboard super view is not taking the full screen?

I am developing an iOS application using Universal Story board and autolayout. The base views of my view controllers are leaving a space at the bottom and are not taking the full height of the screen. What could be the reason behind this?
Go to property area in the storyboard and choose your main view then select all the lines which is available in that area. then it holds the full view of the page.
It looks like your view is taking up the whole screen but is hidden behind a tab bar.
This will happen when you include them inside of a UITabbarController. The reason they reach down underneath the tab bar is because it is translucent (you can see a blurred version of the view through it).
This tutorial from Ray Wenderlich gives a good example and explanation of how to set this up in a storyboard.
https://www.raywenderlich.com/50308/storyboards-tutorial-in-ios-7-part-1
Actually the "Show Toolbar" option for my navigation controller was checked. The space at the bottom was taken by the toolbar.

How to use Bottom Bar together with SpriteKit?

I created a sprite kit project and was trying to add a bottom bar to it. However, after selecting the "opaque toolbar":
Game View Controller > Attribute Inspector > Simulated Metrics > Bottom Bar > Opaque toolbar
While the toolbar does appear in Main.Storyboard, it does not show up in the simulator.
Whats going on?
You are adding a "Simulated Metrics", this will only add a bar in the Storyboard (it just helps the developer to see graphically how it should show in the real device, and helps with constraints).
You need to add a UITabBarController in the storyboard. (you can drag and drop and you will see how it works)

iOS7 - unable to embed a screen in a scrollview

I have a screen that doesn't fit into a 3.5 inch phone screen. In iOS 6 I had the contents of the screen in a scroll view, but in iOS 7 that option is constantly grayed out.
Here is the screen shot
Would anyone know how to add the scrolling to my screen in ios 7?
Thank you!
Second screen shot with the scroll view.
Rather than selecting the entire view controller, you need to have a view selected. The options in Editor -> Embed In are contextual and since you have then entire view controller selected, your only options are to embed the whole VC within a Navigation Controller or a Tab Bar Controller.
If you can't get the right selection by clicking within Interface Builder, try expanding the outline view and selecting your view. Then try to embed your view within a scrollview.
Note that your root view must be a UIView, so you won't be able to embed the root view in a scrollview because that would put a scroll view at the root.
Three problems I ran into that I hope can help:
1) Make sure "Safe Area", or other object that shouldn't be there, isn't one of the objects selected in your view while trying to embed. For a simple test select just one simple object like a textfield or label and see if the Editor -> Embed In is still greyed out and work backwards if you have to.
2) You're going from View > Content to View > ScrollView > View > Content. So after embedding in a scrollview, embed in a view.
3) Once embedded make sure your scrollview is less than your content size, or it won't scroll: https://stackoverflow.com/a/28146729/1323357

control-drag from view controller in ipad storyboard to toolbar not auto-scrolling storyboard

I just saw a video demo of control-dragging from the view controller icon for an ipad storyboard at the bottom of a view controller to the toolbar within that view controller. While the view controller icon and the toolbar are not on the screen at the same time, the dragging actually scrolls the storyboard enabling the connection between the two.
However, in my ipad storyboard I am unable to make that auto-scrolling happen and thus unable to complete the control-drag.
Is there a way to make the storyboard scrolling happen while control dragging? I thought of temporarily moving the toolbar to the bottom of the screen to make the connection and then moving it back. But the storyboard won't auto-scroll to let me do that either. I'm using a 13" macbook pro. There appears to be no zoom setting that will have both on the screen at the same time.
Alternately, can someone tell me if there is an alternate way to accomplish that? Which part of the code would I control-drag to?
Thanks.
according to this, one can accomplish the same by control-dragging to the icon of the corresponding element (in my case the toolbar) in "document outline pane" which sits between the project navigator and the (storyboard) canvas.
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/SecondiOSAppTutorial/GettingStarted/GettingStarted.html
doing so would bypass the inability to autoscroll within the storyboard.

Resources