1
Fork 0
This repository has been archived on 2025-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
spectogram-prototype/SpectogramPrototype/UIScreen+Util.m

27 lines
606 B
Objective-C

//
// UIScreen+Util.m
// SpectogramPrototype
//
// Created by Joshua Moerman on 25/02/14.
// Copyright (c) 2014 Joshua Moerman. All rights reserved.
//
#import "UIScreen+Util.h"
@implementation UIScreen (Util)
// from http://stackoverflow.com/questions/3504173/detect-retina-display
+ (BOOL) isRetinaDisplay {
static BOOL retina = NO;
static BOOL alreadyChecked = NO;
if (!alreadyChecked) {
UIScreen *mainScreen = self.mainScreen;
if (mainScreen) {
retina = mainScreen.scale > 1.0;
alreadyChecked = YES;
}
}
return retina;
}
@end