28 lines
706 B
Swift
28 lines
706 B
Swift
//
|
|
// UserActivities.swift
|
|
// Reader
|
|
//
|
|
// Created by Shadowfacts on 1/15/22.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension NSUserActivity {
|
|
|
|
static let addAccountType = "net.shadowfacts.Reader.activity.add-account"
|
|
static let activateAccountType = "net.shadowfacts.Reader.activity.activate-account"
|
|
|
|
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
|
|
}
|
|
|
|
}
|