in our swift code somewhere there is a class with a method with this signature:
static var getCertificates : [SecCertificate] { ... }
in the generated app-swift.h this results in:
@interface TrustedCertificates : NSObject
+ (NSArray<SecCertificateRef> * __nonnull)getCertificates;
@end
and this gives the compile error:
Type argument 'SecCertificateRef' (aka 'struct __SecCertificate *') is neither an Objective-C object nor a block type
I've tried adding #import before where the .h file is included, but it doesn't solve the error. I've also tried adding the import to the pch.h file but this also doesn't help.
Since the swift file is generated I can not start editing it there since it will be overwritten anyway.
Any idea what is missing to get it to compile?
SecCertificateRef
is not an Objective-C type. Just like you can't have aNSArray<CFStringRef>
(even though you can have aNSArray<NSString>
), you can't have aNSArray<SecCertificateRef>
. This is why I'm saying that it's a bug: the automatically generated code is incorrect. – Oriflamme