mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-11-03 22:27:13 +01:00
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
820 B
Swift
17 lines
820 B
Swift
#if canImport(UIKit)
|
|
import UIKit
|
|
@testable import RichTextEditorUIKit
|
|
|
|
extension DocumentCanvasView {
|
|
/// Test helper: makes a canvas-DIRECT test behave as if its real parent (`RichTextEditorView`) is
|
|
/// present and eagerly re-lays the canvas out whenever it reports a content-size change. Production
|
|
/// only NOTIFIES (`notifyContentSizeChanged()` → `onContentSizeChange`); the parent drives
|
|
/// `layoutContent()`. Tests that read post-edit geometry (block/emoji/dust views synced in
|
|
/// `layoutContent`) call this once after creating the canvas + setting its frame, so an edit flushes
|
|
/// layout the way it does at runtime. Install AFTER any initial `layoutIfNeeded()`.
|
|
func simulateParentLayout() {
|
|
onContentSizeChange = { [weak self] in self?.layoutContent() }
|
|
}
|
|
}
|
|
#endif
|