Skip to content

Warning when showing AlertView with textfield #327

@angelFrog

Description

@angelFrog

Hello,

I get this warning when showing an AlertView with a textfield:

[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.

The warning is triggered in AlertView.swift, createScrollViewConstraints() by self.scrollView.layoutIfNeeded()

I don't think I was getting this warning prior to iOS 15. The alert and textfield still work as expected. No other alerts receive this warning or hit the specified symbolic breakpoint.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions