Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 1.09 KB

README.md

File metadata and controls

21 lines (14 loc) · 1.09 KB

iOS: How to copy epub files from your app to iBooks app

alt tag

Apple provides this possibility via class UIDocumentInteractionController. It’s really simple to do. I’ll just keep here.

Example:

var controller = UIDocumentInteractionController()

let epubURL = NSBundle.mainBundle().URLForResource("test", withExtension: "epub")
controller.URL = epubURL
if !controller.presentOpenInMenuFromRect(button.bounds, inView: view, animated: true) {
  print("You don't have an app installed that can handle ePub files.")
}

alt tag

A class UIDocumentInteractionController has other features, you can read more details in Apple documentation.