I need to customize my views on the iPhone X, but I cannot figure out when safeAreaInsets is initialized. According to the documentation,
If the view is not currently installed in the view hierarchy or is not but visible on the screen, the cross-attachments of this property are 0.
I would think that when calling viewDidLoad, the values will be set, but that is not the case. I can get the values when calling viewDidLayoutSubviews, but it seems too late and in any case does not return the correct values.
Can someone explain how to use the safeAreaInsets property for me?
source
share