Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
Add pageDidLoad() method to the reader center delegate (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
tschob authored and hebertialmeida committed Sep 22, 2016
1 parent 5e9f549 commit 4ac4cfa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Source/FolioReaderCenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ var isScrolling = false
/// Protocol which is used from `FolioReaderCenter`s.
@objc public protocol FolioReaderCenterDelegate: class {

/**
Notifies that page did load. A page load doesn't mean that this page is displayed right away, use `pageDidAppear` to get informed about the appearance of a page.

- parameter page: The loaded page
*/
optional func pageDidLoad(page: FolioReaderPage)

/**
Notifies that a page appeared. This is triggered is a page is chosen and displayed.

Expand Down Expand Up @@ -1119,6 +1126,9 @@ extension FolioReaderCenter: FolioReaderPageDelegate {
let offsetPoint = self.currentWebViewScrollPositions[page.pageNumber - 1] {
page.webView.scrollView.setContentOffset(offsetPoint, animated: false)
}

// Pass the event to the reader center delegate
delegate?.pageDidLoad?(page)
}
}

Expand Down

0 comments on commit 4ac4cfa

Please sign in to comment.