我和imglyKit斯威夫特3库一起工作
使用快速示例,我可以使用调用自定义筛选器,共享实例?:PhotoEffect.allEffects = effects。
效果是一个数组,
private let effects: [PhotoEffect] = [
PhotoEffect(identifier: "None", ciFilterName: nil, lutURL: nil, displayName: "None", options: nil),
PhotoEffect(identifier: "K1", lutURL: Bundle(for: PhotoEffect.self).url(forResource: "K1", withExtension: "png"), displayName: "K1"),
PhotoEffect(identifier: "K2", lutURL: Bundle(for: PhotoEffect.self).url(forResource: "K2", withExtension: "png"), displayName: "K2"),
PhotoEffect(identifier: "K6", lutURL: Bundle(for: PhotoEffect.self).url(forResource: "K6", withExtension: "png"), displayName: "K6"),
PhotoEffect(identifier: "Dynamic", lutURL: Bundle(for: PhotoEffect.self).url(forResource: "Dynamic", withExtension: "png"), displayName: "Dynamic"),
PhotoEffect(identifier: "Fridge", lutURL: Bundle(for: PhotoEffect.self).url(forResource: "Fridge", withExtension: "png"), displayName: "Fridge")
]因此,这个具有“共享实例”的配置可以在代码中的任何地方工作。
现在的问题是,为了设置这个属性,如何访问pod "imglykit“的共享实例?
这里有一个对目标C的测试,但只是一个实例,如何链接到已经创建的对象?
IMGLYPhotoEffect *photoEffect = [[IMGLYPhotoEffect alloc]initWithIdentifier:@"None" ciFilterName:nil lutURL:nil displayName:@"None" options:nil];发布于 2017-01-16 06:27:44
allEffects是IMGLYPhotoEffect类上的一个类方法(在Swift中称为PhotoEffect类)。
试试这个:
IMGLYPhotoEffect.allEffects = effects;在Objective中,这里提供了一个正确的方法来调用快速API:如果您在Objective项目中单击IMGLYPhotoEffect符号,它将带您到Objective中生成的类头。
https://stackoverflow.com/questions/41669641
复制相似问题