pointfreeco / swift-snapshot-testing

📸 Delightful Swift snapshot testing.
https://www.pointfree.co/episodes/ep41-a-tour-of-snapshot-testing
MIT License
3.74k stars 570 forks source link

Running snapshot on separate module framework #735

Open WHuangz88 opened 1 year ago

WHuangz88 commented 1 year ago

Do anyone encounter tableview cannot render its view due to running the snapshot not in host application?

WHuangz88 commented 1 year ago

I found out that each time I run the snapshot not in host application, the tableview will log some kind of warning like this

[TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <UITableView: 0x7f77ce832200; frame = (-196.5 -360; 393 720); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x60000265bcc0>; backgroundColor = <UIDynamicProviderColor: 0x6000028d0a40; provider = <NSMallocBlock: 0x6000026e7cf0>>; layer = <CALayer: 0x600002897b00>; contentOffset: {0, 0}; contentSize: {393, 0}; adjustedContentInset: {0, 0, 0, 0}; dataSource: <RxCocoa.RxTableViewDataSourceProxy: 0x600000ca7780>>