This is both a heads-up to other developers, and a request for workarounds:
I noticed that the CoreML image segmentation model in my app crashes when compiling the app with Xcode 13 and running it on an iOS 14 device.
Compiling the same app and model with Xcode 12 the compiled CoreML model works just fine when running on the same devices.
The crash seems to be caused by CoreML trying to access the MLShapedArray type, which was only introduced in iOS 15 (see stack trace in screenshot).
So if you have an app using CoreML, make sure you test on iOS 14 devices before submitting a new build using Xcode 13.
For Apple folks, I filed a Feedback on this a little while ago (and of course heard nothing back). The ID is 9584636.
I had hoped this issue would get fixed before the Xcode 13 release, but unfortunately it is still there in the GM build.
Any workarounds (aside from 'keep using Xcode 12') would be appreciated.
Post marked as Apple Recommended
After a user complained that they could no longer load partially transparent PNG images in my photo compositing app, I eventually tracked this down to a bug in iOS 15.1 (tested on beta 2).
When the user selects a PNG image in the PHPickerViewController, the returned NSItemProvider reports having a file for the "public.png" UTI (and only that one).
However when requesting data for that UTI, the system actually returns JPEG image data instead.
Just a heads up to other developers who might run into this.
Hopefully it will get fixed before 15.1 ships.
I reported it as FB9665280.
Post not yet marked as solved
A heads up to other developers using CoreML: Make sure to test your apps and CoreML models on an A15 device like the new iPhone 13.
My app uses CoreML for a custom image segmentation model. Which runs fine on all previous devices, but hangs/crashes on my iPhone 13 Pro, and (based on customer reports) on other devices with the A15.
The error seems to happen when part of the model is executing on the Neural Engine.
I worked around it for now by not using the Neural Engine when running on A15 devices.
modelConfig.computeUnits = UIDevice.current.hasA15Chip() ? .cpuAndGPU : .all
where hasA15Chip() is a custom helper method.
For Apple engineers: I provided additional information in FB9665812.
We have a reasonably complex mesh and need to update the vertex positions for every frame using custom code running on the CPU. It seems like SceneKit is not really set up to make this easy, as the SCNGeometry is immutable. What is the easiest (yet performant) way to achieve this? So far I can see two possible approaches: 1) Create a new SCNGeometry for every frame. I suspect that this will be prohibitively expensive, but maybe not? 2) It seems that SCNProgram and its handleBinding... method would allow updating the vertex positions. But does using SCNProgram mean that we have to write all our own shaders from scratch? Or can we still use the default Scenekit vertex and fragment shaders even when using SCNProgram?
Post not yet marked as solved
Our iMessage app sends user generated videos via the newactiveConversation?.sendAttachment(movieFileURL, withAlternateFilename: nil, completionHandler:{...})I noticed that videos sent this way always appear to get re-encoded with a bit rate of about 1Mbit/s.Is there any way to prevent this re-encoding (and the resulting quality loss)?I experimented with different video resolutions and encoding settings, as well as with using MSMessageTemplateLayout instead, but without success so far.I noticed that Animoji video messages do get sent with a bitrate closer to 2Mbit/s, but maybe that is using private APIs? Or because they are 60fps instead of 30fps?
We are working on an app that is somewhat similar in nature to Apple's Animoji app and are facing the problem that the iPhone will go to sleep while the user is recording a video message.In a regular app this can be prevented viaUIApplication.shared.isIdleTimerDisabled = trueHowever that is not an option in an iMessage app.Is there any way to prevent the iPhone from sleeping while the user is recording a video in our app?