2022-01-15 19:09:30 +00:00
|
|
|
//
|
|
|
|
// UserActivities.swift
|
|
|
|
// Reader
|
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 1/15/22.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
extension NSUserActivity {
|
|
|
|
|
2022-01-16 16:58:28 +00:00
|
|
|
static let preferencesType = "net.shadowfacts.Reader.activity.preferences"
|
2022-01-15 19:09:30 +00:00
|
|
|
static let addAccountType = "net.shadowfacts.Reader.activity.add-account"
|
|
|
|
static let activateAccountType = "net.shadowfacts.Reader.activity.activate-account"
|
|
|
|
|
2022-01-16 16:58:28 +00:00
|
|
|
static func preferences() -> NSUserActivity {
|
|
|
|
return NSUserActivity(activityType: preferencesType)
|
|
|
|
}
|
|
|
|
|
2022-01-15 19:09:30 +00:00
|
|
|
static func addAccount() -> NSUserActivity {
|
|
|
|
return NSUserActivity(activityType: addAccountType)
|
|
|
|
}
|
|
|
|
|
|
|
|
static func activateAccount(_ account: LocalData.Account) -> NSUserActivity {
|
|
|
|
let activity = NSUserActivity(activityType: activateAccountType)
|
|
|
|
activity.userInfo = [
|
|
|
|
"accountID": account.id.uuidString
|
|
|
|
]
|
|
|
|
return activity
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|