Post

Replies

Boosts

Views

Activity

Comment on MetalKit in SwiftUI
make the MTKView a lazy var in the Coordinator class and set mtkView.delegate = self when returning it. Return context.coordinator.mtkView from makeUIView. You'll find this pattern in PaymentButton.swift in Apple's Fruta sample. Unfortunately engineers of other frameworks don't get it quite right, e.g. Coordinator(self) is wrong because anyone who knows SwiftUI knows the View struct is immediately discarded.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’22
Comment on How to show SwiftUI PhotosPicker programatically
Excellent, thanks for taking the time to let me know about this! It works exactly as I wanted but sadly the way the picker view controller is shown is still very buggy so I likely will still use my own version using UIViewControllerRepresentable. Very strange it is missing from the documentation, I'm guessing its because the doc parser is not smart enough to process an extension of View in SwiftUI framework when working on the PhotosUI framework - submitted feedback FB11434717.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22