Post not yet marked as solved
After upgrading to Xcode 14 I face weird issue with PDF assets.
PNGs generated from PDF assets have transparent background instead of fancy gradient.
Issue is present in both Xcode 14.0.1 and 14.1
See attached images
Post not yet marked as solved
In my project, I have some images that contains different formats for iPhone and iPad (screenshot example).
When trying to access those images with UIImage(named: "image_name") it always return nil on iPadOS 13 and iPadOS14, while working fine on iOS, and iPadOS15.
It is also working fine for other images
Is it a known issue with Xcode ? This bug seems to have started triggering recently has the images have been working fine until the last 2 months.
I'm using Xcode 13.3
Post not yet marked as solved
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.
Post not yet marked as solved
I added my image to .xcassets file, and edited content json like launch images.
But the method UIImage imageNamed returned nil in iOS 15
This is working as well < iOS 15
Post not yet marked as solved
The problem is, I have a video file which is about 111MB with resolution 1216x2160 aaaand I can’t save it on my iPhone even though I have a plenty enough space 😭 I tried to send it via airdrop and it shows a pop up with an error and ask me if I want to save it in my documents (I tried this one as well and there’s no way to save it in my gallery from the app), I tried to send a file via telegram and also get the same error. What should I do? I can’t believe that I can shoot in 4K, but can’t save a video with a higher resolution on my iPhone
Post not yet marked as solved
The Human Interface Guidelines say, "For iOS, iPadOS, and watchOS, you can tell Xcode to generate all sizes from your 1024×1024 px App Store icon". However, I can't find a way in Xcode to do this.
For example, if I just put my 1024x1024 app store icon in the app store well in my AppIcon in my Assets.xcassets and then build, the simulator shows a generic app icon.
Any idea what I'm missing?
Thanks,
John
Human Interface Guidelines App Icons Page:
https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons
Post not yet marked as solved
I feel so wronged. In testing, I set accent color to tint color of iOS system color unfortunatly.
I had to check all files, settings for a day.
App was crashed when system set accent of UI. now that I think about it.
Maybe system try to get tint color for accenting, both color cause infinity loop each other.
Do not set app's accent color to tintColor of system color.
https://user-images.githubusercontent.com/11141077/218677717-e5335641-d49c-43f9-9a6b-119c25f62b65.png
Post not yet marked as solved
Hello,
I am trying to show a localized image using SwiftUI's Image() by overridding the system locale like this:
.environment(\.locale, Locale.init(identifier: "nl"))
Both the preview and the actual app are still showing the default (fallback) image, not the localized version.
The image is localized in a catalog (xcassets) as described here. - https://developer.apple.com/documentation/xcode/localization/localizing_assets_in_a_catalog.
When I change my system locale (to "nl") the correct image appears.
What am I doing wrong, or is this a bug in SwiftUI?
Thanks.
Post not yet marked as solved
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
Post not yet marked as solved
All the required sizes are added to AppIcon.appiconset as per Xcode 13 format.
After upgrading the application from x version to y the new app icon is not reflected inside the folder if the old version was inside a folder on iPhone however expanded folder shows the new app icon when the user clicks on the folder.
Note: The application is changed to a new name and all the assets are updated as per the new name.
Post not yet marked as solved
As you can see in the image, it seems to coming from the Xcode simulator, specifically, the assets aspect of it. I have around 250 pdf images that totals up to less than 7 MB. I have a MacBook Pro M1 32 GB and for the first time since buying it, the fan starting whirring loud. Any help will be appreciated. Thank you. And also sometimes 2-3 of those "AssetCatalogSimulatorAgent" pops up.
Post not yet marked as solved
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!
Post not yet marked as solved
Anyone else using SVG files added to Asset Catalog for images in an application? Some of my images will not show the colored portions when the application is built and run on Mac Catalyst. But it is completely random. Sometimes the SVG images will draw correctly, sometimes they won't. It's a pesky issue because I can run my application just before making a public build to test the images, and they show up fine. But the public build has the images misdrawn.
I've tried setting the rendering mode to alwaysOriginal, cleaning the project, deleting derived data, etc. The SVG images come exported from Figma, not sure if that is the source of the problem? The images have always shown correctly when run on iOS, so I'm assuming it's a Catalyst issue. Has anyone come across this issue and a fix?
Post not yet marked as solved
When I try to use custom colours in Live Activities, the activity in the Lock Screen is not appear at all.
In the code, I use an extension to conform Color to Codable, otherwise is not compile.
public typealias TimeTrackingStatus = ContentState
public struct ContentState: Codable, Hashable {
var elapsedTime: Int
var remainingTime: Int
var meetingDuration: Double
var mainColor: Color
}
}
extension Color: Codable {
// Full code in the link
}
And here is the Live Activity view:
struct TimeTrackingWidgetView: View {
let context: ActivityViewContext<MeetingTimerAttributes>
var body: some View {
VStack {
Text("Total Time: \(Int(context.state.meetingDuration)) minutes")
.padding(.top, 10)
.bold()
HStack {
VStack(alignment: .leading) {
Text("Minutes Elapsed")
.font(.caption)
Label("\(context.state.elapsedTime.secondsToMinutes())", systemImage: "hourglass.bottomhalf.fill")
}
Spacer()
VStack(alignment: .trailing) {
Text("Minutes Remaining")
.font(.caption)
Label("\(context.state.remainingTime.secondsToMinutes())", systemImage: "hourglass.tophalf.fill")
.labelStyle(.titleAndIcon)
}
}
.padding(.init(top: 5, leading: 15, bottom: 10, trailing: 15))
}
.background(context.state.mainColor) <---- This line
}
}
If I use .background(context.state.mainColor) the Live activity is not appear but if I use background(.red), for example, it works just fine.
The color are sRGB created in the assets catalog, like this one:
Any idea?
Post not yet marked as solved
Hi, this is the scenario:
I have a framework (my own pod) that defines image sets as assets. They are exported as a bundle in the framework, and images are read inside by the framework itself.
Prior to Xcode 13.0: all works flawlessly.
In Xcode 13.0, while debugging on simulator or real hw: all works flawlessly.
In a Testflight build from Xcode 13.0: images from that framework's bundle seems nil (dot not appear in app)
Things to consider:
The size between the archive builds on Xcode 13 and 12.5 have the same size.
The archive builds on Xcode 13 and 12.5 do show the same Asset.car within the framework's bundle. Image filenames do appear listed, case sensitively correct.
The framework's bundle also uses other non image files (.strings, .storyboards) with no problem. Issue affects image sets from assets (.svg, .pdf, .png, all file extensions effected)
I could provide a demo project to repro, but the attachment in the forum doesn't allow it :S
Post not yet marked as solved
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
Post not yet marked as solved
If I select an image asset and set its target membership, it sets the target membership for all assets to be the same. This seems to be a problem with the latest Xcode update.
Post not yet marked as solved
Hi, I'm working with quite a lot of image sliders in my app, but they consume a massive amount of memory that continues to be held even after you exit the view. To save the images we use the assets. I have read about downsampling images, but I did not find a solution how to downsample images from the assets. Does anyone know a solution?
I am still quite new to Swift and thank you in advance for answers.
Post not yet marked as solved
Using xCode 13.4.1, my assets catalog (assets.xcassets) has gone blank. Which is to say when I click on the icon in the left-hand Navigator, the normal OutlineView and DetailView are replaced by a large white area of screen.
If I try, for example, to drag a new image file into this area, it bounces out.
The existing assets are still there; when I run the app the images, etc., appear as expected. I just can't see them to manage them (or add new assets).
I have restarted xCode several times to no avail. Has this ever happened before? Does anyone have a solution?
BTW, in other app projects, the assets catalogs are working normally. It is just in one project where the catalog is "blank"
With the rising amount of assets in the iOS app, the time to compile them is also growing. Is it possible to speed up asset catalog compilation for development purposes only?
E.g. perhaps there are shortcuts or build settings to only copy the assets instead of compressing & optimizing them for debug / developer builds.