So I've got a function that really helps when I'm crafting device specific URLS but I'd like to place it in a global header file so any class could use it easily
- (NSString *)deviceType
{
NSString *deviceName = @"iphone";
if([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
deviceName = @"ipad";
}
else {
deviceName = @"iphone4";
}
}
return deviceName;
}
That may or may not be the best way of doing it but I'd like to know how to get that into a global header so I can do something like this
NSString *deviceName = GETDEVICENAME;