Skip to content

Commit

Permalink
handoff調整
Browse files Browse the repository at this point in the history
  • Loading branch information
anzfactory committed May 6, 2015
1 parent 023c1b4 commit 4e78c82
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions QiitaCollection/EntryDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import UIKit

class EntryDetailViewController: BaseViewController {
class EntryDetailViewController: BaseViewController, NSUserActivityDelegate {

typealias ParseItem = (label: String, value: String)

Expand Down Expand Up @@ -236,12 +236,12 @@ class EntryDetailViewController: BaseViewController {

} else {
self.senderActivity = NSUserActivity(activityType: QCKeys.UserActivity.TypeSendURLToMac.rawValue)
self.senderActivity?.delegate = self
self.senderActivity!.title = "QiitaCollection"
self.senderActivity!.becomeCurrent();
}
self.senderActivity!.webpageURL = NSURL(string: entry.urlString)

Toast.show("閲覧中の投稿をHandoff対応デバイスとシンクロしました", style: JFMinimalNotificationStytle.StyleSuccess)
} else {
Toast.show("投稿データがないようです...", style: JFMinimalNotificationStytle.StyleWarning)
}
Expand Down Expand Up @@ -563,4 +563,10 @@ class EntryDetailViewController: BaseViewController {
}
}

func userActivityWillSave(userActivity: NSUserActivity) {
dispatch_async(dispatch_get_main_queue(), {() -> Void in
Toast.show("閲覧中の投稿をHandoff対応デバイスとシンクロしました", style: JFMinimalNotificationStytle.StyleSuccess)
})
}

}

0 comments on commit 4e78c82

Please sign in to comment.