How to animate MGLRasterTileSource

I'm using a 3rd party tiles API to show weather radar tiles. It has the format{z}/{x}/{y}.png

let source = MGLRasterTileSource(identifier: "weather", tileURLTemplates: ["{z}/{x}/{y}.png"], options: [ .tileSize: 256 ])
let rasterLayer = MGLRasterStyleLayer(identifier: "weather", source: source)

Now I have a series of dates that I would like to animate by changing the layer every x seconds.

let times = [

My current solution is to add one source with layers corresponding to each time and show only the layer of the current frame

func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) {
    // Add a new raster source and layer.

    for time in times {
        let identifier = "frame_\(time)"
        source = MGLRasterTileSource(identifier: identifier, tileURLTemplates: ["\(time)/{z}/{x}/{y}.png"], options: [ .tileSize: 256 ])
        let rasterLayer = MGLRasterStyleLayer(identifier: identifier, source: source)

        // rasterLayer.isVisible = false
        // workaround
        rasterLayer.rasterOpacity = NSExpression(forConstantValue: 0.01)
    timer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { timer in

func loop() {
    // Get the currently display layer to be hidden
    let previousRasterLayer: MGLRasterStyleLayer = ...
    // Get the next layer to be shown
    let nextRasterLayer: MGLRasterStyleLayer = ...

    previousRasterLayer.isVisible = false
    nextRasterLayer.isVisible = true

    // workaround
    previousRasterLayer.rasterOpacity = NSExpression(forConstantValue: 0.01)
    nextRasterLayer.rasterOpacity = NSExpression(forConstantValue: 1)

While this kind if work, it does not seem to be optimal because the Mapbox SDK starts loading the layer pngs only when it is set visible. This causes the layers to be blurry while loading. A small workaround could be the set the opacity of the raster layer to 0.01 in which case Mapbox starts loading them all at once.

The question is whether there is a better way to achieve this.