没有名为 AKNode/AKToggleable 的类型或协议

Ali*_*ğlu 5 ios swift audiokit

我正在尝试扩展 AKNode 和 AKToggelable,此错误出现在 Project-Swift.h 文件中

有什么方法可以做到这一点?

我的班级是

class AKCustom: AKNode, AKToggleable, AKComponent, AKInput {
public typealias AKAudioUnitType = AKBalancerDeplikeAudioUnit

public static let ComponentDescription = AudioComponentDescription(mixer: "dpba")

private var internalAU: AKAudioUnitType?


open dynamic var isStarted: Bool {
    return internalAU?.isPlaying() ?? false
}

public init( _ input: AKNode? = nil) {
    _Self.register()
    super.init()
    AVAudioUnit._instantiate(with: _Self.ComponentDescription) { [weak self] avAudioUnit in

        self?.avAudioNode = avAudioUnit
        self?.internalAU = avAudioUnit.auAudioUnit as? AKAudioUnitType

        input?.connect(to: self!)
    }
}

open func start() {
    internalAU?.start()
}

open func stop() {
    internalAU?.stop()
}
}
Run Code Online (Sandbox Code Playgroud)

以及 Project-Swift.h 文件中的错误消息:

Cannot find interface declaration for 'AKNode', superclass of 'AKCustom'

No type or protocol named 'AKToggleable'
Run Code Online (Sandbox Code Playgroud)

mav*_*xce 1

添加。#import "AudioKit/AudioKit-Swift.h"PROJECT-Bridging-Header.h然后AKNode可以在 访问Project-Swift.h