Open ozgurshn opened 3 years ago
I tried to downgrade to 4.11.1 as I read this issue https://github.com/AudioKit/Playgrounds/pull/15 but still the same error exists .
I also cannot get the playgrounds to work, and am having trouble finding where the akslider version they are referencing exists.
I was able to work around this by specifying the color: parameter.
This is a line from the playground that was breaking.
addView(AKSlider(property: "Drums Volume", value: drums.volume) { sliderValue in
drums.volume = sliderValue
})
This is the same line fixed by adding a color: parameter.
addView(AKSlider(property: "Drums Volume", value: drums.volume, color: .red) { sliderValue in
drums.volume = sliderValue
})
I needed to do this for every AKSlider being created.
@scottpuhl -- confirming that fix! All the params for the AKSlider init have default values, and, as your example demonstrates, they don't all need to be set on instantiation.
public init(property: String,
value: Double = 0.0,
range: ClosedRange<Double> = 0 ... 1,
taper: Double = 1, format: String = "%0.3f",
color: AudioKitUI.AKColor = AKStylist.sharedInstance.nextColor,
frame: CGRect = CGRect(width: 440, height: 60),
callback: @escaping (Double) -> Void = { _ in })
Maybe it has something to do with the color param being set with a getter on the AKStylist singleton interface? I experimented with assigning AKStylist.sharedInstance.nextColor to an AKSlider instantiation in a playground and it worked fine.
frequencySlider = AKSlider(property: "Frequency",
alue: oscillator.baseFrequency,
range: 0 ... 800,
format: "%0.2f Hz",
color: AKStylist.sharedInstance.nextColor
) { frequency in
oscillator.baseFrequency = frequency
}
still not resolved on version 4.11.2
AkSliders in Playgrounds give this error. Which init method shoud I use? Fatal error: Use of unimplemented initializer 'init(property:value:range:taper:format:frame:callback:)' for class 'AudioKitUI.AKSlider'
For example, this init is called in Playground.
Xcode and Pod versions: Xcode 12.2