Jim T
Jim T

Reputation: 2530

Accessing vDSP from swift in simulator for older devices

I am trying to call functions in the vDSP framework from Swift code targeting ios 8.1 using xcode 6.1. The following is an example:

public func create_fft_setup( length: Int ) -> FFTSetup {
let log2N = vDSP_Length(log2(CDouble(length)+1.0))
return vDSP_create_fftsetup(vDSP_Length(log2N), FFTRadix(kFFTRadix2))

}

This code complies and runs on the simulator for iphone 5s, 6, and 6+ and ipad air. All older devices fail with a Swift Compiler error 'use of unresolved identifier' for the vDSP function name. The typedefs from the same header file as the function names are ok. Explicitly importing the Accelerate framework header in the bridging header file makes no difference.

I am able to compile and run the code ok on two older devices that I have, ipod and retina ipad.

If I call the vDSP functions from an objective-C file, there is no complaint.

If I call a function from swift to a function in objc and call vDSP from that function, it works.

So my question is, am I doing something wrong, and if not, is there an easy way to make this work properly? It is handy to be able to use the simulator for the 4s screen size.

Upvotes: 3

Views: 417

Answers (1)

Jim T
Jim T

Reputation: 2530

Apple finally fixed this problem in xcode 7 beta 4 or 5 (7 months later)

Upvotes: 0

Related Questions