forked from LoopKit/Loop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNSUserActivity.swift
More file actions
33 lines (27 loc) · 1.08 KB
/
Copy pathNSUserActivity.swift
File metadata and controls
33 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// NSUserActivity.swift
// Loop
//
// Copyright © 2018 LoopKit Authors. All rights reserved.
//
import Foundation
extension NSUserActivity {
/// Activity of viewing the current status of the Loop
static let viewLoopStatusActivityType = "ViewLoopStatus"
class func forViewLoopStatus() -> NSUserActivity {
return NSUserActivity(activityType: viewLoopStatusActivityType)
}
static let didAddCarbEntryOnWatchActivityType = "com.loopkit.Loop.AddCarbEntryOnWatch"
class func forDidAddCarbEntryOnWatch() -> NSUserActivity {
let activity = NSUserActivity(activityType: didAddCarbEntryOnWatchActivityType)
activity.isEligibleForSearch = true
activity.isEligibleForHandoff = false
activity.isEligibleForPublicIndexing = false
if #available(watchOSApplicationExtension 5.0, *) {
activity.isEligibleForPrediction = true
}
activity.requiredUserInfoKeys = []
activity.title = NSLocalizedString("Add Carb Entry", comment: "Title of the user activity for adding carbs")
return activity
}
}