以下拿IphoneX为例
#define APP_SCREEN_WIDTH (APP_SCREEN_BOUNDS.size.width)
#define APP_SCREEN_HEIGHT (APP_SCREEN_BOUNDS.size.height)
CGFloat screenScale = [UIScreen mainScreen].scale;
// 横向分辨率
CGFloat screenX = APP_SCREEN_WIDTH * screenScale;
// 竖直分辨率
CGFloat screenY = APP_SCREEN_HEIGHT * screenScale;
NSLog(@"横向分辨率%lf 竖直分辨率%lf",screenX,screenY);