BouncyBall
This is BouncyBall, from Develop in Swift Explorations Unit 3, completed into Part 3, where the onTapped function gets a little squirrelly. Use this version when you add a function to be called when the funnel is tapped and taps aren't registered in the simulator.
If you're following along in the book and you tap on the funnel but your dropBall
function isn't being called, try using this repository.
Or, if you're feeling brave, go to line 265 of Shape.swift, and change the withTimeInterval:
parameter value from 0.1
to 0.2
.
This might feel like magic, but sometimes in the simulator the operation takes too long and the tap is cancelled before our code hears about it.