IOS-M3-06 清理 MaterialReaderView 死代码路径 + 优化高度估算 #34

Closed
opened 2026-06-02 21:15:06 +08:00 by wangdl · 0 comments
Owner

问题

contentHeightEstimate 硬编码 80px

// MaterialReaderView.swift L260
private var contentHeightEstimate: CGFloat {
    let count = max(vm.blocks.count, 1)
    return CGFloat(count) * 80  // ← 不准确
}

nativeReaderBody 死代码

image/markdown/text 分支逻辑混乱,需要清理未使用的代码路径。

剩余工作

  1. 用实际渲染高度替换 contentHeightEstimate 的 80px 估算
  2. 清理 nativeReaderBody 中未使用的条件分支

涉及文件

  • MaterialReaderView.swift
## 问题 ### contentHeightEstimate 硬编码 80px ```swift // MaterialReaderView.swift L260 private var contentHeightEstimate: CGFloat { let count = max(vm.blocks.count, 1) return CGFloat(count) * 80 // ← 不准确 } ``` ### nativeReaderBody 死代码 image/markdown/text 分支逻辑混乱,需要清理未使用的代码路径。 ## 剩余工作 1. 用实际渲染高度替换 contentHeightEstimate 的 80px 估算 2. 清理 nativeReaderBody 中未使用的条件分支 ## 涉及文件 - `MaterialReaderView.swift`
wangdl added this to the M3:iOS 资料阅读闭环 milestone 2026-06-02 21:15:06 +08:00
wangdl changed title from IOS-M3-06 清理 MaterialReaderView 死代码路径 to IOS-M3-06 清理 MaterialReaderView 死代码路径 + 优化高度估算 2026-06-06 19:04:50 +08:00
Sign in to join this conversation.
No description provided.