PersonalDataFactory
public enum PersonalDataFactory
A factory to create PersonalData instances with an offline storage and/or online synchronization.
See more information in PersonalData.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Defaults types and constants used for
See morePersonalDataFactoryDeclaration
Swift
public enum Defaults -
Creates a new instace of
PersonalDataimplemented for an offline storage to store updates to a file.An example of creating an offline
PersonalDatainstance:let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) let documentsFolderPath = paths[0] let filePath = documentsFolderPath.appendingPathComponent("personal_data") do { let personalData = try PersonalDataFactory.create(with: filePath.absoluteString) print(personalData) // Use personalData to pass to other engines that require it for personalizations. } catch let error { print(error) }Throws
PersonalDataFactoryError.cannotUseFilepatherror if the file path could not be used for storage.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public static func create(with filePath: String) throws -> PersonalDataParameters
filePathA file path to store provided personalized data. To ensure correcness ensure that the path has a proper access rights for reading/writing.
Return Value
An instance of the
PersonalDatawith offline storage. -
Creates a new instace of
PersonalDataimplemented for an offline file storage. This method relies onTomTomSDKPersonalDataDefault/PersonalDataFactory/defaultFilePathpath to storePersonalDatadata. To configurefilePathuseTomTomSDKPersonalDataDefault/PersonalDataFactory/create(with:).Throws
PersonalDataFactoryError.cannotUseFilepatherror if the default file path could not be used for storage.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public static func create() throws -> PersonalDataReturn Value
An instance of the
PersonalDatawith offline storage.
TomTom SDK for iOS (0.66.0)
PersonalDataFactory