Thanks for your answer Claude31.
For various reasons being :
I need to send to the server the display area before even beginning to load a view
That will not give me the insets for all orientation
Besides, I can use the UIApplication.shared.windows.first?.safeAreaInsets to get the same result I guess ;-)
FYI, I tried with appearance, but safeAreaInsets are .zero and safeAreaLayoutGuide is still nil, that's a shame :-/
let appearance = UICollectionView.appearance(for: self.traitCollection, whenContainedInInstancesOf: [UIViewController.self, UINavigationController.self]) print(" \(appearance.safeAreaInsets) - \(appearance.safeAreaLayoutGuide)")
Interesting fact : if I use a trigger, it does not crash. Is a use a timer that flips a boolean trigger to mimic a loop, it does not crash either (just edited the POST)
Thanks for your answer Claude31.
For various reasons being :
I need to send to the server the display area before even beginning to load a view
That will not give me the insets for all orientation
Besides, I can use the UIApplication.shared.windows.first?.safeAreaInsets to get the same result I guess ;-)
FYI, I tried with appearance, but safeAreaInsets are .zero and safeAreaLayoutGuide is still nil, that's a shame :-/
let appearance = UICollectionView.appearance(for: self.traitCollection, whenContainedInInstancesOf: [UIViewController.self, UINavigationController.self]) print(" \(appearance.safeAreaInsets) - \(appearance.safeAreaLayoutGuide)")
Interesting fact : if I use a trigger, it does not crash. Is a use a timer that flips a boolean trigger to mimic a loop, it does not crash either (just edited the POST)