I want to open specific file in iBooks App. I'm using UIDocumentsIntractionController to send this file to iBooks App. My code:
class ViewController : UIViewController {
...
...
@IBOutlet var iBooksBtn: UIButton!
@IBAction func book(sender: AnyObject) {
let ibookPath = NSBundle.mainBundle().pathForResource("test1",ofType: "ibooks")!
interactionController = UIDocumentInteractionController(URL: NSURL(fileURLWithPath:ibookPath))
interactionController.UTI = "com.apple.ibooks"
interactionController.presentOpenInMenuFromRect(CGRectZero,inView:self.iBooksBtn, animated:false)
}
...
...
}
So, for now i store this file in mainBundle, but in future i want to download it from the Internet. So when i press button, i got few results to choose:
But i want to open this file ONLY with iBooks and without requests to choose App (as on picture). As far as i know i need to use UTI for *.ibooks file, i guess UTI, that i used is wrong. Thanks for any help. Also custom URL scheme (ibooks:// and etc.) is not working for me.