Reputation: 2670
I am trying to develop an app for iOS in SWIFT ,which has a requirement to render Arabic PDF files and allow the user to read the PDF by swiping from left to right.I have tried a lot of libraries ,but didn't find a perfect way to do this.Can any please help me on this with any libraries or ideas. Thanks in advance
Upvotes: 1
Views: 1149
Reputation: 49720
Hi i just create a Swift project using https://github.com/vfr/Reader and you need to do following steps to convert this objective library in to swift:
#ifndef Bridge_Header_h
#define Bridge_Header_h
#import "ReaderViewController.h"
#endif /* Bridge_Header_h */
class ViewController: UIViewController , ReaderViewControllerDelegate {
And it's View Controller ViewDidLoad code:
override func viewDidLoad() {
super.viewDidLoad()
let filepath = (NSBundle.mainBundle().pathForResource("Reader", ofType:"pdf"))! as String
if let document = ReaderDocument.withDocumentFilePath(filepath, password: "")
{
let readerViewController: ReaderViewController = ReaderViewController(readerDocument: document)
readerViewController.delegate = self
// Set the ReaderViewController delegate to self
self.navigationController!.pushViewController(readerViewController, animated: true)
}
}
Sample Code: https://github.com/nitingohel/NGSwiftPdfReader
RealTime Output:
Upvotes: 1