I have a situation. I would appreciated if anyone has a solution for this
- I have an objC
enum
sayAbc
- I declare this in a swift class, say,
MySwiftClass.swift
asvar abc : Abc!
- I have created an instance of MySwiftClass (
mySwiftClass
) in another ObjC class (myObjC.m file) - In myObjC.m, I’m trying to access enum Abc as
mySwiftClass.abc
.
This is throwing an error - “Property ‘abc’ not found on object of type MySwiftClass *”. Basically the enum is not added as property in the “ProjectName-Swift.h” file.
What I believe is happening is that when I’m declaring the ObjC enum in Swift class, it is getting converted to a swift enum and hence I’m not able to access it in ObjC file.
Note: Marking the Swift class as @objc did not work.