AVKit provides the SwiftUI view VideoPlayer, and allows you to add an interactive overlay. But that overlay is normally placed behind the system-provided playback controls.
Is there any way to suppress those controls, without resorting to wrapping AVPlayerView?
Post
Replies
Boosts
Views
Activity
How does one print from a SwiftUI app (on macOS)? Is there any SwiftUI or Swift API for this, or do I just use the old AppKit APIs (https://developer.apple.com/documentation/appkit/printing)? What if I wanted to print from iOS?
I don't know why we’re up to Xcode 16 and this stuff is still so damn difficult.
First of all, I don't know why I can't just send a .app I built for my M1 MacBook Pro to my friend who also has an M1 MacBook Pro. But even after going through the quarantine steps, he gets an alert saying the app can't be opened.
So I'm trying to do direct distribution of an archive. But that gives me two errors:
There is a problem with the request entity
You already have a current Developer ID Application Managed (With Kext) certificate or a pending certificate request.
No profiles for 'com.latencyzero.VideoBox' were found
Xcode couldn't find any Developer ID provisioning profiles matching 'com.latencyzero.VideoBox'.
The signing is managed by Xcode. CloudKit access works.
Near as I can tell, Compression doesn't support LZW, is that right? I'm not sure if the available compression algorithms implicitly know how to decompress LZW.
FB14643019
In Ivory, there are custom menu items in the ShareLink sheet that pops up.
How can I customize my own ShareLink?
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?