I want to present a rich link in my app and also send those data to my server. I need to access the image inside the view of LPLinkView.
how can I access the parameters inside it? (like: image, description, title, icon, and ext...)
I want to present a rich link in my app and also send those data to my server. I need to access the image inside the view of LPLinkView.
how can I access the parameters inside it? (like: image, description, title, icon, and ext...)
Copyright © 2021 Jogjafile Inc.

Unfortunately, you can't access any internal properties of an
LPLinkView, but you can easily create your own view. TheLPLinkMetadataobject has everything you need, you just need to know how to extract the images from itsiconProviderandimageProvider, which are subclasses ofNSItemProvider.UIKit (iOS)
You can use
NSItemProvdier'sloadObject(ofClass:)method to easily get aUIImage. This works becauseUIImageconforms to theNSItemProviderReadingprotocol.SwiftUI
SwiftUI's
Imageis astruct, so it cannot conform toNSItemProviderReading. It's easiest to use the UIKit code above to obtain aUIImageand instantiate a SwiftUIImagefrom that.AppKit (macOS)
Unlike its
UIImagesister,NSImagedoes not conform toNSItemProviderReading, which means you'll have to useNSItemProvdier's olderloadItem(forTypeIdentifier:options:)method.You'll need to specify the
typeIdentifierand initialize theNSImagefromDatayourself, but otherwise it's pretty much the same.