Size Classes in iOS 7 - iphone

I created a new app in Xcode 6 using Size Classes. After testing with iOS 7, I can't figure out how to get iPhone to display a certain size class while in landscape mode.
I first developed the UI with iPhone landscape as wAny hCompact, but iOS 7 doesn't recognize that. I had iPhone portrait in wAny hAny.
I then changed it so now I'm using wCompact hRegular for iPhone portrait. I then modified wAny hAny to be the landscape layout. But it's not using that layout when the iOS 7 device is in landscape.
Is iOS 7 able to use different size classes based on the device being portrait or landscape? If so, which size class should I be using?
Reference: Really helpful information about backwards compatibility with size classes.
ps. I'm not concerned with iPad because the device does not display a different size class based on the device rotation in iOS 8.

Size classes works in iOS 7 for sure. But only if you follow several rules:
The app is built using Xcode version 6 or later
The deployment target of the app is earlier than iOS 8
Size classes are specified in a storyboard or xib file
The value of the height component is not compact (yep, this is your case, it's not possible in iOS 7, unfortunatelly)
There is a little explanation here: https://stackoverflow.com/a/24976792/2190175

No I'm afraid that Size Classes were introduced in iOS 8. You could write some conditional code to run on iOS to determine the screen/view size/orientation and change the the layout that way when iOS 8 becomes your minimum target the conditional code can be removed.

Related

Using Single Storyboard for iPhone & iPad on Xcode 5.1.1

I have been developing an iOS App with iPhone(4-inch) Storyboard. Now I would like to use the same storyboard for iPad also. My iPhone storyboard contains 130+ scenes now.
I need to make it for iPad also.
I tried solution from link:
Converting Storyboard from iPhone to iPad
After following it my Xcode crashes, may be due to many scenes in the single storyboard.
I know about size classes in Xcode 6 and also tried it but the fonts don't update for the iPad size class(Regular Width| Regular Height) on simulator/device with iOS 7 but on iOS 8 it does. Since I have deployment target as iOS 7 I can't overlook the issue.
Can anyone help me with a solution that works on Xcode 5.1.1 of having same iPhone storyboard for iPad(Like a Universal App) as well?
Any help/clue will be appreciated.
Thanks.
Have you tried using size classes?
If that doesn't work, you could always use 2 different storyboards- 1 for the iPhone and 1 for the iPad

iOS 5 and iOS 6 - UIWebView difference in behaviour

I am testing some HTML code on UIWebView. And am also wishing to support both iOS 5.x and iOS 6.x. But there seems to be a problem about font size associated with iOS 6.x only.
That is, under rotation, iOS 5.x would make fonts slightly smaller when changing to portrait from landscape mode (which is desirable, since portrait's width is shorter). However, UIWebView in iOS 6.x would do just the opposite.
The problem does not come up when the same HTML code is rendered in iOS Safari (both 5.x and 6.x), as font size always scales as expected during rotation.
It could be something I've missed about UIWebView, hope somebody knowledgable could help to explain this.
Also, the above problem comes up on my iPhone 5 iOS 6.1 test device. Please comment if you do or don't find any similar problem. Wish to know if it is only associated with this particular phone (or its settings) only.
Latest Update :
The above problem should be related to how the project (which started long before iOS 6 was available) is laid out. As have set up a new test project with a UIWebView and a UIView in some different basic setups, and the text autosizing during rotation seems to be ok in both ios 5 & 6. The above problem may be due to custom layout adjustment code used which is good only in iOS 5. Really wish there were more compatibility between the 2 ios versions.
Please use the viewpoint setting to see the difference in ios 5 and ios 6

Iphone 5 and Iphone 4 screen issue

I'm creating an app using xcode 4.5 that is meant to support only the 3.5 inch retina display. Thus, in the attributes inspector for the view controller I have set the size to be 3.5 inches. However, I'm testing my app on a iphone 5 and the app auto-resizes to fit the whole screen. Do you know why this is happening? How can i make the app remain in 3.5 inches of size even when viewed off of a iphone 5?
Thanks
If you remove the default 568h#2x icon from your project the app will run the way you want. On the iPhone 5, you will get black bars on top and bottom to show what it would look like on the 4. Hope this helps.
The answer is - you can't do that :) But you can download ios5 simulator and set it's device property to 3.5 screen device

Xcode iPhone 4/5 Screen Size Both

I am making an application in Xcode, and I need to make it for both iPhone 4 and 5. But since the iPhone 5 has a bigger screen, it messes my application up.
Once I place the labels for the size of iPhone 4 and then test it on the iPhone 5 the labels are all misplaced. Is there a way to make them stay?
You can use iOS 6's new autolayout feature (if you want to be iOS5-compatible, you can still have autoresizing masks).
You need to position your labels based on the View Height of the device(don't have to worry about width, since iPhone 4 and 5 both have the same width. But this would apply for a universal app targeting iPad and iPhone).
For instance, if yours is a View Based Application, find the view height of the superview using self.view.frame.size.height, and determine all label/view placements based on this property.
And test for both screen sizes on the iOS Simulator.

How to make iPhone4 and below version app compatible for iPhone5?

I have an application in iphone market which works for iPhone 4s and lower version. So now iPhone 5 has been launched which bigger size screen, my question is what all changes i have to do in my application so that it will be compatible with iPhone 5 also.
1) Do i have to rebuild my app for iPhone 5?
2) Do i have to make changes only in UI ?
3) Will the iPhone 5 will its make it compatible?
Your valuable replies will help me a lot. Thanks in advance.
Here is my answers,
1) Do i have to rebuild my app for iPhone 5?
If you want to utilize the complete screen space, you can add Default-568h#2x.png and rebuild the app and release it.
2) Do i have to make changes only in UI ?
You can utilize the complete screen space for iphone 5. You can code for screen modifications in case of other iPhones.
3) Will the iPhone 5 will its make it compatible?
Yes. It will make it automatically compatible. It will add a black strip on top and bottom to compensate for the extra space in the screen unless you add Default-568h#2x.png.
If your app uses the standard UIKit provided by Apple, you only need to add a 4 inch launch image to your app, and it will automatically resized itself. But if your app using custom controls or graphics-heavy like in games, you might want to adjust the images and take advantage of the larger screen.
You also have to make sure the methods you used do not deprecated on iOS6 to prevent the app from crashing. Some references if you need further reading.
To make older app compatible with iPhone 5 You need to look for Following things.
Latest Xcode version 4.5.
Open your project and select Upgrade settings for new version.
Add Default-568h#2x.png for new resolution .
For UI you have to change your xib's object autoresizing property.When you select View Go to
inspector and select size property It will show you None, Full Screen, Retina 4 options . Set autoresize property for all your Buttons , labels and check xib for retina 4 and None both.It is same like you set it for Landscape and portrait .
5.Some other changed will be in code because some method has been depreciated for ios 6.0.
6. After doing all this .You can run it on iphone 5 simulator for testing.
I have an app that was using GLKMatrix3 and its supporting functions. I found that the GLKMatrix3Multiply function would always crash on iPhone 5 hardware. Easy to workaround using GLKMatrix4 instead, but the point is that I would never have found the problem without actually trying my app on iPhone 5 hardware.
I was told to file a bug for the GLKMatrix3 problem, so maybe this will be fixed. But the code runs just fine in the iOS 6 simulator.
I learned from this that, whether or not you need to rebuild your app for iPhone 5, you do need to at least run your app on a device before advertising support for that device.