Last active
August 16, 2019 15:29
-
-
Save stonezhl/206c5e274e589d968d5caeacd8de4cdd to your computer and use it in GitHub Desktop.
EPUBBook Class - 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| class EPUBBook { | |
| let container: ContainerDocument | |
| init?(contentsOf baseURL: URL) { | |
| // Find the location of container.xml | |
| let containerURL = baseURL.appendingPathComponent("META-INF/container.xml") | |
| // Parse the container file | |
| guard let container = ContainerDocument(url: containerURL) else { return nil } | |
| self.container = container | |
| // Get the location of the OPF file | |
| let opfURL = baseURL.appendingPathComponent(container.opfPath) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment