A small menubar app that allows you to switch between R versions quickly (if you have multiple versions of R framework installed). https://rud.is/rswitch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
825 B

5 years ago
//
// Notify.swift
// RSwitch
//
// Created by hrbrmstr on 8/24/19.
// Copyright © 2019 Bob Rudis. All rights reserved.
//
import Foundation
import Cocoa
extension AppDelegate : NSUserNotificationCenterDelegate {
5 years ago
func notifyUser(title: String? = nil, subtitle: String? = nil, text: String? = nil) -> Void {
5 years ago
let notification = NSUserNotification()
notification.title = title
notification.subtitle = subtitle
notification.informativeText = text
notification.soundName = NSUserNotificationDefaultSoundName
NSUserNotificationCenter.default.delegate = self
NSUserNotificationCenter.default.deliver(notification)
}
func userNotificationCenter(_ center: NSUserNotificationCenter, shouldPresent notification: NSUserNotification) -> Bool {
5 years ago
return(true)
5 years ago
}
}