【问题标题】:How to get the position of my current PDFPage?如何获取我当前 PDFPage 的位置?
【发布时间】:2019-08-04 19:14:40
【问题描述】:

我正在使用 PDFKit 并将 PDFView 添加到我的 ViewControllers 视图中。我想知道我的主视图中当前 PDFPages 的位置在哪里。通常我会使用 UIView 给出的 convert() 函数,但 PDFPage 不是 UIView。有什么想法吗?

【问题讨论】:

    标签: swift pdfkit


    【解决方案1】:

    在我的例子中,我放了一个 NotificationCenter 来查看每次 pdfView 被这个刷卡时

    NotificationCenter.default.addObserver(self, selector: #selector(viewDidSwipe), name: Notification.Name.PDFViewPageChanged, object: nil)
    

    然后,在 viewDidSwipe 函数中,

       @objc func viewDidSwipe(){
            let currentSlideCount = pdfView.currentPage?.label
            self.title = currentSlideCount!
       }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-06
      • 1970-01-01
      • 1970-01-01
      • 2017-04-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多