For the newly supported LPLinkView in the LinkPresentation framework, is there any way to change the default action (i.e., open the url in Safari) after clicking on it? I've read through the doc and found nothing.
My implementation:
guard let url = URL(string: URL_STRING) else { return }
let provider = LPMetadataProvider()
let linkView = LPLinkView(url: url)
provider.startFetchingMetadata(for: url) { (metadata, err) in
guard let metadata = metadata, err == nil else { return }
DispathQueue.main.async {
linkView.metadata = metadata
}
}
myStackView.insertArrangedSubview(linkView, at: 0)