Problem
As the title says, Safari lost all my tabs once I updated to macOS 15.4. I do of course have "Safari opens with: All windows from last session" set. This has been my default for many years.
Past Mitigation
In the past I had a script that I could use to backup ~/Library/Safari that would save all my bookmarks and tabs. Unfortunately they made this method of backup non-function sometime around when tab groups were introduced.
Suggestion
Fortunately my tab groups are still intact. But this sort of problem doesn't give me a lot of confidence. I haven't had something like this happen in a while, but when it does happen, it's quite frustrating. Apple really needs to recognize that this sort of thing can and will happen and they should make it easier for users to manually save/restore their tabs.
Problem with forums
To add insult to injury, as I was typing this message in the forum, I decided to select "Edit Bookmarks"... which proceeded to replace the current window with my bookmarks, thereby losing my post! It did this without warning of page content changes (which I get from most other websites).
I felt somewhat relieved that the forum had recognized a previous draft and offered for me to continue. However, when I selected it, it brought me back to an old post... that was actually posted!
smh
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
According to the documentation (https://developer.apple.com/documentation/avfoundation/avplayeritem/externalmetadata), AVPlayerItem should have an externalMetadata property. However it does not appear to be visible to my app. When I try, I get:
Value of type 'AVPlayerItem' has no member 'externalMetadata'
Documentation states iOS 12.2+; I am building with a minimum deployment target of iOS 18.
Code snippet:
import Foundation
import AVFoundation
/// ... in function ...
// create metadata as described in https://developer.apple.com/videos/play/wwdc2022/110338
var title = AVMutableMetadataItem()
title.identifier = .commonIdentifierAlbumName
title.value = "My Title" as NSString?
title.extendedLanguageTag = "und"
var playerItem = await AVPlayerItem(asset: composition)
playerItem.externalMetadata = [ title ]
When using a List in SwiftUI, expanding row items using anything other than the default DisclosureGroupStyle seems to cause a "bounce" during expansion/collapse.
What is the recommended way to avoid this bounce?
Link to code: https://github.com/dannys42-bugs/BugListExpansion
(includes a small video demonstrating the issue)
I'm trying to make a macOS app using SwiftUI that supports dragging arbitrary files from the app into finder. However, I'm getting this error:
"Sandbox extension data required immediately for flavor public.file-url, but failed to obtain."
I'm looking through the entitlements and not finding anything obvious here.
I've tried various forms of NSItemProvider():
Try 1:
let itemProvider = NSItemProvider(item: image.data as NSSecureCoding, typeIdentifier: image.uniformType.identifier)
// Tried presenting as data
itemProvider.registerDataRepresentation(for: .fileURL, visibility: .all) { completion in
...
}
// Tried presenting as file
itemProvider.registerFileRepresentation(for: .fileURL, visibility: .all) { completion in
...
}
Try 2:
let itemProvider1 = NSItemProvider(contentsOf: tempFileUrl, contentType: .fileURL)
Tried using this form as well.
In the completion handler for register*Representation(), i'm typically creating a temporary file and returning that.. (either the URL to the file or the data directly, depending on the API):
let tempFileUrl = URL.temporaryDirectory.appending(path: "testfile.png")
_ = tempFileUrl.startAccessingSecurityScopedResource()
defer { tempFileUrl.stopAccessingSecurityScopedResource() }
completion(tempFileUrl as data, nil) // option 1
completion(data, nil) // option 2
Disabling App Sandbox in the entitlements file does not work, but the error message goes away. So it seems like I have two problems: some sort of entitlement error and I must be using NSItemProvider() incorrectly.
Anyone have any suggestions? I don't see to many examples out there for supporting exporting files (e.g. images) from an app into Finder.
Thanks!
Can SwiftData be used with UIManagedDocument? Also if the UIManagedDocument is integrated with CloudKit?
What is the recommended way to uninstall Xcode server? I've seen people online suggest simply removing /Library/Developer/XcodeServer. Should I do this and/or uninstall the "Xcode Server" user? Or is there a better way?
I'm using AVAudioSession to get raw samples from a microphone and trying to display a waveform. Does anyone know what is the range of values to expect? I don't see anything in the documentation. From testing, I can see that it can go up to +/- 4.
The only reliable way I seem to be able to do this is to use AVAudioConverter() to convert the samples to Int16, then to normalized floats. But that seems rather inefficient.