iphone-x

How can I detect if my device is an iPhoneX in Swift 4? [duplicate]

本小妞迷上赌 提交于 2019-11-28 12:20:58
This question already has an answer here: Detect if the device is iPhone X 34 answers I am sure there is a better, more proper way to do this. But right now I am using UIScreen.main.bounds to detect if I am dealing with an iPhone X (812 tall) or not. This specific app is landscape only, btw. So this is what I have in this function where I am crating slides for a slide view: func setupSlideViews(slideView: [SlideView]) { let screenSize = UIScreen.main.bounds var frame: CGRect! if screenSize.width == 812 { frame = scrollView.frame } else { frame = view.frame } scrollView.frame = frame scrollView

How to change home indicator background color on iPhone X?

为君一笑 提交于 2019-11-28 06:59:55
问题 I would like to change the background color of the view that appears on the bottom of the new iPhone X with a home indicator inside. Is it possible? 回答1: The home indicator color is determined automatically based on the color of the content below it. Most of the time, this means you should not worry about its color since it is out of your control, and will always be clearly visible to users. However, you can place a colored view in the area behind the home indicator to manipulate its color.

iPhone X how to handle View Controller inputAccessoryView?

丶灬走出姿态 提交于 2019-11-27 18:50:36
I have a messaging app that has the typical UI design of a text field at the bottom of a full screen table view. I am setting that text field to be the view controller's inputAccessoryView and calling ViewController.becomeFirstResponder() in order to get the field to show at the bottom of the screen. I understand this is the Apple recommended way of accomplishing this UI structure and it works perfectly on "classic" devices however when I test on the iPhone X simulator I notice that using this approach, the text field does not respect the new "safe areas". The text field is rendered at the

iPhone X / 8 / 8 Plus CSS media queries

随声附和 提交于 2019-11-27 16:59:40
What are the CSS media queries corresponding to Apple's new devices ? I need to set the body 's background-color to change the X's safe area background color. nathan iPhone X @media only screen and (device-width : 375px) and (device-height : 812px) and (-webkit-device-pixel-ratio : 3) { } iPhone 8 @media only screen and (device-width : 375px) and (device-height : 667px) and (-webkit-device-pixel-ratio : 2) { } iPhone 8 Plus @media only screen and (device-width : 414px) and (device-height : 736px) and (-webkit-device-pixel-ratio : 3) { } iPhone 6+/6s+/7+/8+ share the same sizes, while the

iPhone 8, iPhone 8 Plus and iPhone X device code

谁说胖子不能爱 提交于 2019-11-27 16:45:55
问题 I'm using the below code to get the device name NSString* code = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; Which gives the result as follows and mapped to devices @"iPhone9,1" :@"iPhone 7", @"iPhone9,3" :@"iPhone 7", @"iPhone9,2" :@"iPhone 7 Plus", @"iPhone9,4" :@"iPhone 7 Plus", Do we have the new device code for the new devices that are released (iPhone 8, iPhone 8 Plus and iPhone X) 回答1: Edit: This has been corrected. The iPhone X is NOT iPhone10,5 and

Can we test Face ID in simulator?

只愿长相守 提交于 2019-11-27 14:57:01
Can we test biometric authentication using the simulator? The iPhone X Simulator shows a menu for Face ID enrollment, but after enabling that, what can I do? How it will recognize a face for authentication? Simulator does not recognise a face but allows you to simulate a matching and non-matching faces, if you've enabled Enrolled option from Face ID . Add following code to your view controller and try with Face-ID import LocalAuthentication class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() localAuthentication() } func localAuthentication() -> Void { let

iOS 11 Layout guidance about safe Area for iPhone x

纵饮孤独 提交于 2019-11-27 13:19:31
My application already in app store, yesterday i have updated my Xcode version to 9 and works fine except iPhone x . UI got collapsed. 1.Here I have Created Two UIView (both are fixed height) named as Header and Tab bar and I have hidden my NavigationBar entire app. 2.Added extension to UIViewController for making Header and Tab bar func addHeaderTab(currentViewController:UIViewController,content:String, isMenu:Bool){ let noView = TopHeaderView() noView.tag = 12345 noView.isMenu = isMenu noView.translatesAutoresizingMaskIntoConstraints = false currentViewController.view .addSubview(noView) if

How to Add iPhoneX Launch Image

拟墨画扇 提交于 2019-11-27 11:35:35
Using Xcode Version 9.0 (9A235), I am trying to add a Launch Image for iPhoneX at the requested 2436px × 1125px (landscape). Currently I am using a Storyboard and it looks like this: 'launchimage' is an Image View linked to an Image Set: And the Image Set is as follows: The only place I get an iPhoneX sized image is in a Launch Image set: But when I try to select a Launch Image in the Image View on the storyboard it can't be selected: Any help on how to add the correct sized launch image for iPhoneX or is it back to Launch Images? I would prefer the correct sized image, not a stretched one.

How to fix Xcode error: Could not locate device support files on iPhone with Xcode

为君一笑 提交于 2019-11-27 11:06:27
问题 I have this error for the new iPhone X: Could not locate device support files. This iPhone X (Model A1865, A1901, A1902, A1903) is running iOS 11.1 (15B93), which may not be supported by this version of Xcode. I'm running the latest version of Xcode (Beta 9.2 9C32c) which doesn't support the iPhone X (iOS 11.1). The problem is it's a brand new iPhone, and there are no older Configuration Files to do the switch talked in most of the solved posts. Are there any other solution to this issue

What is the top bar height of iPhone X?

半世苍凉 提交于 2019-11-27 11:05:49
I would like to know exact height of top bar of iPhone X. Could you please mention the status bar and navigation bar height of iPhone X. Please help me. Anbu.Karthik The display on iPhone X, however, is 145pt taller than a 4.7" display, resulting in roughly 20% additional vertical space for content. for more information you get HIG for iphone X from apple documents and detail description in here1 and here2 status bar height previously 20pt, now 44pt Because of the sensors on top of the display, the new status bar is split in 2 parts. If your UI is doing something special with that space