in iOS

如何判断一个 Class 是否是另一个 Class 的子类?

原创文章,采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。
转载请注明:转载自 Tony's blog,原文网址:https://itony.me/898.html
  • urmyfaith

    – isMemberOfClass:

    Required

    Returns a Boolean value that indicates whether the receiver is an instance of a given class.

    Declaration

    SWIFT

    func isMemberOfClass(_ aClass: AnyClass) -> Bool

    OBJECTIVE-C

    – (BOOL)isMemberOfClass:(Class)aClass

    Parameters

    aClass

    A class object representing the Objective-C class to be tested.