How do you override layerClass in swift

后端 未结 4 1785
醉话见心
醉话见心 2021-02-04 23:45

In Objective-C we use to do it like this

+ (Class)layerClass
{
    return [CAEAGLLayer class];
}

Obviously this won\'t work:

CA         


        
4条回答
  •  春和景丽
    2021-02-05 00:13

    Swift does introspection much differently than Objective-C. You may want to take a look at the docs about Metatypes.

    For your case I'd try: CAEAGLLayer.self

提交回复
热议问题