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.

Posts under Asset Catalog tag

40 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

NSImages blurred-out in Sonoma
My app uses various PNG images for parts of its UI. In Sonoma these images are rendered all blurred. It looks like I'm putting a 10 or 20px gaussian blur on it, which of course I am not. In prior macOS versions they have rendered just fine. Occasionally some user action in the app will cause a part of one or two images to render sharply, but then it quickly reverts to the blur. I have added the PNGs to the app as image set assets, providing 1x and 2x versions for light and dark modes respectively (so four images each). I'm loading them using NSImage(named: ), and in most cases putting them into an NSImageView. I also use one of them as a patternImage: if let image = NSImage(named: "RackFrame") { let color = NSColor.init(patternImage: image) color.setFill() dirtyRect.fill() } Both methods result in the same issue. Any thoughts on what's going on would be gratefully received!
0
0
598
Sep ’23
Assets.car increased in size significantly in Xcode 15
The Assets.car file in Archive and thus in exported .ipa file has significantly increased when archived in Xcode 15 compared to Xcode 14.3.1. For example, the Assets.car file size in the archive made in Xcode 14.3.1 is 125 MB, but in the archive made in Xcode 15 from completely the same project size is 200 MB. Assets have many images as PNG and PDF. What has changed in Xcode 15 for building Assets.car file and how the size can be reduced? Use SVG instead of PDF (and PNG?)? Thanks
0
0
761
Sep ’23
Are SVG assets faster than PNG when rendered or not?
I recently was thinking about which is the best format to use for my little icons in the app, and was considering the performance of PNG versus SVG . I know that PNG decoders are hardware accelerated and parallelized, and the rendering is as simple as placing the pixels on the screen. On the other hand, SVG requires computation to determine the placement of pixels based on mathematical equations. Considering this, my current assumption is that PNG is faster to render than SVG. However, if SVG is also hardware-accelerated, it could alter the situation, although this may not be the case.
1
0
971
Sep ’23
Missing App Icon in Asset Catalog - 1024 x 1024 on Xcode 14
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!
5
1
3.3k
Sep ’23
How to create UIImage in an extension - ShieldConfigurationExtension
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))
1
0
745
Aug ’23
PNG images with alpha channel are distorted on iOS 17 beta, Xcode 15 beta
I am rendering a png image with an alpha channel from XCAssets in a UIImageView. The rendering occurs as it should in iOS 16 / Xcode 14, but the image is distorted in iOS 17 beta / Xcode 15 beta. I am not sure why, but the distortion is very apparent. I have attached below the original PNG, as well a screenshot comparing the incorrect iOS 17 / Xcode 15 beta behavior vs the iOS 16 / Xcode 14 desired behavior. Comparision: Original image:
2
2
1.3k
Aug ’23
Image not visible in SwiftUI project
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
1
0
1.2k
Jul ’23
alternate app icon & product page optimization
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
0
0
734
Jul ’23
SVG Assets: Load Downsampled version in UIImage
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
0
0
798
Jul ’23
Progress returned by itemProvider.loadFileRepresentation always 100%
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
2
0
1.4k
Jul ’23
Xcode 15.0 - Impossible to use Symbols for Asset catalog for Assets from other target
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.
1
1
782
Jun ’23
Xcode 15 fails to build when image set contains emoji in name
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)
1
0
968
Jun ’23
iOS 16 can not display PDF file if using gradient.
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
0
2
1.6k
Jun ’23
Invalid Bundle Error When Uploading App to App Store
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.
6
2
2.7k
Jun ’23