Add comments about the un-sanitized URL.

This commit is contained in:
Doug 2021-08-24 09:42:55 +01:00
parent 29758d1aa7
commit 5f598a918c
2 changed files with 5 additions and 2 deletions

View file

@ -18,7 +18,8 @@ import Foundation
@objc
class URLPreviewViewData: NSObject {
/// The URL that's represented by the preview data.
/// The URL that's represented by the preview data. This may have been sanitized.
/// Note: The original URL, is stored in ``URLPreviewViewModel``.
let url: URL
/// The OpenGraph site name for the URL.

View file

@ -23,7 +23,8 @@ class URLPreviewViewModel: NSObject, URLPreviewViewModelType {
// MARK: - Properties
// MARK: Private
/// The original (un-sanitized) URL to be previewed.
private let url: URL
private let session: MXSession
@ -76,6 +77,7 @@ class URLPreviewViewModel: NSObject, URLPreviewViewModelType {
}
private func openURL() {
// Open the original (un-sanitized) URL stored in the view model.
UIApplication.shared.open(url)
}