Currently I am using the GoogleMaps SDK for iOS for various operations. When calling
[self.googleMapsView animateToCameraPosition:[GMSCameraPosition
I came across the issue of google's animation methods lacking completion handlers recently.
The best solution I've found so far is to attach my own completion handler via CATransation API.
private func attachCompletionHandlerToGoogleAnimations(@noescape animations: () -> Void, #completion: (() -> Void)!) {
CATransaction.begin()
CATransaction.setCompletionBlock(completion)
animations()
CATransaction.commit()
}
Example usage:
attachCompletionHandlerToGoogleAnimations({
googleMapView.animateToLocation(coordinate)
}) {
println("camera moved to location \(coordinate)")
}