I am creating a swift app with AVFoundation and using an AVAudioPlayerNode. I disable the play button while playing and in the completion portion of the player I enable it, but the button stays transparent for over 10 seconds. The button is useable and my print("complete") shows immediately, so it seems like the view is not updating. Here is my code:
player.scheduleBuffer(buffer, completionHandler: {
print("complete")
self.playButton.enabled = true
}
)
I have tried the following with no luck:
self.view.layoutIfNeeded()
player.scheduleBuffer(buffer, completionHandler: {
print("complete")
self.playButton.enabled = true
self.playButton.reloadInputViews()
self.view.layoutIfNeeded()
}
)