• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A Design question, using swift and objective-c
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Design question, using swift and objective-c


  • Subject: Re: A Design question, using swift and objective-c
  • From: Abel Domingues <email@hidden>
  • Date: Tue, 15 Sep 2015 16:14:14 -0400

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 LAMA
iOS 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
  • Prev by Date: Re: A Design question, using swift and objective-c
  • Next by Date: Multichannel AudioUnits
  • Previous by thread: Re: A Design question, using swift and objective-c
  • Next by thread: Multichannel AudioUnits
  • Index(es):
    • Date
    • Thread