mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Initial widget work
• Latest data is saved out to JSON at various points. • Technote on widget usage. • Widget target added.
This commit is contained in:
28
Multiplatform/Shared/Widget Data/WidgetData.swift
Normal file
28
Multiplatform/Shared/Widget Data/WidgetData.swift
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// WidgetData.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Stuart Breckenridge on 10/7/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct WidgetData: Codable {
|
||||
|
||||
let currentUnreadCount: Int
|
||||
let currentTodayCount: Int
|
||||
let latestArticles: [LatestArticle]
|
||||
let lastUpdateTime: Date
|
||||
|
||||
}
|
||||
|
||||
struct LatestArticle: Codable {
|
||||
|
||||
let feedTitle: String
|
||||
let articleTitle: String?
|
||||
let articleSummary: String?
|
||||
let feedIcon: Data? // Base64 encoded image data
|
||||
let pubDate: String
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user