Xcode 6 device specific asset catalogue - ios

I've seen many questions similar to mine and a lot are a bit vague, but I think I've found the answer to my question, I just need to know how it translates to Swift. This is what I understand about the asset catalogue:
#1x - standard iPhone (3G, 3GS
#2x - iPhone 4, 4s and iPhone 6
Retina4#2x - iPhone 5,5s
#3x - iPhone 6
The problem that I have seen many questions about is that there is a bug in Xcode that means that when rendered, the iPhone 6 doesn't zoom to fit, so you either have to have images that fit the 6 but are too big for the 4s, or fit the 4s and look too small in the 6 because they don't render as they should. Seems there are 2 solutions, either change the way the images are rendered (see the link below) or don't support the 4s. The answer in the link below provides a way to support the 4s by changing the way the images are loaded. What I want to know is how this is translated into swift, or if 9 months on there is a better solution. If neither of these are any good, how to I go about not supporting the 4s in my app as it can still update to the latest iOS software.
xcode 6 asset catalog iphone 6 - link to the answer I need in Swift if possible
I hope this makes sense, I've been pulling my hair out trying to work this out. Thanks in advance.

Related

Worry about the 4s?

Totally newbie here...I have been working on auto layout using stacks and constraints with X code 8 and I have a very good understanding of how it works. I can get my layouts to render across all sizes in the sim looking as expected.
My one issue is that I can easily make layouts that looks good for 5 through 7 plus...but when I try to make the 4S work, it just kinda screws everything up in regard to the spacing of the layout for the other models....it still works and looks as expected, but because the 4s is so small, it ends up leaving a lot of space in the other sizes.
Should I just not worry about the 4s and make sure that my other sizes render the way I want? When I submit my app will this cause it to be rejected?
From the following link you can see that there is only about 2% of people are only using iPhone 4s. So if you targetting above this device its ok.
https://david-smith.org/iosversionstats/
Apple's latest iOS will not support iPhone 4S, which has been supported from iOS 5 all the way to iOS 9.Apple announced that the iPhone 4S will not support iOS 10 due to hardware limitations.
As mentioned in comments you can go for a custom layout for that scree size if needed.

Is it okay to leave out unnecessary launch images?

I have an app that supports only iPhones running iOS 10 or above.
I added only the following images:
Default-568h#2x.png
Default-667h#2x.png
Default-736h#3x.png
I left out:
landscape, since I assume iOS will use the portait one if landscape is missing.
iPad, since my app supports iPhone only.
3.5-inch iPhones, since I require iOS 10, which doesn't run on 3.5-inch iPhones.
Unfortunately, my UIWindow size is 320 x 658 points on the iPhone 7 Plus, rather than the 414 x 736 it should be. iOS thinks that I support only 4-inch screens, so renders my UI at that size and then expands it, making everything looks huge.
How do I fix this?
I'm not using storyboards or xibs. Please don't suggest that I use them. That's offtopic for this question.
When the above didn't work, I tried adding Default-Landscape-736h#3x.png, but it didn't help.
I also tried using an asset catalog, but that didn't work, either, as discussed in this separate question.
Launch images are about to be dropped completely. The only acceptable app submissions will be those with a launch storyboard. These rules are slated to go into effect in April 2020. So get ready now. See https://developer.apple.com/videos/play/wwdc2019/224/?time=103.

What name convention need to be use in images for iphone 4s,iphone 5,iphone 6 ios 9.0

Am newbie in IOS,
I want to create an app in which i want use images for iphone 4s,iphone 5,iphone 6/6+ so i use name convention for these images i.e tip.png,tip#2x.png,tip#3x.png.
#3x images work fine for iphone 6+ but #2x images use for iphone 4s,5,6 that makes my UI very poor in iphone 4s.So please help me to find the solution.
The naming conventions would be tip#1x.png for non-retina displays, tip#2x.png for iPhones 4 - 6s, and tip#3x.png for the iPhone 6+ and 6s+.
If you're looking for specific sizes that common UI elements should be, you can check here.
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html

Xcode 6 layout issues

Recently, Apple Inc. has released new iPhone 6 and iPhone 6 Plus devices with a new OS (iOS 8) and tons of API changes. As well as there are more available displays' resolutions, an application should support at least 3 of them, I'm talking about iPhone 5/5S, iPhone 6 and iPhone 6 Plus. Xcode 6 follows another way it did in the previous version. Now, in most cases, you don't create a Scene for a concrete display size (e.g. 4 inch., 3.5 inch.) but you do create a form or a page sheet. It's basically bigger than even iPhone 6 plus resolution, due to a new way of maintaining layouts. As far as I'm considered, you must create layouts and only through them you can achieve supporting different resolutions.
What I am going for is a minor misunderstanding of how to setup my layouts to support at least those 3 devices I have listed above. The problem is being that I can support only iPhone 6 and iPhone 6 Plus with the best performance (i.e. objects are placed just as I wanted them to be). But what do I do for iPhone 5/5S support? Are there any resources I can read to understand the thing of layouts better? I appreciate your help in advance!
P.S. I tried to use a particular form's size in Interface Builder (4.7 inch., 4.0 inch.), but as well works only for the same resolution or higher.
An example is below. I have got wanted result for iPhone 6 and wrong thing for iPhone 5S.

Will iPad2 app work on iPad3?

I am new to iOS,
I seen that iPad 2 has resolution of 1024-by-768 and iPad 3 has resolution of 2048-by-1536 with retina display..
I am sure that iPad 2 app will defiantly work on iPad mini because the resolution is same..
and same case for iPhone,
Do we need to develop separate app for iPhone 5 ? because it has resolution different then other iPhone..
I am sure this is a dumb question that any mildly experienced iOS developer would laugh at but since a simple Google search didn't turn anything up I figured id ask.
Any help will be appriciated.
Will iPad2 app work on iPad3?
Yes, it will. The iPad 3 has exactly twice the pixel density in each direction as the iPad 2, so the OS will just go ahead and "scale up" the graphics (except those which are made from images in the app - you'll have to generate a higher resolution version of these image files for iPad 3).
Do we need to develop separate app for iPhone 5?
Not a separate app, you just have to pay attention to the different screen aspect ratio. If you don't do that, you'll have black bars at the top and the bottom of the screen.
iPhone 4 Apps will work on iPhone 5 :
But it will have black spaces at top and bottom, In order to refactor it you just need to change the splash screen which is suitable for iphone 5.
iPad 2 Apps on iPad3:
It will work without any issues unless they have different iOS versions running in them.
As far as I know, the difference between the iPad2 and iPad3 won't be such a big problem. (unless you want to be really exact)
Whereas you should develop a new App for the iPhone5 because it has a greatly different screen format than the iPads.
Yes, your iPad 2 working app will work on iPad 3 (also, depends on iOS version). Just it will not look good :) In order to make it look good, for all images used for your app, you have to add #2x ones with double size.
As for iPhone 5, no, you don't have to develop different app, just you have to make your views resizable to fit on screen. Good Luck!

Resources