Post

Replies

Boosts

Views

Activity

Reply to SpeechAnalyzer speech to text wwdc sample app
I'm also having this issue and quite disappointed that no Apple engineers have replied to / updated this thread given it's been a week and people are testing out this new API. It looks like from my logs it could be some very simple bug with a comparison involving - vs _ as my allocated locales are [en_GB (fixed en_GB)] and my error is Cannot use modules with unallocated locales [en-GB (fixed en-GB)]. So perhaps it's seeing the en_GB and en-GB as incompatible? Feedback submitted under FB18601340
Topic: Media Technologies SubTopic: Audio Tags:
Jul ’25
Reply to Getting 18.3.1 (22D8075) Simulator via xcodebuild
It seems the docs I'm following aren't correct at: https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components#Download-Xcode-components-from-the-command-line To specify an Xcode version, add the -buildVersion option: xcodebuild -downloadPlatform iOS -exportPath ~/Downloads -buildVersion 16.0 But where Apple writes Xcode it seems this is the iOS version, so doing xcodebuild -downloadPlatform iOS -exportPath ~/Downloads -buildVersion 18.3.1 For example gives me iOS 18.3.1 I've added a bug report FB16950119
Mar ’25
Reply to Animating UIHostingController size change with SwiftUI view size change
It seems like the only solution I can find here is to bubble events back up from SwiftUI to UIKit, explicitly setting the hosting controller's view's height. You can use some kind of callback from SwiftUI (eg a closure delegate) to call: hostingController.view.superview?.layoutIfNeeded() UIView.animate(.snappy) { self.heightConstraint.constant = self.calculateHeight() self.hostingController.view.superview?.layoutIfNeeded() } Set the height constraint of the hosting controller's view and activate it. You can calculate the view's height with the auto layout/UIKit methods you might be used to already, wrapping it in deactivate/activate height constraint to get the exact (minimum) height: func calculateHeight() -> CGFloat { heightConstraint.isActive = false defer { heightConstraint.isActive = true } return hostingController.view.systemLayoutSizeFitting( .init( width: hostingController.view.bounds.width, height: UIView.layoutFittingCompressedSize.height ), withHorizontalFittingPriority: .fittingSizeLevel, verticalFittingPriority: .fittingSizeLevel ).height }
Topic: UI Frameworks SubTopic: SwiftUI
Mar ’25
Reply to Xcode Extension isn't show up in the Editor menu
TLDR: Good news, those instructions worked for me! Notably, I followed those instructions twice, the first time for my existing project and the second time from scratch using your steps (including selecting the 'Mac app' template) It seems the only different between my setup and yours: I use the macOS > App template Whereas I was using the 'Multiplatform > App' 😬 I've filed a bug report under number FB16853042 for this via Feedback Assistant linking the above threads too. Also, OOI, where is your XcodeZone folder? I'm wondering if I should keep my main Xcode in Applications and keep the betas / older versions in another part of disk just to prevent any other weirdness (I've seen things like this before where multiple Xcodes can conflict)
Mar ’25
Reply to Xcode Extension isn't show up in the Editor menu
So, it looks like having multiple versions of Xcode on the same machine (Xcode 16.2 release plus a couple of betas for 16.3) means this doesn't show up. @DTS Engineer Is there a way to do this while having multiple versions of Xcode? I found this Github thread but it doesn't seem to work for me: https://github.com/nicklockwood/SwiftFormat/issues/494#issuecomment-547101989 I've also tried the trick of renaming Xcode.app and moving it in and out of the Applications directory to (allegedly) refresh some cache somewhere but no luck
Mar ’25
Reply to Subclass UITextView using TextKit2
Thanks @DTS Engineer for the suggestion and code! In answer to the second part, I’m wanting to recreate a Pages/Word style document writing app that has custom rendering of the same body of text over multiple “pages“. I’ve got a rough working prototype using custom TextKit2 drawing to views but implementing UITextInput manually is A LOT of work. I was hoping instead to make use of UITextView given I only want to control the layout (drawing) of the fragments and essentially get the text editing experience for free. But this has proved very difficult (there’s also almost no documentation on this topic other than 2 WWDC videos so it’s a much more difficult task). I‘ve been able to achieve the above by using a UITextView (without subclassing) and using custom rendering but this draws the text on top of the UITextView in its multiple pages, duplicating the drawn text (not what I want as it effectively draws the UITextView’s text on a layer below as normal, then my text is rendered above it in separate page views, added as subviews to the UITextView) So I thought perhaps the next step would be to subclass UITextView for more control. Hopefully you can see what I’m trying to do, does that make sense?
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’24
Reply to How to link multiple text views to a single text storage in TextKit 2
I've found the documentation on this topic to be really awful with little to explain the relationships between all these elements and the existing documentation to be outdated using TextKit1 (Note the below is archived) https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextSystemArchitecture/ArchitectureOverview.html @DTS Engineer is there any docs for TextKit2 and how its new classes interface with each other? The TextKit2 sample code has a lot of nuance which is impossible to learn unless you know it exists
Topic: App & System Services SubTopic: General Tags:
Aug ’24
Reply to Multiple text containers on layout manager and edibility
I'm working on an older project so apologies for my fuzzy memory. I think my initial attempt was to use TextKit2 now I'm looking at the code. But there was a limit of only using one NSTextContainer. Am I right in thinking if I wanted to create that multi-page setup I'd need each "page" to have its own layer that's drawn in to? Similar to the Bubble TextKit2 example code does? I found this forum post which it sounds like it was going to change to add multiple containers, So I'm quite confused in this... https://developer.apple.com/forums/thread/682251
Topic: UI Frameworks SubTopic: UIKit
Aug ’24
Reply to SwiftData Document-based app produces strange write errors
Did you find a fix for this? I'm seeing the same thing... Failed to create document. Error: Error Domain=com.apple.DocumentManager Code=2 "No location available to save “Untitled.myFile”." UserInfo={NSLocalizedDescription=No location available to save “Untitled.myFile”., NSLocalizedRecoverySuggestion=Enable at least one location to be able to save documents.}
Aug ’24
Reply to NO ANIMATIONS in NavigationStack or NavigationSplitView
Thanks for the workaround... shame this issue is still around in iOS 18 Beta 2 / Xcode 16 beta 2. For anyone else, my code has to look like this : @State private var path = NavigationPath() // body { // Navigation Split View Detail ... { NavigationStack(path: $path.animation(.linear(duration: 0))) { VStack { Text(document.imageUrl?.absoluteString ?? "") .frame(maxWidth: .infinity, maxHeight: .infinity) .id(document.imageUrl) .transition(.slide) .overlay( alignment: .bottomTrailing, content: makePrevNextView ) } } // } // } Note, the VStack is necessary and fails without it...
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’24
Reply to Using @Bindable with a Observable type
Specifically the compiler errors with: Failed to produce diagnostic for expression; please submit a bug report (Swift.org - Contributing) On the parent function the @Bindable is inside of and with a Command SwiftCompile failed with a nonzero exit code In the app target.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’24
Reply to macOS widget preview error
I'm having the same issue and this just looks like I've done something wrong as a developer with this error rather than it not being supported by Xcode/Previews any more - kind of sucks as a dev experience as I could have just wasted a ton of time trying to fix something that isn't broken
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’24