我目前正在一个主要是Objective-C的项目中编写一些Swift代码.在我们的ObjC代码中,我们有一个声明的标头typedef GPUImageOutput<GPUImageInput> MyFilter;
.然后我们可以声明一个只能是GPUImageOutput
实现的子类的@property GPUImageInput
.
(注:GPUImageOutput
和GPUImageInput
是不是我定义的;它们是部分GPUImage库)
我们的Swift代码似乎没有认识到这一点,即使标题在我们的桥接标题中是#imported.我试图在Swift中复制声明,但这些都不是正确的语法:
typealias MyFilter = GPUImageOutput, GPUImageInput
typealias MyFilter = GPUImageOutput : GPUImageInput