fix: resolve iOS 26 deprecation warnings
- Text '+' concatenation → HStack (MealSectionView) - UIScreen.main → UIWindowScene.screen (EntryListView, ArticleWebView) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -47,12 +47,14 @@ struct MealSectionView: View {
|
||||
|
||||
Spacer()
|
||||
|
||||
Text("\(Int(totalCalories))")
|
||||
.font(.title3.weight(.bold))
|
||||
.foregroundStyle(Color.mealColor(for: mealType.rawValue))
|
||||
+ Text(" kcal")
|
||||
.font(.caption.weight(.medium))
|
||||
.foregroundStyle(Color.textSecondary)
|
||||
HStack(spacing: 2) {
|
||||
Text("\(Int(totalCalories))")
|
||||
.font(.title3.weight(.bold))
|
||||
.foregroundStyle(Color.mealColor(for: mealType.rawValue))
|
||||
Text("kcal")
|
||||
.font(.caption.weight(.medium))
|
||||
.foregroundStyle(Color.textSecondary)
|
||||
}
|
||||
|
||||
Image(systemName: "chevron.right")
|
||||
.font(.caption.weight(.medium))
|
||||
|
||||
@@ -16,7 +16,8 @@ final class ArticleRenderer {
|
||||
|
||||
// Create at screen size so WebKit initializes the GPU compositor
|
||||
// during warmup, not on first article open.
|
||||
webView = WKWebView(frame: UIScreen.main.bounds, configuration: config)
|
||||
let screenBounds = (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.screen.bounds ?? CGRect(x: 0, y: 0, width: 393, height: 852)
|
||||
webView = WKWebView(frame: screenBounds, configuration: config)
|
||||
webView.isOpaque = false
|
||||
webView.backgroundColor = .clear
|
||||
webView.scrollView.isScrollEnabled = true
|
||||
|
||||
@@ -14,9 +14,10 @@ struct EntryListView: View {
|
||||
@State private var cumulativeUp: CGFloat = 0
|
||||
@State private var markedByScroll: Set<Int> = []
|
||||
|
||||
// Viewport height — measured once from screen bounds.
|
||||
// Safe because this view only appears on iPhone in portrait/landscape.
|
||||
private var viewportHeight: CGFloat { UIScreen.main.bounds.height }
|
||||
// Viewport height — use the first connected scene's screen.
|
||||
private var viewportHeight: CGFloat {
|
||||
(UIApplication.shared.connectedScenes.first as? UIWindowScene)?.screen.bounds.height ?? 800
|
||||
}
|
||||
|
||||
// Fixed threshold — per-entry deltas are small (~1-2pt each),
|
||||
// so 100pt accumulates after scrolling roughly one screenful.
|
||||
|
||||
Reference in New Issue
Block a user