Unable to access Swift 4 class from Objective-C: “Property not found on object of type”

后端 未结 6 608
南笙
南笙 2020-12-04 18:55

Using the latest Xcode 9 beta, I\'m seemingly completely unable to access properties on Swift classes. Even odder, I can access the class itself to instantiate it or whateve

6条回答
  •  遥遥无期
    2020-12-04 19:27

    Xcode 10.2 | Swift 4 Adding @objcMembers before class solved my problem.

    @objcMembers class MyClass:NSObject {
       var s1: String!
       var s2: NSMutableArray!
    }
    

提交回复
热议问题