1

I am trying to implement audio visualizer to AVAudioPlayer from many days, tried different libraries but not succeeded. Now I found a library displayers but the problem is it's in Objective-C, now I don't know how to use it in the swift code. Here is the link of library https://github.com/agilie/DisPlayers-Audio-Visualizers. Please guide me in this regard or suggest me a good visualizer in Swift.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Faisal Nadeem
  • 196
  • 1
  • 7

1 Answers1

2

In order to use objective-c libraries or classes in a swift project you must use the bridging headers.

There's the apple documentation of importing this kind of project into a swift project:

https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_objective-c_into_swift

If you're still stuck you should follow this tutorial:

https://medium.com/ios-os-x-development/swift-and-objective-c-interoperability-2add8e6d6887

ivangice
  • 21
  • 3