MapCopyrights
final public class MapCopyrightsProvides methods to fetch copyrights and caption.
Important
This is a Public Preview API. It may be changed or removed at any time.- 
                  
                  Creates a MapCopyrightsinstance.DeclarationSwift public convenience init()
- 
                  fetchCopyrights()AsynchronousFetches copyright details. For users who are utilizing iOS 15+ and leveraging SwiftUI to ensure accurate rendering of hyperlinks that are interactive (tappable) and capable of opening in the web browser, the following method can be employed: func parseContent(_ content: String) -> AttributedString { do { let detector = try NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue) let matches = detector.matches(in: content, options: [], range: NSRange(location: 0, length: content.utf16.count)) let modifiedContent = NSMutableAttributedString(string: content) for match in matches.reversed() { guard let range = Range(match.range, in: content) else { continue } let url = content[range] let markdownLink = "[\(url)](\(url))" let markdownAttributedString = try AttributedString(markdown: markdownLink) modifiedContent.replaceCharacters(in: match.range, with: NSAttributedString(markdownAttributedString)) } return AttributedString(modifiedContent) } catch { return AttributedString("Something went wrong during the Copyright parsing.") } }Example of usage of this method: Text(parseContent(text))Throws An error occurred during the retrieval process.Important This is a Public Preview API. It may be changed or removed at any time.DeclarationSwift public func fetchCopyrights() async throws -> StringReturn ValueString copyright details in HTML format. 
- 
                  
                  Fetches copyright details. For users who are utilizing iOS 15+ and leveraging SwiftUI to ensure accurate rendering of hyperlinks that are interactive (tappable) and capable of opening in the web browser, the following method can be employed: func parseContent(_ content: String) -> AttributedString { do { let detector = try NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue) let matches = detector.matches(in: content, options: [], range: NSRange(location: 0, length: content.utf16.count)) let modifiedContent = NSMutableAttributedString(string: content) for match in matches.reversed() { guard let range = Range(match.range, in: content) else { continue } let url = content[range] let markdownLink = "[\(url)](\(url))" let markdownAttributedString = try AttributedString(markdown: markdownLink) modifiedContent.replaceCharacters(in: match.range, with: NSAttributedString(markdownAttributedString)) } return AttributedString(modifiedContent) } catch { return AttributedString("Something went wrong during the Copyright parsing.") } }Example of usage of this method: Text(parseContent(text))Important This is a Public Preview API. It may be changed or removed at any time.DeclarationSwift @discardableResult public func fetchCopyrights(completion: @escaping (Result<String, Error>) -> ()) -> CancellableParameterscompletionCompletion handler that is called to receive the copyrights. If no errors occurred, string contain caption. Return ValueA Cancellablefor the network request operation.
- 
                  fetchCaption()AsynchronousFetches copyrights caption. Throws An error occurred during the retrieval process.Important This is a Public Preview API. It may be changed or removed at any time.DeclarationSwift public func fetchCaption() async throws -> StringReturn ValueString copyrights caption in HTML format. 
- 
                  
                  Fetches copyrights caption. Important This is a Public Preview API. It may be changed or removed at any time.DeclarationSwift @discardableResult public func fetchCaption(completion: @escaping (Result<String, Error>) -> ()) -> CancellableParameterscompletionCompletion handler that is called to receive the copyrights. If no errors occurred, string contain caption. Return ValueA Cancellablefor the network request operation.
 
         TomTom SDK for iOS (0.53.1)
 
          TomTom SDK for iOS (0.53.1)
         MapCopyrights
          MapCopyrights