Why does the Member Macro work in objc code, but the Peer Macro does not?
//MARK: - Member Macro
@ObjCConvertMacro
class TestModel: NSObject, Codable {
var convertCaseFromOptionalInt: Int?
// Expand macro
@objc
var convertCaseFromOptionalIntObjc: NSNumber? {
get {
convertCaseFromOptionalInt as? NSNumber
}
set {
convertCaseFromOptionalInt = newValue?.intValue
}
}
}
//MARK: - Peer Macro
class TestModel: NSObject, Codable {
@ObjCConvertMacro
var convertCaseFromOptionalInt: Int?
// Expand macro
@objc
var convertCaseFromOptionalIntObjc: NSNumber? {
get {
convertCaseFromOptionalInt as? NSNumber
}
set {
convertCaseFromOptionalInt = newValue?.intValue
}
}
}
I want to use Swift code in objc by bridging it with a peer macro..