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()
|
Spacer()
|
||||||
|
|
||||||
|
HStack(spacing: 2) {
|
||||||
Text("\(Int(totalCalories))")
|
Text("\(Int(totalCalories))")
|
||||||
.font(.title3.weight(.bold))
|
.font(.title3.weight(.bold))
|
||||||
.foregroundStyle(Color.mealColor(for: mealType.rawValue))
|
.foregroundStyle(Color.mealColor(for: mealType.rawValue))
|
||||||
+ Text(" kcal")
|
Text("kcal")
|
||||||
.font(.caption.weight(.medium))
|
.font(.caption.weight(.medium))
|
||||||
.foregroundStyle(Color.textSecondary)
|
.foregroundStyle(Color.textSecondary)
|
||||||
|
}
|
||||||
|
|
||||||
Image(systemName: "chevron.right")
|
Image(systemName: "chevron.right")
|
||||||
.font(.caption.weight(.medium))
|
.font(.caption.weight(.medium))
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ final class ArticleRenderer {
|
|||||||
|
|
||||||
// Create at screen size so WebKit initializes the GPU compositor
|
// Create at screen size so WebKit initializes the GPU compositor
|
||||||
// during warmup, not on first article open.
|
// 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.isOpaque = false
|
||||||
webView.backgroundColor = .clear
|
webView.backgroundColor = .clear
|
||||||
webView.scrollView.isScrollEnabled = true
|
webView.scrollView.isScrollEnabled = true
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ struct EntryListView: View {
|
|||||||
@State private var cumulativeUp: CGFloat = 0
|
@State private var cumulativeUp: CGFloat = 0
|
||||||
@State private var markedByScroll: Set<Int> = []
|
@State private var markedByScroll: Set<Int> = []
|
||||||
|
|
||||||
// Viewport height — measured once from screen bounds.
|
// Viewport height — use the first connected scene's screen.
|
||||||
// Safe because this view only appears on iPhone in portrait/landscape.
|
private var viewportHeight: CGFloat {
|
||||||
private var viewportHeight: CGFloat { UIScreen.main.bounds.height }
|
(UIApplication.shared.connectedScenes.first as? UIWindowScene)?.screen.bounds.height ?? 800
|
||||||
|
}
|
||||||
|
|
||||||
// Fixed threshold — per-entry deltas are small (~1-2pt each),
|
// Fixed threshold — per-entry deltas are small (~1-2pt each),
|
||||||
// so 100pt accumulates after scrolling roughly one screenful.
|
// so 100pt accumulates after scrolling roughly one screenful.
|
||||||
|
|||||||
Reference in New Issue
Block a user