BASS
Pure Swift module to access libbass from Swift code as a dynamic framework.
Original library is written in C and available for Apple platforms: iOS, tvOS, macOS. Swift is compatible with C language and provides direct access to C code. Therefore you're able to use libbass in your Swift code out-of-the-box, but not exactly.
There is official instruction how
libbass should be linked and used within your iOS / tvOS
project, so this module does it for
you.
The only thing you need to use libbass in your Swift project from now is connect this
framework as dependency โ currently only Carthage is supported.
To add the dependency, simply add Bass to your Cartfile
:
github "Starling-Inc/Bass" ~> 2.0
If you doesn't know what Carthage is, follow the link.
When you're set up, you can use the module directly:
import Bass
func initialize() {
// this is not a part of original library, just convenient method to use it through dynamic module
BASS_LoadPlugins()
// direct calls of library's API
BASS_Init(-1, 44100, 0, nil, nil)
BASS_SetConfig(DWORD(BASS_CONFIG_IOS_NOCATEGORY), 1)
}
func free() {
BASS_Free()
}
This module does not provide anny additional functionality, so you have to process errors by yourself.