Asset Catalog

RSS for tag

An asset catalog is a type of file used to organize and manage different assets and image resolutions used by your app’s user interface.

Asset Catalog Documentation

Posts under Asset Catalog tag

40 Posts
Sort by:
Post not yet marked as solved
2 Replies
1.3k Views
Is this a bug or the expected behaviour? var progress = itemProvider.loadFileRepresentation( forTypeIdentifier: id, completionHandler: { [self] (u, error) in //... })  var timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { [self] timer in       print("\(progress?.completedUnitCount)/\(progress?.totalUnitCount)")  } this always prints 100/100
Posted
by
Post not yet marked as solved
4 Replies
3.0k Views
Hi, If I change the AppIcon in Xcode's Assets.xcassets, and rerun my app, the image used in the dock and app switcher does not update. If I "Clean Build Folder", and re-run, then it updates. This is annoying when I keep tweaking the colors in the icon and want to see how they look. A full rebuild takes a while, because I have a few Swift Package dependencies. Anyone know a trick to get the AppIcon to stop caching (or whatever it's doing)? I tried killall Dock and killall Finder, but that didn't help. (macOS 11.2.3) Rob
Posted
by
Post not yet marked as solved
5 Replies
3.1k Views
I've searched and searched for the past 2 days and I can't seem to solve this at all, there seems to be a lot of different advice for different versions of Xcode, but nothing I try can get past this. I can't publish my ipa because of this. I have an app which has a Asset Catalog (Media.xcassets) which has an icon set called AppIcon - which I've generated a few times, directly in the UI of Xcode and Visual Studio. I've added all images to the ios section and the mac section within the asset catalog - choosing All Sizes (and not Single Size) and can see them referenced all nicely in the json file - there are no warning symbols against any of my icons to indicate they are the wrong size. None of the symbols have any alpha channel set against them, they are all pngs. I've even tried with a completely black image. I have this referenced in my info.plist (that refers to icons), and XSAppIconAssets is at the top: I have the Primary App Icon Set Name referenced in Asset Catalog Compiler - Options correctly and App Icons and Launch Screen options are as follows: If I remove some references to my images in the Asset Catalog - I get specific errors on them and when I add them back in, the errors disappear, so I know the Asset Catalog is referenced OK - I just can't seem to get rid of this obnoxious Missing App Icon error on the 1024x1024 one though Any help would be greatly appreciated, this is doing my head in!
Posted
by
Post not yet marked as solved
1 Replies
1.4k Views
we got a crash: means refresh UI on a background thread, bug there is none clue in the crash log。 myapp method doesn't appear in the crash log. Have you ever encountered this problem?What is the solution Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Triggered by Thread: 70 Last Exception Backtrace: 0 CoreFoundation 0x1c83ae248 __exceptionPreprocess + 164 (NSException.m:202) 1 libobjc.A.dylib 0x1c177ba68 objc_exception_throw + 60 (objc-exception.mm:356) 2 CoreAutoLayout 0x1e4888e84 _AssertAutoLayoutOnAllowedThreadsOnly + 328 (NSISEngine.m:0) 3 CoreAutoLayout 0x1e487f9b4 -[NSISEngine _optimizeWithoutRebuilding] + 72 (NSISEngine.m:1709) 4 CoreAutoLayout 0x1e487f8e4 -[NSISEngine optimize] + 96 (NSISEngine.m:1683) 5 CoreAutoLayout 0x1e487f670 -[NSISEngine performPendingChangeNotifications] + 104 (NSISEngine.m:677) 6 UIKitCore 0x1ca538710 -[UIView(Hierarchy) layoutSubviews] + 128 (UIView.m:13091) 7 UIKitCore 0x1ca536cec -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1980 (UIView.m:18550) 8 QuartzCore 0x1c9a134e8 CA::Layer::layout_if_needed(CA::Transaction*) + 500 (CALayer.mm:10223) 9 QuartzCore 0x1c9a26b9c CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148 (CALayer.mm:2516) 10 QuartzCore 0x1c9a38098 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 456 (CAContextInternal.mm:2711) 11 QuartzCore 0x1c9a6f3c4 CA::Transaction::commit() + 652 (CATransactionInternal.mm:431) 12 MediaToolbox 0x1d75d7254 videoQueueRemote_removeHostLayer + 116 (FigVideoQueue_Remote.m:509) 13 MediaToolbox 0x1d75d6250 videoQueueRemote_Invalidate + 348 (FigVideoQueue_Remote.m:463) 14 MediaToolbox 0x1d75d6334 videoQueueRemote_Finalize + 36 (FigVideoQueue_Remote.m:817) 15 CoreMedia 0x1d336a044 FigBaseObjectFinalize + 568 (FigBaseObject.c:402) 16 CoreFoundation 0x1c8422d20 _CFRelease + 316 (CFRuntime.c:2097) 17 MediaToolbox 0x1d75d5b30 FigVideoQueueRemoteCallbackServer_NotificationIsPending + 328 (FigCFUtilitiesFigOnly.h:65) 18 MediaToolbox 0x1d771ed7c figvideoqueuecallback_server + 108 (FigVideoQueue_RemoteCallbackServer.c:162) 19 libdispatch.dylib 0x1cf8482ac dispatch_mig_server + 424 (mach.c:3300) 20 libdispatch.dylib 0x1cf829fdc _dispatch_client_callout + 20 (object.m:560) 21 libdispatch.dylib 0x1cf82d46c _dispatch_continuation_pop + 504 (inline_internal.h:2632) 22 libdispatch.dylib 0x1cf840a58 _dispatch_source_invoke + 1588 (source.c:596) 23 libdispatch.dylib 0x1cf83156c _dispatch_lane_serial_drain + 376 (inline_internal.h:0) 24 libdispatch.dylib 0x1cf8321e0 _dispatch_lane_invoke + 384 (queue.c:3940) 25 libdispatch.dylib 0x1cf83ce10 _dispatch_workloop_worker_thread + 652 (queue.c:6846) 26 libsystem_pthread.dylib 0x214cccdf8 _pthread_wqthread + 288 (pthread.c:2618) 27 libsystem_pthread.dylib 0x214cccb98 start_wqthread + 8 (:-1) here is the full log -------------* 2022-10-27_11-31-58.9050_+0800-1a3771605f5d783facc122cfc90a6fb462574e28.crash thread 0 callback
Posted
by
Post not yet marked as solved
0 Replies
1.5k Views
In iOS 16, can not displaying PDF included gradients. PDF displayed normally if used Radial or Linear Gradient. Complex shape gradients are not displayed. The PDF is not displayed inside the iOS-application resources and when open file in iPhone use Files app normally. Attached an example with a regular Diamond gradient, which was created use Figma. iOS 15 displays the example file correctly. You can open file if change file format: Example.json rename to -> Example.pdf. P.S. I can't attached pdf or zip files. Example.json
Posted
by
Post not yet marked as solved
4 Replies
1.9k Views
CoreUI is sending warning messages to the Xcode console when creating a UIImage from an image file with Mac idiom from the asset catalog, while running on Catalyst. My target is set to support running on Mac Catalyst with Optimize for Mac enabled (the latter seems to be the most important part). Loading the image into a UIImage with the designated initializer and presenting it in a UIImageView produces the following console messages: 2023-02-15 10:53:18.014394+0100 CatalystImageConsoleMessage[64253:8834791] [framework] CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) got a device subtype '32401' that it match with idiom '7':mac. Assuming subtype should be 0 instead. 2023-02-15 10:53:18.014446+0100 CatalystImageConsoleMessage[64253:8834791] [framework] CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) got a device subtype '32401' that it match with idiom '7':mac. Assuming subtype should be 0 instead. 2023-02-15 10:53:18.014503+0100 CatalystImageConsoleMessage[64253:8834791] [framework] CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) got a device subtype '32401' that it match with idiom '7':mac. Assuming subtype should be 0 instead. 2023-02-15 10:53:18.014533+0100 CatalystImageConsoleMessage[64253:8834791] [framework] CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) got a device subtype '32401' that it match with idiom '7':mac. Assuming subtype should be 0 instead. Working with more than a handful of images from the catalog makes the Xcode console output borderline unreadable because of these messages. The console doesn't have an option to filter out messages (and in general we consider it bad practice to ignore messages on the console). Tested on Xcode 14.2 with macOS 13.2. You can find a sample project at https://github.com/tamasjager/CatalystImageConsoleMessage.
Posted
by
Post not yet marked as solved
6 Replies
1.2k Views
Hi, Overview: My app's icon uses Display P3 colors. The PNG when opened in Preview seems to have the correct colours, but when added to Asset catalog as App icon, the installed app's app icon doesn't have the correct colors. The Preview app's inspector shows the following: Colour Model: RGB Depth: 16 DPI Height: 72 DPI Width: 72 Orientation: 1 (Normal) Pixel Height: 1,024 Pixel Width: 1,024 Profile Name: Display P3 Steps followed: I have an app icon that uses the Display P3 color profile. In Sketch, I have assigned the P3 Display color profile, exported as PNG. Realised it was using only 8 bits / channel color depth. So opened PNG in Pixelmator and changed color depth to 16 bits / channel and exported the PNG. The PNG when opened in Preview seems to have the correct colours, but when used in I even tried to use Display P3 Gamut in asset catalog and provide the same icon for sRGB and Display P3, yet the installed app's icon's colors don't match Questions: What should I do to correct this problem? Any help would be much appreciated.
Posted
by
Post not yet marked as solved
6 Replies
2.6k Views
Hi all, I recently uploaded my app to the App Store and received the following error message: ITMS-90961: Invalid bundle - The app at '***.app' contains a single-size app icon but has a value of 11.0 for the MinimumOSVersion key in its Info.plist file. Include all app icon sizes to support iOS 11.0 or later, or update the iOS Deployment Target to 12.0 or later to support uploads with a single-size app icon. I have checked my assets and confirmed that the AppIcon is set to "All Sizes" and not "Single Size". Is this an issue with Apple's systems or is there something I am doing wrong? Any help would be greatly appreciated. My Xcode version is 14.3 Thanks in advance.
Posted
by
Post not yet marked as solved
0 Replies
570 Views
My app uses SpriteKit and requires the use of SKTextureAtlas for performance. However, it uses user-generated content, which means that atlases don’t initialize using bundled images, but instead have to recreate all sprite sheets, leading to long loading times. Is it possible to save the sprite sheets made from user-generated content to disk so that SKTextureAtlas can load them instead of recreating all sprite sheets upon every initialization? Is there any alternative solution to this problem? For example, is there a way to dump a bunch of images into memory to use as a texture pool and keep them there until deallocated?
Posted
by
wmk
Post not yet marked as solved
1 Replies
927 Views
My project contains an asset catalog with images that have emojis in their name. When trying to build in Xcode 15.0 beta (15A5160n) and 'Generate Asset Symbols' enabled the compiler crashes. Example error: error: 'ï' is not a valid digit in integer literal static let 0ï¸ â £Flat = ImageResource(name: "0ï¸ â £_flat", bundle: resourceBundle)
Posted
by
Post not yet marked as solved
1 Replies
758 Views
I don't know if this is the correct place. Symbols for Asset catalog works fine when you have the Assets file in the same target If you have imported a target with Asset file and you can use that assets with: UImage(resource: .asset) Image(.asset) Does not work. Xcode says: This static property is define on "XAssetFile", and maybe not available in this context. There are way to use new Symbols for Asset catalog from other imported target.
Posted
by
Post not yet marked as solved
1 Replies
676 Views
I am blind, use Voiceover, and am having a difficult time adding an app icon to my project. I created the project with Cordova and can't figure out how to add the icon through the CLI interface, but also can't get it to add through Xcode. Help for either method would be greatly appreciated. Thanks
Posted
by
Post not yet marked as solved
0 Replies
755 Views
Hi, I have some SVG assets that are natively in 512x512 resolution. I want to use 20 of them in a Widget context where memory consumption must be kept low (due to 30MB Memory limit in extensions). As in that widget context, the images are display in small size (they are displayed in full size in the app) I would like to load a downsampled version of the images (let say 32x32). Is there any way to achieve that? (perhaps with configuration or traitCollection) I could resize them after having loading them full size but it will nevertheless create a memory peak consumption while resizing all the images... Thanks in advance for the help. PS: I really want to avoid to generate smaller preview images just for that purpose but if I can't find a better solution I could ask the app to generate thumbs for all images at first startup and use these thumbs in the widgets... Clement
Posted
by
Post not yet marked as solved
12 Replies
3.4k Views
I'm not sure if I'm changed an unknown-to-me setting somewhere, but since this morning, after profiling an app (metal, allocations, etc), every project I run/build on Xcode 15b3, either on simulator or on device, displays partially-alpha images blended to black, as if there was some problem in the process of compiling the PNGs (lack of premultiplying, color space, etc). If I open those same projects on Xcode 14, they are displayed everything as they should. Also, If I open them on other computers with Xcode 15b3 other than mine, it also works fine. And it was working fine for me this morning as well, but not anymore. I've tried uninstalling Xcode beta and the simulator a few times, cleaning folders and preferences, hoping it was some setting I changed by mistake with some hotkey, but no luck so far. I'll attach two pictures, one from Xcode 14, and the other one from Xcode 15b3, hoping it's some silly thing I'm missing. xc15b3: xc14:
Posted
by
Post not yet marked as solved
0 Replies
852 Views
I keep getting this error and I'm stuck for days. Any advice I cannot figure this out Asset validation failed Missing Info.plist value. A value for the Info.plist key 'CFBundleIconName' is missing in the bundle Apps built with iOS 11 or later SDK must supply app icons in an asset catalog and must also provide a value for this Info.plist key.
Posted
by
Post not yet marked as solved
0 Replies
693 Views
Hi, I'm considering trying the product page optimization with other app icons. The doc says that " If an app is downloaded from a product page with a test treatment, the test treatment app icon displays throughout the download process and on the user’s device." (https://developer.apple.com/help/app-store-connect/create-product-page-optimization-tests/configure-test-treatments). Do I understand correctly that no additional code is required when the app is downloaded from the test treatment ? No code required on app launch ? I appreciate any feedbacks, Thank you
Posted
by
Post not yet marked as solved
6 Replies
1.3k Views
Is it possible to make generated asset symbols (ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS and/or ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS) public so that they can be used by targets that import the framework defining them?
Posted
by
Post not yet marked as solved
1 Replies
1.2k Views
Hello everyone, I'm facing an issue with my SwiftUI project, and I would appreciate some help in resolving it. The problem is that one of the images in my project is not visible when I use it in my code. Here are the details of the issue: I have for example two images, "AIOx2.png" and "AIOx3.png", both of which are placed in the "Assets.xcassets" folder of my Xcode project. When I use "AIOx3.png" in my SwiftUI code (e.g., replacing Image("AIOx2") with Image("AIOx3")), the image is visible on the preview canvas and simulator. However, when I use "AIOx2.png" in the same way, the image is not visible on the preview canvas or the simulator. I have verified that the file "AIOx2.png" is correctly named and is in the same location as "AIOx3.png" in the "Assets.xcassets" folder. There are no error messages or warnings related to the image in the Xcode console. I have tried several troubleshooting steps, such as cleaning and build, restarting Xcode, re-downloading and re-adding the image to the project, but the issue persists. Is there anything specific that I might be missing or any other suggestions for troubleshooting this problem? I would be grateful for any guidance or insights into resolving this issue. Thank you in advance for your help! Best regards, Adam
Posted
by
Post not yet marked as solved
1 Replies
699 Views
I'm trying to modify a ShieldConfigurationExtension, but am having trouble adding an icon. I have tried directly adding a png to the ShieldConfiguration extension folder and creating a UIImage from it, but it doesn't seem to work. Am I working with images within an extension properly? This code displays the default configuration override func configuration(shielding application: Application, in category: ActivityCategory) -> ShieldConfiguration { // Customize the shield as needed for applications shielded because of their category. let image = UIImage(named: "icon") return ShieldConfiguration( icon: image) } This code properly displays a customized configuration return ShieldConfiguration( title: ShieldConfiguration.Label(text: "test", color: .white))
Posted
by
Post not yet marked as solved
9 Replies
3.1k Views
Xcode generates symbols for image and color assets now (which is super nice!). We noticed an issue when generating code symbols for our image assets. We have an image named inputContour and one named inputContourColor. Xcode was not able to generate a symbol for inputContourColor and instead produced the following warning: #warning("The \"inputContourColor\" image asset name resolves to the symbol \"inputContour\" which already exists. Try renaming the asset.") It turns out that the generator automatically removes the color suffix when creating the code symbol. For color assets, this probably make sense (so tealColor would become just teal), but this should not be applied to image resources.
Posted
by