iOS Development Simulator view squashed - ios

I have just started iOS programming and am following a tutorial on iTunesU from Stanford.
In the first tutorial we were shown how to build a simple RPN calculator. When I built and compiled in the simulator launched as normal but everything was "squashed". I figured this was because the View in XCode is bigger than the iOS simulator. How can I resize the view in Xcode or am I missing something.
Here is the iOS simuator view compared with the one from xcode

Looks like your view in Xcode's Interface Builder is a 4" view, and the simulator is running a 3.5" device. You can change either one.
The view size in Xcode is changeable by selecting the entire view, and in the attributes inspector, you can change the size between Freeform, 3.5, 4.
You can change the device in the simulator by going to Hardware>Device> Select your device
However, the overlapping buttons, etc, are more related to using Auto Layout, or misused struts. You can either turn off Auto Layout and use struts, or take the challenge to learn Auto Layout.
Here's a start for Auto Layout: What is Auto Layout?

It's not 'squashed' you are using the device simulator for the latest iPhone, which has a 4 inch display instead of 3.5 inch. To change device go to Hardware->Device in the simulator bar. And the iPhone frame does not show in the latest version of the simulator so to press the home button you go under Hardware->Home.

Related

Xcode 8 AutoLayout/Constraints: Changing view to fit each Iphone screen size?

I am new to Xcode, and have been trying to figure out how to use AutoLayout and constraints. Long story short, after I hit 'add missing constraints' the Iphone 7 screen looks just as I intended, but both the Iphone 7 plus and Iphone SE screens look completely screwed up. What can I do to fix this so that every screen looks like the Iphone 7?
Iphone 7
Example Iphone SE (screwed up)
add missing constrains option means: adds the constraints needed to have a nonambiguous layout. may not work well for all iOS devices, and may not work well for device's rotation changes or view size changes, so, check view's constrains in size inspector panel
for more info:check Apple's auto layout guide

How To Fit UITableView in the screen with AutoLayout

I am trying to fill the screen with a TableView. I've tried pinning 4 edges but it broke when I view it in different devices (iPad Pro, iPhone SE, landscape and portrait orientation). The TableView is messed up for some reasons. It shouldn't be this hard to fill that in. Did I messed up some settings in my Xcode?
If you ran the application on a real device you'll find it as you expect it to be.
And if you opened another file then came back to storyboard you'll find the preview as expected too, I think it's a bug in the UI Builder.
Note: I'm using Xcode Version 8.3.2.

iPhone IB's are not showing instead of iPad on View as section: Xcode 8

My application is compatible for iPad only but on View as console over xib its showing only iPhone IB.
Please suggest me how can we replace iPad IB manually.
Note-I am not using Auto-layout in this Application
I have found solution:
1:If you are using Auto-layout and want to use iPhone and iPad both
Enable to Use Auto-Layout and Use trail variations.
Now check your view as section iPhone and iPad both are visible.
2: If you are not using Auto-Layout and want to change from iPhone to iPad or Vise Versa
Enable to Use Auto-Layout and Use trail variations. (Same as above section).
And again disable to both then one popup will appear as below image from that you can select you compatible device(iPhone or iPad).

Same Storyboard for different screen Sizes without Auto Layout

I've been using different storyboard for different screen sizes.
Now, I'm updating an old app with only one Storyboard for iPhones and it looks the same appearance as iPhone 5 in different iPhone simulators, without using auto layout. Works well on iPhone6 and 6 plus Simulator.
Can I trust this behaviour or is any simulator bug? Is it due to any Properties project config ?
You must use auto-layout otherwise it will not work 100%. If you enable auto resize subviews option in storyboard view then it might work upto some extent.
I got it... Just not setting any launch screen image for the devices without defined storyboard

Simulator and Storyboard Preview Difference

Currently, I'm using Xcode 6 Beta 6 for this thread. I have this single view application for iOS 8.0 and iPhone devices only. That single view have the value Inferred under the Attribute Inspector > Simulated Metrics.
At first I didn't try to apply the Add Missing Constraints since I'm trying to layout the view to support a single layout both for 3.5" and 4" display. After running the current view - WYSIWYG on the simulator. That's fine and correct. When I tried to apply Add Missing Constraints, the changes applied to the base storyboard as well as to the device previews. But when I tried to run the application on the simulator, it wasn't the same.
What went wrong here?

Resources