Post not yet marked as solved
If you're targeting iOS 15+ there's an official API: https://developer.apple.com/documentation/swiftui/image/accessibilityshowslargecontentviewer(_:)
Post not yet marked as solved
@eskimo
I'm got the above working but I also need to advertise a Bonjour service with a TXT record. When I add the following code the state changes to failed and the whole thing stops working :( Any hints?
listener.service = .init(
name: "SETup",
type: "_http._tcp.",
domain: "local",
txtRecord: NWTXTRecord([
"uuid": "..."
])
)
Prints the following results:
Service started.
dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:11 Err:-1 Errno:2 No such file or directory
waiting(POSIXErrorCode: Network is down)
ready
failed(-65563: ServiceNotRunning)
FYI, I have enabled incoming/outgoing connections and added bonjour plist key/value pair.
Post not yet marked as solved
It looks as if this isn't supported directly yet. However I did manage to get it to work by pulling out the associated data. This assumes a single section so you'll need to adjust for your own implenentation however it does work and appears to update, animate etc as expected. Given the Apple sample code I was also able to add the publisher approach for cell field updates and also remove the dataSource methodsfor numberOfItems, etc...<nsmanagedobjectid, nsstring=""><section, tag="">func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChangeContentWith snapshot: NSDiffableDataSourceSnapshotReference<NSManagedObjectID, NSString>) {
// NOTE: Section.main is an enum that represents my single section
let diffable = NSDiffableDataSourceSnapshot<Section, Tag>()
diffable.appendSections([.main])
diffable.appendItems(dataProvider.fetchedResultsController.fetchedObjects ?? [], toSection: .main)
dataSource.apply(diffable, animatingDifferences: true)
}
Post not yet marked as solved
From what I can see its the Reference version just enforces reference types, i.e. classes.