Tusker/Tusker/Shortcuts/UserActivityType.swift

29 lines
788 B
Swift
Raw Normal View History

2018-10-20 14:54:59 +00:00
//
// UserActivityType.swift
// Tusker
//
// Created by Shadowfacts on 10/19/18.
// Copyright © 2018 Shadowfacts. All rights reserved.
//
import Foundation
enum UserActivityType: String {
2019-09-16 00:43:06 +00:00
case newPost = "net.shadowfacts.Tusker.activity.new-post"
case checkNotifications = "net.shadowfacts.Tusker.activity.check-notifications"
case showTimeline = "net.shadowfacts.Tusker.activity.show-timeline"
2018-10-20 14:54:59 +00:00
}
extension UserActivityType {
var handle: (NSUserActivity) -> Void {
switch self {
case .newPost:
return UserActivityManager.handleNewPost
case .checkNotifications:
return UserActivityManager.handleCheckNotifications
2019-09-16 00:43:06 +00:00
case .showTimeline:
return UserActivityManager.handleShowTimeline
2018-10-20 14:54:59 +00:00
}
}
}