Swift.如何使用不同的基类进行调试?

mklgxw1f  于 2022-11-28  发布在  Swift
关注(0)|答案(1)|浏览(123)

我正在尝试这样做。但是它产生了编译错误:

#if DEBUG
class BaseRule<T> : NSObject, RuleProtocol
#else
class BaseRule<T> : RuleProtocol
#endif
omhiaaxx

omhiaaxx1#

我找到了解决办法:

#if DEBUG
typealias RuleBase = NSObject
#else
typealias RuleBase = AnyObject
#endif

class BaseRule<T> : RuleBase, RuleProtocol {

相关问题