Dear Sirs,
I'm writing an audio application that should show up to 128 horizontal peakmeters (width for each is about 150, height is 8) stacked inside a ScrollViewReader. For the actual value of the peakmeter I have a binding to a CGFloat value. The peakmeter works as expected and is refreshing correct. For testing I added a timer to my swift application that is firing every 0.05 secs, meaning I want to show 20 values per second. Inside the timer func I'm just creating random CGFloat values in range of 0...1 for the bound values. The peakmeters refresh and flicker as expected but I can see a CPU load of 40-50% in the activity monitor on my MacBook Air with Apple M2 even when compiled in release mode. I think this is quite high and I'd like to reduce this CPU load. Should this be possible? I.e. I thought about blocking the refresh until I've set all values? How could this be done and would it help? What else could I do?
Thanks and best regards,
JFreyberger
Overview
Post
Replies
Boosts
Views
Activity
Hi,
just generated a HDR10 MVHEVC file, mediainfo is below:
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Codec configuration box : hvcC+lhvC
then generate the segment files with below command:
mediafilesegmenter --iso-fragmented -t 4 -f av_1 av_new_1.mov
then upload the segment files and prog_index.m3u8 to web server.
just find that can not play the HLS stream on Safari...
the url is http://ip/vod/prog_index.m3u8
just checked that if i remove the tag Transfer characteristics : PQ when generating the MVHEVC file.
above same mediafilesegmenter command and upload the files to web server.
the new version of HLS stream is can play on Safari...
Is there any way to play HLS PQ video on Safari. thanks.
Since iOS 12 it has become difficult to detect the end of playback using the system music player.
In earlier iOS versions, the now playing item would be set nil and you would receive a notification that the player stopped.
In iOS 12 and later, nowPlayingItem still contains the current song and the only notification you get is MPMusicPlayerControllerPlaybackStateDidChangeNotification with the playbackState set to MPMusicPlaybackStatePaused.
Pressing pause in my car (or any remote access) generates the same conditions making it difficult to correctly detect the difference.
It would be nice if they added a notification that playback was done (similar to the other players).
Any suggestions?
Using Xcode to build and deploy the app to my watch, this is what I get:
“Waiting to reconnect to Apple Watch. Previous preparation error: Transport error." And then “Connecting to Apple Watch. Xcode will continue when the operation completes.”
And these messages continue to switch between each other.
Sometimes the watch to connect and the application starts, but more often a scenario occurs with endless reconnection.
I'm using: MacOS 14.4.1 (MacBook Pro 2019; 1.4 GHz Quad-Core Intel Core i5), Xcode 15.3, Watch OS 10.2 (Apple Watch SE 1), iOS 17.1.1 (iPhone 15 Pro).
Methods I tried:
Connecting Macbook, iPhone and Watch to the same WIfi network;
Disabling Watch (and IPhone) from the "Devices and Simulators" menu and setting up Watch (and IPhone) from the beginning.
Any help?
Hey there,
i implemented live activity in my app and iam trying to start the live activity from push notification, updates works fine even when the app is in background but starting the activity creating issue mostly on background and kill mode when i check the delivery of live activity on cloudkit console it says stored for device power considerations.
anyone having the same issue ?
Hey folks,
I have a legacy game that is running OpenGL ES - and it no longer works on the simulators that are running Apple Silicon, ie iPhone 15 Pro, or the 13" iPads. And yes, i'm also running on Apple Silicon (M1 Max).
The apps work fine on the actual devices, but the simulator crashes on any glDrawElements with a stack that looks like the following:
I have not yet seen an announcement about this not working but i've seen mention in other apps of stopping to support GL (https://github.com/maplibre/maplibre-native/issues/2351)
Can anyone shed some light? I'm obviously going to try to fix it, or find a recent sample app from which to start to see what might be up. Or move to metal, but i hadn't bargained for that level of effort atm ;)
Any suggestions appreciated!
I'm developing a single target watchOS app that obtains HealthKit information. I have the "Background Delivery" option checked under "Signing & Capabilities" for the watch target. The app does HKObserverQueries in the foreground that work as I would expect. But when I click the Digital Crown to return to clock face, the HKObserverQuery activity stops. I'm using Xcode 15.4, on Mac 14.5 and a Apple Watch Series 4 running 10.5.
Hi,
I'm testing out Xcode 16 beta and I have a couple of questions:
Is Swift Assist only available on Sequoia? I see that predictive code completion is per https://www.apple.com/newsroom/2024/06/apple-empowers-developers-and-fuels-innovation-with-new-tools-and-resources/, but I tried the beta on Sonoma and I'm not seeing it
Regarding Swift Assist - I understand that code is only used to process requests and never stored on servers, and Apple will not use it to train machine learning models. However, my company's security team may still decide that using Swift Assist is too much of a risk. How can we disable it across multiple developer machines?
Thank you!
I was hoping for an update of SwiftData which adopted the use of shared and public CloudKit containers, in the same way it does for the private CloudKit container.
So firstly, a big request to any Apple devs reading, for this to be a thing!
Secondly, what would be a sensible way of adding a shared container in CloudKit to an existing app that is already using SwiftData?
Would it be possible to use the new DataStore method to manage CloudKit syncing with a public or shared container?
It looks like Xcode 16 has changed this behaviour so I'm not sure if this is a bug or not.
When a SwiftUI Button wraps a UIImageView and the button style is .plain the button doesn't work without setting isUserInteractionEnabled.
struct ContentView: View {
var body: some View {
Button {
print("Hello World!")
} label: {
UITestImage()
}
.buttonStyle(.plain)
}
}
struct UITestImage: UIViewRepresentable {
func makeUIView(context: Context) -> UIImageView {
let view = UIImageView()
// view.isUserInteractionEnabled = true // Fix
view.image = UIImage(systemName: "plus")
view.contentMode = .scaleAspectFit
view.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
view.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
view.layoutMargins = .zero
return view
}
public func updateUIView(_ uiView: UIImageView, context: Context) {}
}
This feels unexpected, is this a bug?
In a SwiftUI app for MacOS, vertical sliders that I'd created using a rotationEffect of 90° disappeared when I upgraded to Sonoma 14.5 (23F79). With rotations less than 90°, the slider is still visible, but its button is enlarged, growing in size as the rotation angle approaches 90°.
Note that the sliders still work, even when rotated by 90° and invisible!
The screenshot and code below demonstrates the problem, which did not exist in MacOS 14.2.1
struct ContentView: View {
@State var speed = CGFloat(1)
var body: some View {
HStack {
let angle: [Double] = [0, 45, 80, 85, 90]
ZStack {
ForEach(0...4, id: \.self) { i in
ZStack () {
Rectangle()
Slider(value: $speed,
in: 0...10
)
}
.frame(width: 100, height: 10)
.rotationEffect(.degrees(angle[i]))
.offset(x: CGFloat(i * 100) - 180)
}
}
}
.padding()
.frame(width: 600, height: 200)
}
}
#Preview {
ContentView()
}
Hello, I have a fully functional webauthn relying party that uses passkeys and I am trying to implement an iOS sdk for it. On the server, the AASA file is valid and well served at /.well-known/assetlinks.json. I verified its validity with branch.io and that it is indeed cached by Apple's CDN (https://app-site-association.cdn-apple.com/a/v1/service.domain.com), but even will all these I still get the following error when installing the app on a device and starting the passkey ceremony:
Passkey authorization failed. Error: The operation couldn’t be completed. Application with identifier TEAM.com.APP is not associated with domain service.domain.com
So I then checked the system log when installing the app on my iPhone, and under the swcd process (which is apparently responsible of fetching the AASA file) I found the following error:
swcd: Domain is invalid. Will not attempt a download.
The issue that I have is that my domain is actually an IDN, it has a special character in it. But everywhere I have used it, I converted it to ASCII (punycode). With this conversion, Apple's CDN is able to fetch the AASA file, and the passkey ceremony works fine on a browser.
So I don't understand how the device (both iPhone or Mac) finds this domain to be invalid? In the app's entitlements, I added the capability for an associated domain, with webcredentials:service.domain.com with the domain name converted to ASCII (punycode) and developer mode doesn't address this issue as it appears when the app is installed (and is not related to Apple's CDN).
The last thing I tried was to add the domain with special characters in the app's entitlements (for webcredentials:) but then Xcode was unable to install the app on the device, and gave the following error:
Failed to verify code signature (A valid provisioning profile for this executable was not found.)
which happened only with a special character in the domain in the app's entitlements.
All this leaves me kind of in a dead end, I understand Xcode or iOS/macOS has a hard time with IDNs and special characters (so do I), but I have no idea on how to solve this (without changing the domain name), so I would really appreciate any help. Thanks in advance.
PS: I tested all this previously with another domain without special characters and it was working. It also had dashes ('-') in it and the new domain converted to ASCII is basically a regular domain with '-' in it so I suppose there is some kind of conversion made from ASCII back to special characters and that then, the domain is considered as invalid, but this doesn't really help me a lot...
PS2: My devices are running on iOS 17.4.1 and macOS 14.4.1 with Xcode 15.2
I am following the Downloading Analytics Reports guide which consists of five steps:
request the ONGOING report generation for the app once
list all analytics report requests for the app
list all analytics reports based on the analytics report request id
:x: list all analytics report instances based on the analytics report id
list all segments of the analytics report instance to get the download url
I can only complete the third step which returns a list of all available reports.
However when I continue with step four, the request for the analytics report instances returns with a response code 200 but the data array is always empty:
I am using the Home Screen Widget Installs report but this is also happening for other reports
Also changing or omitting the filter doesn't change anything
{
"data": [],
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/analyticsReports/{reportId}/instances?filter%5Bgranularity%5D=DAILY"
},
"meta": {
"paging": {
"total": 0,
"limit": 50
}
}
}
What could be the reason that the data array is empty and how can I fix it because there is no error message?
When trying to run my document-based iPad app using iPadOS 18 beta and Xcode 16 beta, I get an error like the following after opening a document:
Thread 1: Fatal error: Failed to identify a store that can hold instances of SwiftData._KKMDBackingData<MyProject.MyModel> from [:]
In order to help track down what is going wrong, I downloaded the sample app from WWDC23 session "Build an app with SwiftData" found here: https://developer.apple.com/documentation/swiftui/building-a-document-based-app-using-swiftdata
When I try to run the end-state of that sample code, I get a similar error when running the app on my iPad and creating a new deck:
Thread 1: Fatal error: Failed to identify a store that can hold instances of SwiftData._KKMDBackingData<SwiftDataFlashCardSample.Card> from [:]
Given that the sample project is generating the same error as my own project, is this a problem with SwiftData and document-based apps in general? Or is there a change of approach that I should try?
I am working on an app for a home automation device.
If I were using HomeKit exclusively I could add custom services or custom characteristics on standard services and these things would all be reported to my app via HomeKit. There is sample code from Apple that demonstrates how to do this.
When a Matter device is commissioned using HomeKit you might expect custom clusters and/or custom attributes in a standard cluster would be translated to appropriate HomeKit services and characteristics, but this doesn't appear to be the case.
Is there a way to have HomeKit do this?
If not it seems I would need to use Matter directly rather than via HomeKit to access custom features. But if I commission the device using Matter in my app then I understand a new fabric is created and the device would not show in the Home app. Maybe the user needs to commission the device twice, once with my custom app and once with the Home app? That seems like a poor user experience to me. Perhaps that is the price paid for using a cross-platform standard?
Is there a better way to get the same level of customization using Matter that I am able to get using HomeKit?
Reposting (after a while) from the Swift forums - the build timeline for our project has a lot of weird gaps in the beginning - almost 15 seconds in total, which is quite a big chunk of the total build time. Is there any way to determine why they exist or how I could fix them? I hope it's just something hidden and not the build system literally doing nothing...
This is on Xcode 15.4.
I was my understanding that you're supposed to be able to open a .ips crash log in Xcode and see pretty much what you would see if the app had been running in the debugger when it crashed. But the addresses in my app don't get symbolicated. I opened the .ips in the same project and same version of Xcode that was used to create the app. The .dSym file is around, and I can use it to symbolicate using the atos tool. What am I missing?
Hello forum,
Hope all is great!
I have a shortcut automation which uses the transaction trigger. Since updating to ios 18 the transaction trigger does not work anymore.
Whenever a transaction is done, the “Running your automation” notification does not show up and the automation does not work.
To share with you the steps I’ve done so far:
1.Remove the automation and do it again
2.Remove the card from apple pay
3. Delete and install again the shortcut app
4. Turned on and off the phone
I can confirm the automation works on my other iPhone with the latest version of IOS 17.
Would really appreciate if anyone has any insights about that, or if this happened to you as well.
Cheers!
Dorin
This is a copy of a reply to this post.
https://developer.apple.com/forums/thread/722222?page=1
I'm posting as new in the hope someone might have more up-to-date information, as I'm pulling out what little hair I have left.
I'm using Storekit 2, testing in Xcode with a local Storekit config file. I have created a very minimal system to investigate this issue. I have a SwiftUI-based window using SubscriptionStoreView, and my app set up with the usual listener. I have four types of auto renewing subscription, configured in the local Storekit config file.
With my app running, I subscribe to the lowest-level subscription I offer, via the SubscriptionStoreView. Notification of the inital purchase arrives, but subsequent auto-renewals do not trigger any action in my listener for Transaction.updates. They arrive as expected in the Transaction Manager. Radio silence in my listener.
If I upgrade one subscription (via my SubscriptionStoreView) I see this reflected in the UI immediately, and also in the Transaction Manager, but the update that arrives in Transaction.updates refers to the old subscription, and has the isUpgraded flag set to false.
Also, can anyone remind me what the grey warning triangle next to entries in the Transaction Manager means. I'm assuming it means unfinished, as that's what the sidebar indicates.
Can the testing system really be this broken, or am I wildly off the mark? Unless I'm doing something fundamentally wrong this all seems extremely flakey, but happy to be proved wrong.
I find this all rather unsettling if I can't test reliably, and am concerned that I my app may end up in this situation if I use storekit 2:
https://stackoverflow.com/questions/73530849/storekit-renewal-transactions-missing-in-transaction-all-or-transaction-updates
Some of our users encounter an issue after updating their iPhone/iPad to iOS 17.5.1.
The tokens passed in the Shield Configuration extension don't match the tokens they selected in my app using the FamilyPicker before updating to iOS 17.5.1. It seems the tokens changed for no reason. My app can't match the token from the ShieldConfigurationDataSource to any tokens stored on my end, causing my shield screens to turn blank. The same applies to tokens in the Device Activity Report extension.
The only workaround I've found is to tell affected users to unselect and reselect apps and websites to block in my app. This gets them new tokens from the FamilyActivityPicker, which solves the issue. However, for some users, the bug reoccurs a few days later. Tokens seem to change again, causing the same issue in the Shield Configuration extension.
I am not able to reproduce the issue on my test devices so I have no sysdiagnose to attach. However, this issue is affecting other screen time apps:
https://developer.apple.com/forums/thread/732845
https://forums.developer.apple.com/forums/thread/756440
FB14082790
FB14111223
A change in iOS 17.5.1 must have triggered this behaviour. Could an Apple engineer give us any updates on this?