Search Unity

UnityFramework-Swift.h error with WCSessionDelegate

Discussion in 'iOS and tvOS' started by Gillissie, Jan 3, 2022.

  1. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    I don't really get into the technical ins-and-outs of platforms, so hopefully this problem is easy for someone else to solve.

    I'm making an iOS app with plans to have an Apple Watch companion app. I've been working on communication between Objective-C and Swift, since SwiftUI seems to be the way to go these days when it comes to native iOS/WatchOS stuff.

    I have succeeded in commicating between Objective-C and Swift, so the next step is to communicate between the iPhone Swift and the Watch Swift. I'm using the seemingly standard and fairly simple WatchConnectivity with WCSessionDelegate in my Swift class (which is accessible by the Objective-C code). SwiftComm is the name of my Swift class that implements the WCSessionDelegate interface (or protocol or whatever they call it in Swift).

    However, when I build, this error happens in the automatically-generated UnityFramework-Swift.h file. I have no idea how to fix this. Any help is appreciated.

    See screenshot for error:
    Screen Shot 2022-01-03 at 4.31.49 PM.jpg
     
  2. RubenGarciaHernandez

    RubenGarciaHernandez

    Joined:
    Jan 13, 2022
    Posts:
    6
    I am affected by a similar issue. Unity 2020.3.35. iOS build.
    public class BluetoothControl: CBPeripheralManagerDelegate {}