Controlling Animation Duration in Google Maps for iOS

前端 未结 4 1678
广开言路
广开言路 2021-02-02 10:16

The documentation for Google Maps for iOS states that:

Call one of several methods that allow you to animate the camera moving to a new location. You can

4条回答
  •  耶瑟儿~
    2021-02-02 10:16

    for Swift 3.0:

    CATransaction.begin()
    CATransaction.setValue(1.5, forKey: kCATransactionAnimationDuration)
    // your camera code goes here, example:
    // mapView.animate(with: update)
    CATransaction.commit()
    

    The bigger the value (1.5 in this case), the slower the animation.

提交回复
热议问题