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

Commit

Permalink
Remove unnecessary let-binding, use where clause
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Kobilansky committed Jan 26, 2016
1 parent 091f1a9 commit 4439fea
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions Source/FolioReaderSharingProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,28 @@
import UIKit

class FolioReaderSharingProvider: UIActivityItemProvider {
var subject: String!
var text: String!

var subject: String
var text: String
var html: String?

init(subject: String, text: String, html: String?) {
self.subject = subject
self.text = text
if let ht = html {
self.html = ht
}
self.html = html

super.init(placeholderItem: "")
}

override func activityViewController(activityViewController: UIActivityViewController, subjectForActivityType activityType: String?) -> String {
return subject
}

override func activityViewController(activityViewController: UIActivityViewController, itemForActivityType activityType: String) -> AnyObject? {

if activityType == UIActivityTypeMail {
if let html = html {
return html
} else {
return text
}
if let html = html where activityType == UIActivityTypeMail {
return html
}

return text
}
}

0 comments on commit 4439fea

Please sign in to comment.