Post

Replies

Boosts

Views

Activity

Reply to SwiftUI raw image conversion
Revised code with raw file taken from Xcode asset (Still have the same issue) struct ContentView: View {   @State private var image: Image?   var body: some View {     VStack {       image?         .resizable()         .scaledToFit()     }     .onAppear(perform: loadImage)   }   func loadImage() {     guard let asset = NSDataAsset(name: "Rawsample") else { return }     let data = asset.data     image = Image(uiImage:UIImage(data:data)!)   } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Cross process URL bookmark
Thanks a lot - I will give this a try - it is not a problem for all the clients to share the same app group and be published by the same team. I have done something similar using an XPC service with a single client but that seems much more straightforward to implement. Generating the named XPC endpoint from a Swift app appears more complicated and tutorials/examples hard to find. ChatGPT points me to using launchctl from the command line to register a MachServices name but this would make it complicated to distribute the application.
May ’25
Reply to Cross process URL bookmark
Before I get too far into inter process communication I've been testing the concept of passing file descriptors using XPC by using an XPC Service (this should allow me to debug the XPC communication syntax). Is it sufficient to pass a FileHandle? Passing a FileHandle is straightforward and works well with the XPC Service but would it work across processes or do I need to find some way of passing a raw file descriptor? Passing raw file descriptors seems much more complex - especially in a pure Swift application. I tried passing UnsafeMutablePointer but that failed and crashed the application.
Jun ’25