Tusker/Tusker/Shortcuts/NSUserActivity+Extensions.s...

24 lines
490 B
Swift

//
// NSUserActivity+Extensions.swift
// Tusker
//
// Created by Shadowfacts on 10/19/18.
// Copyright © 2018 Shadowfacts. All rights reserved.
//
import Foundation
extension NSUserActivity {
convenience init(type: UserActivityType) {
self.init(activityType: type.rawValue)
}
func handleResume() -> Bool {
guard let type = UserActivityType(rawValue: activityType) else { return false }
type.handle(self)
return true
}
}