Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Copy log #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion Framework/Dotzu/Dotzu/ManagerListLogViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ManagerListLogViewController: UIViewController {
}
}

private let dataSourceLogs = ListLogDataSource<Log>()
fileprivate let dataSourceLogs = ListLogDataSource<Log>()
fileprivate let dataSourceNetwork = ListLogDataSource<LogRequest>()

private var firstLaunch = true
Expand Down Expand Up @@ -250,3 +250,19 @@ extension ManagerListLogViewController: MFMailComposeViewControllerDelegate {
controller.dismiss(animated: true, completion: nil)
}
}

extension ManagerListLogViewController {
func tableView(_ tableView: UITableView, shouldShowMenuForRowAt indexPath: IndexPath) -> Bool {
return state == .logs
}

func tableView(_ tableView: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) -> Bool {
return action == #selector(copy(_:))
}

func tableView(_ tableView: UITableView, performAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) {
guard let log = dataSourceLogs[indexPath.row] else {return}
let format = LoggerFormat.format(log: log)
UIPasteboard.general.string = format.attr.string
}
}