an array of self-defined swift object can't be converted to objective-c type -
a newbie swift
i'm doing mixed-language (swift & objective-c) program, , encounter error when trying import swift objective-c
here code
@objc public enum itemtype: int { case left, right } public class myclass { @objc var items: [itemtype] = [] }
here error enter image description here
it seems there's wrong itemtype
see definition of itemtype
in -swift.h
file
could 1 give me hint?
swift , objective-c enums different in nature. old objective-c enum little subset of modern swift enum. compiler doesn't know how use swift's enum objective-c code can't @objc type. myclass can't @objc type while contain swift's enum.
Comments
Post a Comment