KMLeftSideViewController+Search.swift 602 B

123456789101112131415161718192021
  1. //
  2. // KMLeftSideViewController+Search.swift
  3. // PDF Master
  4. //
  5. // Created by tangchao on 2023/12/24.
  6. //
  7. import Foundation
  8. // MARK: - Menu
  9. extension KMLeftSideViewController {
  10. @objc func addAnnotationsForSelections(_ sender: NSMenuItem) {
  11. guard let selections = sender.representedObject as? [CPDFSelection], selections.count > 0 else {
  12. return
  13. }
  14. for selection in selections {
  15. self.listView.addAnnotation(with: CAnnotationType(rawValue: sender.tag) ?? .circle, selection: selection, page: selection.page, bounds: selection.bounds)
  16. }
  17. }
  18. }