Skip to content

Commit

Permalink
Use UUID().hashValue to generate random Int
Browse files Browse the repository at this point in the history
  • Loading branch information
n8han committed Feb 26, 2021
1 parent 563c307 commit 50d999d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/Classes/OfflinePackDownloadManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class OfflinePackDownloader {
let storage = MGLOfflineStorage.shared
// While the Android SDK generates a region ID in createOfflineRegion, the iOS
// SDK does not have this feature. Therefore, we generate a region ID here.
let id = Int.random(in: 0..<Int.max)
let id = UUID().hashValue
let regionData = OfflineRegion.fromOfflineRegionDefinition(regionDefinition, id: id)
let tilePyramidRegion = regionDefinition.toMGLTilePyramidOfflineRegion()
storage.addPack(for: tilePyramidRegion, withContext: regionData.prepareContext()) { [weak self] (pack, error) in
Expand Down

0 comments on commit 50d999d

Please sign in to comment.