PuzzleNotificationText+GameEntity.swift (555B)
1 import Foundation 2 3 extension PuzzleNotificationText { 4 /// Convenience over `title(_:publisher:date:)` for a `GameEntity`. Lives in 5 /// the app target because it reaches into Core Data; the core builders are 6 /// in `Shared` so the notification service extension can use them too. 7 static func title(for entity: GameEntity?) -> String { 8 guard let entity else { return "" } 9 return title( 10 entity.title ?? "", 11 publisher: entity.cachedPublisher, 12 date: entity.cachedPuzzleDate 13 ) 14 } 15 }