Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Remove superfluous optional wrapping from metadata getters #304

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class ViewController: UIViewController {
}

do {
if let image = try FolioReader.getCoverImage(bookPath) {
button?.setBackgroundImage(image, for: .normal)
}
let image = try FolioReader.getCoverImage(bookPath)

button?.setBackgroundImage(image, for: .normal)
} catch {
print(error.localizedDescription)
}
Expand Down
6 changes: 3 additions & 3 deletions Source/FolioReaderKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,15 @@ extension FolioReader {
/**
Read Cover Image and Return an `UIImage`
*/
open class func getCoverImage(_ epubPath: String, unzipPath: String? = nil) throws -> UIImage? {
open class func getCoverImage(_ epubPath: String, unzipPath: String? = nil) throws -> UIImage {
return try FREpubParser().parseCoverImage(epubPath, unzipPath: unzipPath)
}

open class func getTitle(_ epubPath: String, unzipPath: String? = nil) throws -> String? {
open class func getTitle(_ epubPath: String, unzipPath: String? = nil) throws -> String {
return try FREpubParser().parseTitle(epubPath, unzipPath: unzipPath)
}

open class func getAuthorName(_ epubPath: String, unzipPath: String? = nil) throws-> String? {
open class func getAuthorName(_ epubPath: String, unzipPath: String? = nil) throws-> String {
return try FREpubParser().parseAuthorName(epubPath, unzipPath: unzipPath)
}
}
Expand Down