I'm getting a build error when attempting to use the function vImage_CGImageFormat(cgImage: CGImage), which the documentation indicates is only available >= ios 13.0. I also get errors if I try to use any other vImage function that is only available >- ios 13.0.
I set the "iOS Deployment Target" to "iOS 13.0", but the error persists. I also tried cleaning and rebuilding.
This is the exact error:
Interestingly, the XCode doesn't detect the error until building.
My environment:
XCode 12.5
MacOS 10.15.17
Swift 5
If I create a new project with these same settings the build works fine, so there must be something else in my main project that is causing the iOS 13+ methods to be excluded. Is there another target setting that needs to be changed? Could it be related to other pods I have in the project? I'd appreciate any help. Thanks!
I set the "iOS Deployment Target" to "iOS 13.0", but the error persists. I also tried cleaning and rebuilding.
This is the exact error:
This is demo code that's causing the build error:Undefined symbol: (extension in Accelerate):C.vImageCGImageFormat.init(cgImage: C.CGImageRef) -> C.vImageCGImageFormat?
Code Block language import Foundation import Accelerate.vImage import CoreGraphics class ImageProcessor : NSObject { @objc func resizeImg(img: UIImage) -> UIImage? { guard var format = vImage_CGImageFormat(cgImage: img.cgImage!) else { print("Unable to create format.") return nil } return img } }
Interestingly, the XCode doesn't detect the error until building.
My environment:
XCode 12.5
MacOS 10.15.17
Swift 5
If I create a new project with these same settings the build works fine, so there must be something else in my main project that is causing the iOS 13+ methods to be excluded. Is there another target setting that needs to be changed? Could it be related to other pods I have in the project? I'd appreciate any help. Thanks!