Color Asset not showing on iPad Device in Swift UI - ipad

I am SwiftUI application , application deployment Info is iPhone only ,and defined color in Asset File as "Universal"
color is showing up fine when install on iPhone Device ,
but when installing on iPad Device color is not showing up.(but visible on Simulator)
color usage code:
Text("privacy policy").foregroundColor(.appTheme)
.font(.system(size: 13).bold())
and our app is in review - but apple team is testing on iPad (which displays app in iPhone ratio) , but colors are not loading , and they can't see some buttons ,
so they have rejected the app.
How to solve this issue?

looks like there was the bug in Xcode , where it doesn't pick color assets from asset file , so had to create color extension file to pick color programmatically using RGB Color

Related

Xcode emulator XS: why the border on XS iPhone becomes a rectangle in the screenshot?

I want to save different screenshots of my App on XS iPhone version. Unfortunately I have this problem (Xcode 10.1):
The screenshot border obtained from simulator (File > New Screen shot):
Expected:
So I can't understand why the border image is not like in the simulator?
AFAIAA Screenshots do not include the simulator border, just the internal screen (without physical cutouts).
If you want to add the Phone frame, I would suggest:
Adding them manually as required using an image editor for your App Store uploads.
Look at some of the various iOS Shortcuts available which are supposed to help with this -
https://www.macstories.net/ios/apple-frames-a-shortcut-for-framing-screenshots-from-every-apple-device/
NOTE: I could not quite get this one to work on very quick install.
Look for an app in the iOS or MAC App Store which allows you to take screen
shots and add borders automatically.

iOS 13 DarkMode and LaunchScreen - Fallback for iOS 10

I have a blue logo on the launchscreen.storyboard on white background.
For the new DarkMode introduced with iOS 13 I like to invert the colors, i.e. blue background and white logo.
As we know this can be done using named colors from the asset catalogues, which change depending on the traits of the device.
This is working totally fine in iOS 11 and up but shows this error when trying to support iOS 10:
Named colors do not work prior to iOS 11.0.
I tried making a view controller for the launchscreen scene in code and set the colors there using the #ifavailable clause, but the compiler says a launchscreen may not have a custom class associated with it.
I also thought of using different launchscreen storyboards depending on the iOS version but I couldn't find anything about how to.
Anything I can do about it?
How to solve this problem?
Thanks,
Felix
As suggested here, the solution is to use a dynamic image for the background instead:
Create 2 images with the flat colors for light and dark mode.
Import them in your Asset Catalog and define the “Any”/“Dark” appearances.
Add a UIImageView in the background of your Launch Screen with this image (“Scale to Fill”, constrained to container).
This will compile even if your deployment target is lower than iOS 11.0, and will display the appropriate color at launch.

How do I get the app icon to show on Xcode 9 simulator?

I filled the app icon with images that fit the size requirements and then when I build the app there is not app icon. I tried on an ipad and iphone but there is still nothing.
Create a high-resolution image and using this site makeappicon it will generate all sizes for you ( supply your mail and the photo) and you'll receive them , then open AppIcon set in Assets.xcassets and drag each image according to it's size
#rmaddy found that the error is I didn't set the app icon source in the general tab. Doing this solved the problem

Xcode 6 Migrating to Images assets issues -- Black launch screen

I updated my application to use Image Asset for App Icon and Launch Images i set both with
appropriate image size according to Apple Doc. The issue that I have that for Iphone
and the simulator for (4S/5/5S) the launch image/screen is always black except for
Iphone 6+ but it works fine on iPad. I looked at couple of post here and nothing have
worked as follow
1) deleting the asset catalog and creating a new one
2) adding #2x and 3#x to each file before adding to the catalog
3) removing and redeploying the application
Anyone had that issue when porting image catalog ? Im using Xcode 6
Targeting ios 7 and 8
Thanks
Mike
Update 1
When disabling landscape launch screen appears normally
something i noticed before doing, so on either the device and the simulator
the application starts in landscape even if the device is held in portrait
and then it rotate to portrait. Still trying to solve that issue now
The following steps are worked for me:
Add the images to the project (root directory or Resources folder) with the following nomination (I will describe them into the Portrait launchimages): Degault.png (3.5 inch), Default-567h#2x (4 inch), Default-667h#2x (iPhone 6), Default-736#2x (iPhone 6plus).
Go to the target settings, App Icons And Launch Images on the General tab -> Set the Launch Image Source to not use asset catalog ('Do not use asset catalogs').
Remove the LaunchImage asset from your main image asset
Go to the target settings, App Icons And Launch Images on the General tab -> Set the Launch Image Source to use asset catalog
The XCode 6 is going to ask you about image asset migration from the existing images. Just click to 'Migrate'.
And it worked for me for each kind of devices on iOS7, iOS8.
Note:
If you check the new LaunchImage asset, than you can see it is really strange. It seems to contain only a few image without the images with iPhone6 or iPhone 6plus resolution.
I found that if I go to the app target general tab and remove all device orientations, the launch image will show again (i.e. the black screen goes away). After running the app, I then went back to the app target general tab and restored the desired device orientation and the launch images continue to work as desired.
(My answer should be in the comment section but I can't post it there due to my reputation)
May be these are very basic steps but:
Have you tried doing a full clean and deleting the derived data?
Have you checked the General tab of your target, under App Icons and Launch Images?

App Icon not shown on iPad

I am developing iPhone app. When i run the app on iPhone i can see the the icon on Home screen. But when i run the same app on iPad whitish icon appears which normally appears when the app has no icon.
I have tested my other iPhone apps they are working fine but this is causing trouble. I used Asset Catalogs to display app icons and they are perfectly adjusting in it. What could be the problem here any suggestions?
I also initially started with developing the app for iPhone and then needed to add iPad icons and here where I found them:
1) go to Assets
2) find appIcon (usually on top)
3) go to attributes inspector
4) choose iPad ios swift version
5) iPad iCons holders will appear you will need to fill them
xCode 5 was not showing anything related to iPad for an iPhone only app. So when i migrated my images to Assets Catalogs and clicked on app icon in the Attribute Inspector i was given the options like i want to give icons for iPad. So i provided and problem solved :)
for Universal application iPad Icon file size is 72x72 and named Icon-72 and for Retina its 114x114 with Icon-72#2x.png. Try to include this files into your resource bundle and then build your app
In project settings there are fields for App Icons please refer to the attachment
go to general , then app icon source , then click the appicon
by default , you can't see the place for ipad
3 . left click and create a new image set
then you can see all icon size , add the #76 #152 for ipad
In my case i do have set images for iPad in my assets but even then it was not showing. I have to check Target Membership check box. I had imported AppIcons folder and this got uncheck.
In project settings there are fields for both, iPad and iPhone icons. You may want to provide different icons for different devices, so try providing your icon for both, iPad and iPhone. Even though it will be the same image.
Hope the stackoverflow link will help How do you update the app icons and launch images to support IOS 6 and 7 simultaneously?
As answered by Andy Bean, try using Asset Catalog.
Link 2: iOS 7 App Icons, Launch images And Naming Convention While Keeping iOS 6 Icons

Resources