Class
NavigatorIndex
A NavigatorIndex contains all the necessary information to display the data inside a navigator. The data ranges from the tree to the necessary pieces of information to filter the content and perform actions in a fast way. A navigator index is created per bundle and needs a bundle identifier to correctly work. Anonymous bundles are allowed, but they limit the functionalities of the index.
class NavigatorIndex
Discussion
A NavigatorIndex is composed by two main components:
The two mentioned components are generated by using a NavigatorIndex.Builder instance, which indexes the content accordingly to the desired configuration. A NavigatorIndex can be stored on disk to be later loaded. Loading an index can be performed in a single operation (synchronous) or asynchronously. This option is extremely useful in case an application needs to load a very large amount of data while updating the UI to let the user navigate the loaded content, while the remaining is loaded in a background thread and presented later in time.
There are few important pieces information a NavigatorIndex requires to properly work:
Building an index with one of the mentioned components is not supported.
Topics
Creating an index
Classes
Structures
Instance Properties
Instance Methods
func availabilities(for: UInt64) -> [AvailabilityIndex.Info]Returns an array of availabilities based on a single id.
func id(for: String, with: InterfaceLanguage) -> UInt32?If available, returns the ID of a path for the given language.
func path(for: UInt32) -> String?If available, returns the path from the numeric ID inside the navigator tree.
func path(for: String, language: InterfaceLanguage, hashed: Bool) -> String?Returns the path of a given USR if existing.
func readNavigatorTree(timeout: TimeInterval, delay: TimeInterval, queue: DispatchQueue, broadcast: NavigatorTree.BroadcastCallback?) throwsRead a tree on disk from a given path. The read is atomically performed, which means it reads all the content of the file from the disk and process the tree from loaded data. The queue is used to load the data for a given timeout period, after that, the queue is used to schedule another read after a given delay. This approach ensures that the used queue doesn’t stall while loading the content from the disk keeping the used queue responsive.
Type Properties
Enumerations