System Image for UIButton appears in iOS14, but not in iOS13 - ios

I set system images for UIButtons and also in the tab bar. This works for iOS 14, but on iOS 13 the images are missing.
What could be the reason, for the system images to be missing on iOS 13?
Details:
I have a button with the image property set to "square.and.arrow.up" in the storyboard. (See screenshot below)
The image appears on iOS 14, but not on iOS 13 (see screenshot below. Simulators overlapping)
Similar behaviour occurs for the tab bar items. (see other screenshot below)
Xcode is 12.5, MacOS 11.2.3, iOS Simulators 13.6 and 14.5.
This happens on the devices too, not only in simulators.
The SF Symbols App claims that the icon is available since iOS 13+.
Any help is appreciated :-)

It seems like a bug 🐞.
✅ Use this bug as a feature!
Although it is a bug, it's a very good practice to always have a fallback for these kinds of ongoing stuff.
So try to export the symbol (File -> Export..) and import it as an asset to the assets catalog.
Note that although Xcode supports imported symbols, you may consider using a separated icon file (like a PDF) for older iOS devices.
Besides it is more reliable, it will bring some other benefits to your project:
1. Backward compatibility
Since it uses the embedded assets in the bundle, they can be used even in iOS 12 and below.
2. Forward compatibility!
All versions of SF Symbols.app have come out as a beta app and Apple is constantly changing the conventions and rules and other aspects of creating and using these symbols.
For example, take a look at this naming convention:
As you can see, The name of this symbol is changed from iOS 15, and old codes will not show this in the future!
3. Wider support
You can use these exported symbols where there is no direct support for using symbols (like UIApplicationShortcutItem when it wasn't supported in the early versions and here is the full example)
Wrap it up:
So it is a good choice to always have backups of symbols and fall back to them if something went wrong...

Related

System images are showing on iOS 13, but not on iOS 12 and before

I'm using Storyboard editor on XCode 11.3.1 to create a UIButton with an icon. When I add a "system" image to a button, e.g., named square.and.pencil, it shows it in Storyboard and on iOS 13 devices. But on iOS 12, it shows nothing. Any way to use system icons for older iOS?
Also note:
User-created images from assets are working everywhere with my setup.
UIBarButtonItem shows the same icon on all devices, but it's specified with "System Item: Compose," not with an image named square.and.pencil.
What you are using is an .SVG image, provided like a system icon with Xcode 11.
This one and 1500 more are available on SF Symbols app, made by Apple. You can read more about SF Symbols and download it here.
However, as you can read on the link,
You can use SF Symbols in apps running in iOS 13 and later, watchOS 6 and later, and tvOS 13 and later.
these are only available for iOS13 and up, so that is why the image is not displayed on iOS12.
If you want to use that exact same image on iOS 12, export it as .PNG using SF Symbols and add it as a resource to your project.
I would like to suggest you this app which will simplify your life.
https://happycoding.app/index.html
From the link you can download the app.
This app allows you to download the icons of material design ios default icons and many more, just remember you give same name to icons as they have for ios 13*. Also it helps you in many other ways like pods info plist files and lot more. You should give it a try.

iOS 7 & 8 custom activityImage differences

Since iOS 7 we've included custom activityImages for sharing purposes through the UIActivity component. According to this official Apple documentation it states that every non-transparant pixel will be overlayed by a grey gradient. The images we used where mainly transparant (transparant pixels became white) except for the part that was useful (became grey).
If I run the same application in the newest XCode on iOS 8.4 it seems that this is different. Apple restricted the use of colours in iOS 7 with their grey overlay but apparently not in iOS 8. This results in 2 different images based on the iOS version running on the device. I can't seem to find any documentation about this change. The official documentation has not been adapted as well. So I am not sure if this is an Apple related bug or a feature.
Will I really have to support 2 different kinds of images (one for iOS 7 and one for iOS 8) when I want to use custom activityImages?
If someone can refer to some more information on this, please do so.
The documentation still hasn't been updated, but you are correct, this is a change in iOS 8. That means your app should provide a different icon based on the iOS version.
See this other answer to a related question for more details.

Could Xcode be responsible for button formatting differences?

I've inherited an iOS app the was probably developed in Xcode 4. I'm using Xcode 6, and also have access to Xcode 5. The production executable of the app I'm working on shows buttons with white text and a blue background. However, the code I'm running shows the buttons with blue text and a transparent background.
I normally would attribute this to code or xib file changes. But the versions I've checked out should correspond to the production version. So I'm wondering if perhaps there's something on my machine that could be responsible?
If you're running on Xcode 5 or 6, then you're building against the iOS 7 or iOS 8 SDKs (unless you hacked your installation).
As you probably know, iOS 7 introduced major visual changes to the SDK, so it's normal for the app to have a significantly different appearance.
You can verify this by downloading Xcode 4 here.

Wrong Icon Installed by Xcode

I have been pulling my hairs for the past few days. It appears I am the first one who has experienced this problem because I could not find anything that is even close through Internet searches. The problem that I have experienced is the following:
Icon for retina iPad of iOS 6.1 and prior (size 144x144) and Icon for iPhone of iOS 7 (size 120x120) are not installed correctly. If I use asset catalog, when installing my app on iPad (retina) with iOS 5, the iPhone icon (120x120) is installed. iPhone with iOS 7 works fine using the same icon (120x120). If I don't use asset catalog, but instead add the icons to the info.plist (CFBundleIcons array), it goes the other way around. iPad icon is fine this time (144x144 icon was installed). But iPhone uses the iPad icon (144x144).
What's more strange is that this is not a problem with one of my two targets. It is only a problem for the second target. The second target was created by duplicating the first one. I have compared the info and settings of the two projects, but did not see any difference (other than bundle identifiers and product names etc., of course).
I've upgraded my Xcode to 5.0.2 and that makes no difference.
I'd appreciate it if anybody could shed some light on this.
Update #1: I tried to use the icons from the first target and the problem is still there. So it's not related the icon png files. It's target related. Also tried to clean the project, delete the app from the devices to no avail.
Update #2: When I use plist instead of asset catalog, what's (incorrectly) installed on my iPhone (iOS 7) is not the 144x144 icon. It is 144x144 icon for iOS 6.1 and prior. It's still an incorrect icon.
Update #3: This is actually easy to reproduce. I created a cocos2d project from scratch this time (the Hello World project). Tried to add all the icons using the two ways introduced in the following technical article from Apple:
https://developer.apple.com/library/ios/qa/qa1686/_index.html
When using the asset catalog, 120x120 icon was installed on my iPad (retina) with iOS 5.
When using the project editor, 152x152 icon was installed on my iPad (retina) with iOS 5.
In both cases, what is supposed to be installed is the 144x144 icon. Will probably contact Apple on Monday.
I filed a tech-support case with Apple and confirmed that this is a known issue (as of 02/10/14). I open a bug report with Apple. This issue is not noticeable for most people because icons are all resized from one design. Even though the wrong icon is installed, it is barely noticeable (the icon is still resized to to the correct size on the device automatically). This is noticeable when you want to use different icon design on different iOS. For example, the icon curvature for iOS 7 is different. There is no workaround according to the Apple support.
Hope this is useful for anyone who runs into the same issue.
Regards,
Ryan
Make sure you don't have the older icons named with the an older version of Xcode's default icon names (Icon.png, Icon#2x.png, Icon-72.png). I have found that when these names exist, they are used even if other icon names are specified.
Try cleaning the project. Command-Shift-K , that usually fixes such issues

keep the look of my ios app like it is in ios6 rather than ios7

I have an ios app which was developed during ios5 to ios6
after updating my iPhone to ios7, there's something wrong with it.
For example, I had a textfield in an alertView which was supposed to input some password of the users, but in ios7 the interactors change a lot and the textfield is gone.
Also lots of other UI elements change greatly including switches, buttons, etc.
The UI of my app is not really flat style and it does not fit ios7 looks.
I'm gonna update my app to fix the problem of alertView,
but is there anyway that I can keep the interactors(buttons, switches, alertView, etc.) as the same as ios6?
Thanks a lot!
If you build your app with pre-Xcode 5, then it will retain the look and feel of iOS 6, even on iOS 7. But if you build your app with Xcode 5, then it will have the new iOS 7 look and feel when run on iOS 7.
However, you specifically mention UIAlertView, which is an exception. Even for existing apps that haven't been rebuilt with Xcode 5, the UIAlertView will always appear with the iOS 7 look when run on iOS 7. There's nothing you can do to have the old UIAlertView when on iOS 7.
From the sound of your question, it sounds like you're manually adding your own text field to a UIAlertView. You should never manually add views to a UIAlertView. Apple does not support this, and it appears that it is broken with iOS 7 anyway. If you look at the documentation for UIAlertView, you'll see that you can make it display a text field, including one for password input, that should fit your needs. So I would suggest updating your app to properly use the built-in text field functionality of UIAlertView.
As for keeping your app with the old look and feel, starting February 1st, Apple will stop accepting apps into the app store that are built with an Xcode version earlier than Xcode 5. So all new app submissions at that point will have the new iOS 7 look and feel when run on iOS 7. So whether you like it or not, you're going to have to deal with revising your UI to fit in with the look and feel of iOS 7.
You can do it through setting the Base SDK of your project target as iOS 6.1.
To do this , first go to Xcode 4 (Xcode.app), right click->Show Package Contents -> Contents->Developer->Platforms->iPhoneOS.platform->Developer->SDKs and copy the iPhoneOS6.1.sdk
Then go to Xcode5(Xcode.app),right click->Show Package Contents -> Contents->Developer->Platforms->iPhoneOS.platform->Developer->SDKs and paste the copied iPhoneOS6.1.sdk
So its looks like as below,
Then Quit Xcode5 and re-open Xcode5 ->Project Target->Build Settings->Base SDK and set it as iOS6.1
You can select the desired simulators from Xcode.
If its not availble, go to Xcode->Preferences->Downloads and download the simulators

Resources