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
Browse files Browse the repository at this point in the history
  • Loading branch information
revolter committed Jan 18, 2018
1 parent 59a1350 commit 0b8bf9e
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) throws -> String? {
open class func getTitle(_ epubPath: String) throws -> String {
return try FREpubParser().parseTitle(epubPath)
}

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

0 comments on commit 0b8bf9e

Please sign in to comment.