swift 3 method in objective-c fails with no visible @interface for 'MySwiftClass' declares the selector 'addX:andY'

前端 未结 3 1205
天涯浪人
天涯浪人 2020-12-08 14:35

we are trying to reference swift methods inside an objective-c implementation.

Swift 3 Class:

import Foundation
@objc class MySwiftClass: NSObject {         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 15:12

    In my case I had forgotten to add:

    #import "MyProject-Swift.h"
    

    Into the obj c file.

提交回复
热议问题