frenzy-ios/Reader/UserActivities.swift

33 lines
907 B
Swift

//
// UserActivities.swift
// Reader
//
// Created by Shadowfacts on 1/15/22.
//
import Foundation
extension NSUserActivity {
static let preferencesType = "net.shadowfacts.Reader.activity.preferences"
static let addAccountType = "net.shadowfacts.Reader.activity.add-account"
static let activateAccountType = "net.shadowfacts.Reader.activity.activate-account"
static func preferences() -> NSUserActivity {
return NSUserActivity(activityType: preferencesType)
}
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
}
}