iOS change design orientation in storyboard - ios

I want to make a design that works on both portrait and landscape. I am doing my design in storyboard. Say, for signup view controller the design is working on portrait mode. But I can't make the design in landscape. I googled for couple of hours, but I can't get any tutorial from where I can move ahead.
Can any one please help me?

Use autolayouts for that. Here are some tutorials:
http://www.raywenderlich.com/115440/auto-layout-tutorial-in-ios-9-part-1-getting-started-2
http://www.raywenderlich.com/115444/auto-layout-tutorial-in-ios-9-part-2-constraints
Please note, for working your app in both orientations, enable portrait and landscape modes in General Settings->Device Orientation.

Related

UISplitViewController - Use as slideout-style menu

I'm struggling a bit with the new UISplitViewController in iOS 8.
I want to achieve a slideout-style menu on iPhone (landscape and portrait) as well as on iPad in portrait orientation and a persistent sidebar on iPad in landscape orientation.
I got a UITableViewController as the master and a UINavigationController with a couple of UIViewControllers as the detail in my SplitViewController.
Is it possible to to get something like this with the new UISplitViewController in iOS 8?
First it would be enough the get the iphone sliding thing to run :D
Thank you :)
The UISplitViewController will do just that. Sliding menus and everything.
It works like a dream if you use it exactly by the book. And this requires setup of some UINavigationControllers as part of the magic.
Tutorial is highly recommended for the first time. It's easy to get it messed up quickly otherwise. :)
http://nshipster.com/uisplitviewcontroller/
By default, the UISplitViewController in iOS8 will only act as a slideout-style menu on the iPad (in both portrait and landscape mode) and iPhone 6+ (in landscape mode only).
As to whether or not it is possible to get the slideout-style menu working on all iphones via the splitViewController, I don't actually know (I'm still new to iOS development). I suspect that it entails modifying how the splitViewController treats different size classes. If there isn't an easy way to change the splitViewController's behavior, perhaps you could subclass the splitViewController and override the functionality that you do not like.
I have not tried this before, nor do I actually know how the controller determines how it is displayed in different size classes. However, if I were trying to accomplish what you are, then this is what I would be looking up.

How to add support for Landscape mode in existing app

I have implemented an iOS application for both iPhone & iPad, supports only in Portrait mode with OS iOS 7 & above. Now I need to add support for Landscape as well, and I do not have much knowledge on Auto layout and Size Class. Do I need to create separate xib's for Landscape mode? Please share your best suggestions and thoughts.
Please have a look into attached screenshot for how to use SizeClass for design view in Portrait and Landscape Mode.
Have a look into this image for more clarification.
Follow the steps below to add support for navigation
1) In project navigator tab, select your project
2)then select general tab and in Deployment info select checkboxes for device orientation (landscape left and landscape right.)
If you dnt wanna use size classes you can go with Autolayout.
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/Introduction.html

How to fix the orientation issue in IOS 7

Orientation problem is present across the app. All the views looks fine in portrait mode.
But When orientation changes to landscape mode the subviews are rearranged.
I am using buttons and labels on the view. How to fix the orientation issue so that view for portrait and landscape looks same?
You can do this with springs and struts or using autolayout.
Please refer these wonderful tutorials for getting a hangout of autlayout and its advantage over springs and struts :
Beginning Auto Layout Tutorial in iOS 7: Part 1
Beginning Auto Layout Tutorial in iOS 7: Part 2
Feel free to comment below if you have any doubts regarding the same.
Hope this helps! :)

Using autolayout for different positioning Portrait vs Landscape

I'm very new to Autolayout. I'm building an iOS 7 app with Xcode 5 and I want realize a login page that appears in a way in Portrait and in another way in Landscape.
This is what I want:
The problem is that I have problem to set the elements in different position for Portrait among Landscape.
Without using autolayout, this is very easy by using hard coded position programmatically, but I want use autolayout.
Can anyone explain me how to achieve this ?
I also read the Ray Wenderlich tutorial, but doesn't explain a case similar to mine.
And I also read this post.
Thanks.

Landscape orientation for iPad?

Frustrated by how simple this should be...
I'm trying to add landscape support to an existing iPad app of mine. Do I actually have to create a completely new view controller for landscape mode? (surely not as that is a complete pain!)? Or can I use the existing view controllers and design for landscape and portrait? The simulated metrics thing doesn't work because whenever I make changes in a view controller in landscape mode and switch back to portrait it messes everything up! I know how to switch the view to landscape programmatically, this is (at least i think) an 'interface builder' sort of issue.
Why is this so difficult to do/hard to find!? Might be worth mentioning I'm using Xcode 4.2 with storyboards rather than separate xibs. Surely I don't have to use a separate view and segues because I really can't be bothered wasting my time with that.
Any help would be nice! Thanks
Watch for -willRotateToInterfaceOrientation:duration: and change the frame of your interface elements when the rotation changes.

Resources