Files
rapira-market-widget/crypto/CryptoWidget.swift
T
2026-08-12 07:06:01 +07:00

39 lines
977 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import WidgetKit
import SwiftUI
@main
struct CryptoWidget: Widget {
/// Идентификатор вида менять нельзя, иначе слетят установленные виджеты.
static let kind = "CryptoWidget"
var body: some WidgetConfiguration {
StaticConfiguration(kind: Self.kind, provider: CryptoProvider()) { entry in
CryptoWidgetEntryView(entry: entry)
}
.configurationDisplayName("Rapira Crypto")
.description("Курсы криптовалют в реальном времени")
.supportedFamilies([.systemSmall, .systemMedium, .systemLarge])
.contentMarginsDisabled()
}
}
// MARK: - Превью
#Preview(as: .systemSmall) {
CryptoWidget()
} timeline: {
PreviewData.entry
}
#Preview(as: .systemMedium) {
CryptoWidget()
} timeline: {
PreviewData.entry
}
#Preview(as: .systemLarge) {
CryptoWidget()
} timeline: {
PreviewData.entry
}