Recently I had a problem in my React Native app where certain elements of the UI were invisible on iOS 12.4. It turned out that these were the components that were nested too deeply inside the view hierarchy - more than around 85 components deep. I know that's a lot, it was caused by the usage of the React Navigation library and our design of the screen hierarchy. Someone had a similar problem here.
Turns out that the component nesting limit varies by iOS version. On 12.4 it was around 85, while on 14.1 it seems to be over 140, which is why we had no issues when developing for the newer versions. Interestingly enough, on 12.0 the components seem to always appear, until the view hierarchy depth crashes the app, which seems to happen around 350 levels. I made a GitHub repo to reproduce the issue here. It displays 300 nested UIStackViews with a UILabel in every tenth of them displaying the current nesting level. You can see how it displays on those iOS versions I mentioned:
iOS 12.4
iOS 14.1
iOS 12.0
It seems to be a very obscure issue - for the vast majority of apps, 85 levels of component nesting is more than enough, hence why I haven't been able to find almost anything about this issue on the internet. However, I hope that maybe here somebody, probably an Apple engineer, will tell me if there's a way to influence the limit of component nesting on various versions of iOS. This has caused our team some headaches in recent days due to issues on production.
Turns out that the component nesting limit varies by iOS version. On 12.4 it was around 85, while on 14.1 it seems to be over 140, which is why we had no issues when developing for the newer versions. Interestingly enough, on 12.0 the components seem to always appear, until the view hierarchy depth crashes the app, which seems to happen around 350 levels. I made a GitHub repo to reproduce the issue here. It displays 300 nested UIStackViews with a UILabel in every tenth of them displaying the current nesting level. You can see how it displays on those iOS versions I mentioned:
iOS 12.4
iOS 14.1
iOS 12.0
It seems to be a very obscure issue - for the vast majority of apps, 85 levels of component nesting is more than enough, hence why I haven't been able to find almost anything about this issue on the internet. However, I hope that maybe here somebody, probably an Apple engineer, will tell me if there's a way to influence the limit of component nesting on various versions of iOS. This has caused our team some headaches in recent days due to issues on production.