As Gregory says, Apple’s "Using Swift with Cocoa and Objective-C” is your go-to reference here. In a nutshell, you have 2 challenges: (1) accessing your Objective-C code from Swift and (2) translating calls to that code to Swift syntax.
For (1) you just need to set up an Objective-C bridging header in your Swift project, and then import your Obj-C headers there. Note when you import Obj-C files into a Swift project Xcode will offer to create the bridging-header for you - which simplifies things considerably.
For (2) you might also want to have a look at the EZAudio project on Github. That framework is written on top of Core Audio and most of the sample projects are in Objective-C, but the author recently added a sample Swift project to aid in exactly the sort of integration you’re looking to do (basically: making Swift calls to a C-based API). Translating something like a passed **float parameter into Swift is not necessarily immediately obvious, so you might find his example helpful.
Best, Abel MOJO LAMAiOS Development, Audio Tools & Sound Vibrations www.mojolama.com
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|