In iOS versions prior to iOS 8, to check whether the device is iPhone 5/iPhone 5s, checking [UIScreen mainScreen].bounds.size.height == 568.0 was enough. But in iOS 8.x onwards, this check may fail as the bounds are now orientation dependant. I need a solution to identify the iPhone 5s, 6 and 6+ devices without checking the iOS version.
iOS 8.x alternative to detect iPhone 5s, using [UIScreen mainScreen].bounds.size.height == 568.0
933 views Asked by AudioBubble At
2
There are 2 answers
Related Questions in OBJECTIVE-C
- How to control the volume of an iPhone programmatically in objective-c
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- How to set value the descriptor of iOS BLE in Objective-C?
- Unexpected #selector() Behavior in Swift-Objective-C Interop?
- In what context can we use an unqualified #selector() expression in Swift?
- AVPictureInPictureController crashes during initialization
- How to use pow() in Objective-C?
- How to change the image on the MGSwipeButton in MGSwipeTableCell
- Using sort descriptors in Outline View
- Why is my Swift function not printing from inside the dataTask closure?
- Using UICollectionViewCell with IBOutlet
- Undefined symbol: _OBJC_CLASS_$_ only on simulator
- Why can't I receive a notification sent from Camera Extension(Swift) to an observer application (obj-c++)
- Behavior of __block modifier in objc
- Inserting subview into view where I've added subviews and sublayers
Related Questions in IOS8
- Are iOS MDM profile config file meant to be public?
- Compatibility of named colors below iOS 11
- iOS12, kReachabilityChangedNotification is not worked
- How to add buttons to wkWebView?
- iOS 8 - show incoming call when app is not active (without CallKit)
- pangestures interactive like mail app in iOS
- Animating swipe actions in tableview
- ASIHTTPREQUEST not working as expected in iOS 8.3
- Xcode 9 - Safe Area Layout Guides Error Comes Back
- Using spotlight in iOS app with deployment target iOS 8
- Issue with UIImage on older iOS versions
- How do you launch an iOS app in the current device orientation?
- uiimageview.image appears to be warped on iOS 8 simulator
- Codename One - Can't read from socket on real device
- iPhone X backward compatibility to cater devices below iOS 8 versions and future compatibility
Related Questions in IPHONE-5
- How to connect with iPhone 5s in Xcode 14.3?
- device-aspect-ratio is deprecated
- Xamarin.Forms and App Center: unable to install iOS release on iPhone 5s
- How can I code an iOS app while on my iPhone without a pc
- Only on iPhone 5: swipe event hits element underneath select list depending on list length
- push token's delegte method not invoke in Specifically in iPhone 5s with ios 12.4.5
- Links not working on iPhone 5C
- angular 5: Angular 5 app not rendered on iphone 5
- Message from debugger:Terminated due to Memory Error
- App crashes on only iPhone 5 when adding GMSMarker to the map: EXC_BAD_ACCESS
- Getting an iPhone 5 to use the 'correct' css rules
- How to get video to autoplay on older iPhones?
- UIView button not visible on iPhone 5 despite constraints
- How to find the cause of a 100% CPU usage on an iPhone App when i use ionic2
- Apple Mach-O Linker (ld) Error Group when run in iphone 5 Device
Related Questions in BOUNDS
- Rust add bound to borrowed type
- Typescript generic bound any object except any class
- Bound & Unbound Method Object
- How to use CameraComponent.setBounds() in Flutter Flame?
- Remove extra blank elements in an array VBA
- How do I obtain the world-space position of PolygonCollider2D points?
- react-leaflet - SVGOverlay how update bounds rendering after new bounds selection
- Measure text in canvas with stroke - Android
- AppleScript: Save/Restore the Bounds of Every Open Window by Path/Name
- Bounds / BoundingVolume of a Model with source "#cube" in QML
- 'Index was outside the bounds of the array' for a String() Method
- Fitting Data with Scipy Optimize Minimize with Both Constraints and Bounds
- why setting bounds origin makes the subview move to another direction in iOS?
- Python - minimize with x[0] < x[1] < x[2] constraint
- moving the image (Animated.Image) only within the view react native
Related Questions in MAINSCREEN
- Making a main screen in Ursina
- Name mainscreen is not defined
- How to make the windows form open only on the main screen
- Android Main Screen glitch on Rapberry Pi3
- UIScreen class is gone in ios10 simulator sdk
- WPF : Keep the window maximized when switch main screen
- How to display a UIView which overlaps the UINavigationBar
- Setting app icon on home(main) screen default
- iOS 8.x alternative to detect iPhone 5s, using [UIScreen mainScreen].bounds.size.height == 568.0
- Detecting iPhone 6 and plus
- UIScreen mainScreen bounds different between simulator and actual device on iOS8
- RelativeLayout params for main screen widget
- Creating logic to handle view/button sizes
- Screen height for iPhone4 with 4-inch screen
- How to call and pass other mainscreen?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I was able to detect the devices using the following macros. This will be useful if you want identify the device, to perform some update on views(like updating frames on orientation changes). If you exactly want the device model/make, use this link (ios iphone get device model and make?) instead.