Images for iphone 5 retina display

Here’s an except from my blog about this subject: [UIImage imageNamed:] automatically loads @2x versions of images when running on a retina device. Unfortunately, imageNamed: will NOT automatically load -568h@2x versions of images when running on an iPhone 5. Sometimes this doesn’t matter, for example icons and non-full screen graphics are probably the same on … Read more

Creating a percentage based iOS layout

Using Xcode 6.0, you can now specify proportional width or height in Interface Builder. Steps for percentage height from superview: While both the child view and its superview are selected, add an “equal height” constraint (or “equal width” if you wish to have a proportional width). Then change the “multiplier” of the constraint you just … Read more

How to switch to different Storyboard for iPhone 5?

I was looking for the same answer couple of weeks ago here’s my solution hope helps.. -(void)initializeStoryBoardBasedOnScreenSize { if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) { // The iOS device = iPhone or iPod Touch CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size; if (iOSDeviceScreenSize.height == 480) { // iPhone 3GS, 4, and 4S and iPod Touch 3rd and … Read more

How to create Custom MKAnnotationView and custom annotation title and subtitle

To create a custom annotation view (your replacement for the standard pin), you can just set the image property of the MKAnnotationView in the viewForAnnotation method: – (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { if ([annotation isKindOfClass:[MKUserLocation class]]) { return nil; } else if ([annotation isKindOfClass:[YourAnnotationClassHere class]]) // use whatever annotation class you used when creating … Read more

iPhone 5 CSS media query

Another useful media feature is device-aspect-ratio. Note that the iPhone 5 does not have a 16:9 aspect ratio. It is in fact 40:71. iPhone < 5: @media screen and (device-aspect-ratio: 2/3) {} iPhone 5: @media screen and (device-aspect-ratio: 40/71) {} iPhone 6: @media screen and (device-aspect-ratio: 375/667) {} iPhone 6 Plus: @media screen and (device-aspect-ratio: … Read more