fulldecent/FDWaveformView

How to create FDWaveformView dynamically in swift 4

msjt13 opened this issue · 2 comments

I want to show wave of multiple audios in scrollview using swift4 and xcode 9. I am using cocoapos library FDWaveFormView for showing wave of audio file. For this I have to create fdwaveformview dynamically. Fdwaveformview works fine if I create this in story board. But it shows an error when create dynamically in swift class.

`
Code:

 for index in selectedAudios {
    audioQueue.append(AVPlayerItem(url: index as! URL))
    print("aduio url: \(index)")

    let waveForm = FDWaveformView(frame: CGRect(x: 0, y: 0, width: 300, height: 150)) // error
    audio_scroll_view.addSubview(waveForm!)
}`

Error: 'FDWaveformView' initializer is inaccessible due to 'internal' protection level

solved:
`let frame = CGRect(x: 0, y: 0, width: 200, height: 200)

let waveform = FDWaveformView()
waveform.frame = frame`

closing is solution is shown