OfflineSearchIndexListener
public protocol OfflineSearchIndexListener : AnyObject
Protocol to get updates about progress of creating persistent map index.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
-
Called each time that the indexing has started. It is triggered by changes to persistent map or by calling
OfflineSearchEngine.setIndexOptions. If a valid index was previously created for the installed regions, no additional indexing is performed, so no notifications are sent. In this context, a valid index is the one that contains data for the exact versions of the installed map regions. When any of them is updated or new regions are downloaded or deleted, the index becomes invalid and is automatically rebuilt, as long as indexing has been enabled previously. Invoked on the main thread.Declaration
Swift
func onStarted(operation: OfflineSearchIndex.Operation)Parameters
operationShows whether the index is being created or removed.
-
Called multiple times to indicate the progress of index creation or deletion. Invoked on the main thread.
Declaration
Swift
func onProgress(percentage: Int32)Parameters
percentageRepresents a percentage of work done.
-
Called after index creation or deletion has been completed. Invoked on the main thread.
Declaration
Swift
func onComplete(error: OfflineSearchIndex.Error?)Parameters
errorRepresents an error in case of a failure. It is
nilfor an operation that succeeds.