Files
Pulse/Sources/PulseUI/Features/Inspector/NetworkInspectorViewModel.swift

21 lines
441 B
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// The MIT License (MIT)
//
// Copyright (c) 2020–2023 Alexander Grebenyuk (github.com/kean).
import SwiftUI
import CoreData
import Pulse
import Combine
struct NetworkInspectorViewModel {
let task: NetworkTaskEntity
var title: String {
task.url.flatMap(URL.init(string:))?.lastPathComponent ?? "Request"
}
func shareTaskAsHTML() -> URL? {
ShareService.share(task, as: .html).items.first as? URL
}
}