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

Commit

Permalink
Remove superfluous optional wrapping from metadata getters (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
revolter authored and hebertialmeida committed Jan 19, 2018
1 parent 6250c35 commit 97516b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit 97516b2

Please sign in to comment.