Hi,
I have an array of views. I want to show each view briefly on the canvas when the user taps the play button. I tried to iterate through my array and add the view and and then remove it just as soon as the next view is ready to be added. Here is my button's tap gesture code:
playButton.addTapGestureRecognizer { (location, state) -> () in
print("Play")
self.canvas.remove(self.canvasView)
for frame in self.frames {
self.canvas.add(frame)
delay(1) {
self.canvas.remove(frame)
}
}
}
What ends up happening is the whole loop happens at once so we add all the views and remove them all and end up with a blank canvas. Am I approaching this wrong? How can I accomplish what I outlined in the beginning?