Skip to content

Instantly share code, notes, and snippets.

@hsleedevelop
Last active October 8, 2020 08:57
Show Gist options
  • Save hsleedevelop/4c3181b9f596f8b32d621f6621fdd341 to your computer and use it in GitHub Desktop.
Save hsleedevelop/4c3181b9f596f8b32d621f6621fdd341 to your computer and use it in GitHub Desktop.
UITableViewAlertForLayoutOutsideViewHierarchy
https://developer.apple.com/forums/thread/120790
Still an issue in newly released 13.4.
My main problem is when a table is in split overlay mode (e.g. by default on iPhone X/XR/11) but hidden the rotation causes UITableView layoutSubviews which throws UITableViewAlertForLayoutOutsideViewHierarchy despite the table not being in the window.
Apple please see FB7306484
My current workaround involves subclassing UITableView with:
#import "TableView.h"
@implementation TableView
- (void)layoutSubviews{
if(!self.window){
return;
}
[super layoutSubviews];
}
@end
But there are still cases where the issue occurs.
I'm thinking about just ignoring this and going back to letting the table view be updated when not in a window too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment