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

后端 未结 6 612
南笙
南笙 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:28

    As for Swift 5.1 I found that "@objc" is not enough, but also make it public "@objc public":

    @objc public class SomeClass: NSObject {
        @objc public let amount: NSNumber
    ...
    

提交回复
热议问题