Code screenshot :
https://imgse.com/i/vRVtXR 、
https://imgse.com/i/vRVYc9 、
https://imgse.com/i/vRVUn1 、
GitHub:
https://github.com/huipengo/WBOrientation
[WBDeviceOrientation interfaceOrientation:orientation viewController:self]; NSLog(@"-----%lf", [UIScreen mainScreen].bounds.size.width);
It is not possible to get the width immediately, but it is possible in iOS15.