I have an app that is written in Swift, exclusively in Swift, never had an Obj-C class, has no Obj-C files or bridging headers.
In order to add some functionality without impacting my app's entitlements, I'm trying to add an XPC service -- I created this in Xcode, and the template for XPC services in Xcode is Obj-C only.
This is fine, I wrote my service out in Obj-C, but now when I want to call my service through
Okay, so I figured out a solution.
1) Deleted the boilerplate Obj-C service class and protocol files.
2) Wrote my protocol and vended object classes in swift. Made sure these could be exported to Obj-C.
3) Added the protocol.swift file to my app's target. Added
#import "Service-Swift.h" to my service's
So now my XPC object is implemented in Swift, my object protocol is in swift, the only non-swift file is my XPC's main.