AREPubReader is a light-weight and easy to use .epub
viewer.
So now you can view .epub
documents that simply uses UIWebView
.
- iOS 8 or later.
AREPubReaderViewController
is a UIViewController
.
- Click and drag the folder into your Xcode project.
- Add
import "AREPubReaderViewController.h"
to your header file. - Create a new
UIViewController
in your Storyboard. - Add a
Storyboard ID
to the ViewController. - Assign the newly created
UIViewController
class toAREPubReaderViewController
. - Click onto the 'Commections' tab and you have the available
IBOutlets
andIBActions
.
- Start designing your Reader:
Connection | Type | Description |
---|---|---|
webview | UIWebView |
Displays the epub file. |
pageNumberLbl | UILabel |
Label for [currentPage of totalPages ]. |
nextPage | IBAction |
Navigates to next page in the ePub. |
previousPage | IBAction |
Navigates to previous page in the ePub. |
** Ensure you have assigned the ViewController to a Storyboard ID
!**
Assign the epubFileName
property with the file name of the .epub (in your project) you want the reader to load up.
AREPubReaderViewController *readerViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"reader"];
readerViewController.epubFileName=@"my-first-book";
[self.navigationController pushViewController:readerViewController animated:YES];
and... you're done!
- Be able to open an .epub via URL.
- ZipArchive - https://github.com/mattconnolly/ZipArchive (included)