mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Importing Cocoa pulls in CoreData, which we're not using. https://github.com/brentsimmons/NetNewsWire/blob/master/Technotes/CodingGuidelines.md
24 lines
509 B
Swift
24 lines
509 B
Swift
//
|
|
// SongNotifierService.swift
|
|
// Persephone
|
|
//
|
|
// Created by Daniel Barber on 2019/4/14.
|
|
// Copyright © 2019 Dan Barber. All rights reserved.
|
|
//
|
|
|
|
import AppKit
|
|
|
|
struct SongNotifierService {
|
|
let song: Song
|
|
let image: NSImage?
|
|
|
|
func deliver() {
|
|
let notification = NSUserNotification()
|
|
notification.title = song.title
|
|
notification.subtitle = "\(song.artist) — \(song.album.title)"
|
|
notification.contentImage = image
|
|
|
|
NSUserNotificationCenter.default.deliver(notification)
|
|
}
|
|
}
|