In Ivory, there are custom menu items in the ShareLink sheet that pops up.
How can I customize my own ShareLink?
Post
Replies
Boosts
Views
Activity
How is one supposed to use ShareLink(items:subject:message:)? It makes no sense to me. It accepts type Data for items. But Data's Element has to be String or URL or similar. How does this even work???
I've got a Data of deflate (zlib)-compressed data that decompresses properly using NSData.decompressed(), but does not decompress properly using compression_decode_buffer(). The working code looks like this:
let compressedData = Data(bytesNoCopy: buf.baseAddress!, count: readCount, deallocator: .none)
let dataWithoutHeader = compressedData[2...]
let ucData = try (dataWithoutHeader as NSData).decompressed(using: .zlib) as Data
The non-working code looks like this:
let samples = try [Float](unsafeUninitializedCapacity: sampleCount)
{ buffer, initializedCount in
print("Count: \(initializedCount)")
try compressedData.withUnsafeBytes<UInt8>
{ (inCompressedBytes: UnsafeRawBufferPointer) -> Void in
let destBufferSize = buffer.count * MemoryLayout<Float>.size
let scratchBuffer = UnsafeMutableRawBufferPointer.allocate(byteCount: compression_decode_scratch_buffer_size(COMPRESSION_ZLIB), alignment: MemoryLayout<Int>.alignment)
defer { scratchBuffer.deallocate() }
let decompressedSize = compression_decode_buffer(buffer.baseAddress!, destBufferSize,
inCompressedBytes.baseAddress!, inCompressedBytes.count,
scratchBuffer.baseAddress!, COMPRESSION_ZLIB)
print("Actual decompressed size: \(decompressedSize), destBufferSize: \(destBufferSize)")
}
initializedCount = sampleCount
}
It ends up printing:
Actual decompressed size: 46510, destBufferSize: 1048576
(1048576 is the correct size. What data is returned does not appear to be correct.)
I have tried it both with and without the first two bytes of the compressed data buffer, and with and without providing a scratch buffer.
It seems that there’s still no way to get all TIFF tags from a TIFF image, is that right? I've got these GeoTIFF images that have a handful of specialized TIFF tags in them. Calling CGImageSourceCopyPropertiesAtIndex(), I can see basic properties common to all TIFF images, like dimensions and color/pixel information, but no others.
Short of including libtiff, is there another way to get at the metadata? I've tried all of the options in CGImageSourceCopyAuxiliaryDataInfoAtIndex.
I've written a few bugs about this since 2020, all ignored.
I'm working on a multi-platform app (macOS and visionOS for now). In these early stages it’s easier to target the Mac, but I started with a visionOS project. One of the things the template creates is a RealityKitContent package dependency.
I can target macOS 14.5 in Xcode, but when it goes to build the RealiityKitContent, I get this error:
error: Building for 'macosx', but '14.0' must be >= '15.0'
[macosx] info: realitytool ["/Applications/Xcode-beta.app/Contents/Developer/usr/bin/realitytool" "compile" "--platform" "macosx" "--deployment-target" "14.0" …
Unfortunately, I'm unwilling to update this machine to macOS 15, as it's too risky. Running macOS 15 in a VM is not possible (Apple Silicon).
This strikes me as a bug, or severe shortcoming, of realitytool. This was introduced with visionOS 1.0, and should be able to target macOS < 15.
It's not really reasonable to use Xcode 15, since soon enough Apple will require I build with Xcode 16 for submission to the App Store.
Is this a bug, or intentional?
I've been working on a Swift PM wrapper for the libtiff library, which I installed on my Mac via Brew. So far so good. But I just tried adding it to my visionOS project. and it complained that it was trying to link against a library built for macOS:
building for 'visionOS-simulator', but linking in dylib (/opt/homebrew/Cellar/libtiff/4.6.0/lib/libtiff.6.dylib) built for 'macOS'
I wish Brew would build universal libraries, but it doesn’t, and they have no interest in doing so. What are my options?
If I build libtiff from sources, it’s still a bit of a pain to build against a different SDK. libtiff has its own Makefile I’d rather not try to edit.
Can I make an xcframework out of it? Can I statically link it into my Swit wrapper library? Do I need to hack together a C build target in my Package and copy the source files over to it?
I've run into a linker error, but when i go to look at the build transcript, all I see is an excessively formatted set of lines, with no way to see the linker command. There used to be a little icon you could click to see exactly what Xcode was trying to do.
_IOW and friends, defined in <sys/ioccom.h>, help build ioctl() calls. Is there an equivalent function in Swift?
I'm trying to communicate with an RS-485 device using a USB-to-RS-485 adapter based on a CP21012N. It's capable of speeds up to 3 Mbaud. However, when I call tcsetattr() with speed set to anything other than one of the predefined constants (using cfsetspeed()), I get an "Invalid argument" error back from the call.
Googling, I found https://github.com/avrdudes/avrdude/issues/771
Seems like macOS really can't accept baud rates outside the predefined set without resorting to ioctl?
I just started a little macOS app using SwiftUI and SwiftData. It seems to insist on placing the name of the file (along with the extension) in the title bar. I would prefer to put the name of the selection there instead (i.e. instead of "Untitled.paper", "New Article")..
Along with that, I'd like to control the appearance of "Edited" as well.
I have the suspicion that this simply isn't possible.
I would very much like to store some additional data in my SwiftData document package, outside of SwiftData. Metadata about the document that doesn't lend itself well to the underlying RDBMS nature of SwiftData. Is that possible?
It seems cross-device passkey authentication isn't supported by the Simulator, is that right? I can't tell if it's the simulator not supporting it, or my app/server failing.
My app, running in the Simulator, presents a QR code during sign-in flow. I scan that with my phone, and it just spins "connecting…".
Can anyone confirm that the Simulator just doesn't support this?
What are my options for testing this flow? I guess I need another device not sign in to my AppleID.
I've got this SwiftPM project. It has a dependency that I needed to edit, so I forked it on github and checked it out locally. Then I referenced the local repo in the Package.swift file with package(path:) instead of package(url:). This caused it to report
Package.swift: error: Missing package product 'WebAuthn' (in target 'App' from project 'server')
I had to commit my changes, and re-reference the repo, to get it to see my updates.
This problem has been around for some time, but seems to be related to how the path name differs from the built target name (it works fine in another project i have where the package directory and target have the same name).
I've submitted FB13677717 about it, but is there a workaround?
I'm working my way through adding passkey support to my app. At app launch, I'd like to test to see if the user has already created a passkey for the service, and if not, immediately present the account creation UI.
Is there an API call I can make to see if the user already has a credential? From the examples I’ve found, it seems I should just try to sign in, and I’ll get an error callback if there are no stored credentials. Is that right?
I'm having an issue with logging on my system (Sonoma 14.3.1), in that log messages disappear after 60-90 seconds, despite logging being configured to persist. This seems to happen across all subsystems.
The symptoms are:
• Watching the log stream in Console.app, messages older than 60-90 seconds disappear, even if no new messages are coming in.
• log show --last 2d only returns messages from the last couple of minutes.
I've filed FB13616761, but wondered if anyone had any other insights or suggestions. TIA