iphone-x

How to get rid of safeAreaInsets on UIScrollview (iOS 11, iPhoneX)

ε祈祈猫儿з 提交于 2019-12-06 14:59:04
I have a horizontal paging UIScrollview , following is my VFL constraints for leading/trailing H:|-0-[ScrollView]-0-| (aligned to superview). I have left/right safeAreaInsets on landscape orientation in iPhone X. Is it a bug? or I am missing any Apple way that these insets will not be applied when we do not need? I am using following to skip content inset adjustment: UIScrollview.contentInsetAdjustmentBehavior = .never I found that in iOS 11 UIScrollViewContentInsetAdjustmentBehavior.always includes safe area layout guide and apply these margins as insets, so tried .never it worked )) If you

Difficulty getting depth of face landmark points from 2D regions on iPhone X (SceneKit/ARKit app)

試著忘記壹切 提交于 2019-12-06 14:27:53
I'm running face landmark detection using the front-facing camera on iPhone X, and am trying very hard to get 3D points of face landmarks (VNFaceLandmarkRegion2D gives image coordinates X, Y only). I've been trying to use either the ARSCNView.hitTest or ARFrame.hitTest , but am so far unsuccessful. I think my error may be in converting the initial landmark points to the correct coordinate system. I've tried quite a few permutations, but currently based on my research this is what I've come up with: let point = CGPoint(x: landmarkPt.x * faceBounds.width + faceBounds.origin.x, y: (1.0 -

UIKeyboardWillChangeFrame and iPhone X

爱⌒轻易说出口 提交于 2019-12-06 14:08:19
问题 Trying with simulator here, and it seems that the frame returned when listening for changes with UIKeyboardWillChangeFrame is incorrect for iPhone X. Specifically the frame seems to be a bit taller than it actually is (visibly) on screen. I'd say the returned frame is about 20 points taller. Did I forget something obvious? Some data... The iPhone X and iPhone 8 have the same width in portrait, which makes it the same height in landscape; 375 points. ( https://www.paintcodeapp.com/news

UITableview merging with the home indicator on iPhone X

怎甘沉沦 提交于 2019-12-06 08:15:18
问题 I have a UITableView created programmatically. This UITableView merges with the home indicator on an iPhone X device. How can I fix this issue? 回答1: Programatically, set bottom anchor of tableview with bottom anchor of SafeAreaLayout. Here is sample/test code, how to programatically set safe area layout with respect to interface elements. if #available(iOS 11, *) { let guide = view.safeAreaLayoutGuide NSLayoutConstraint.activate([ table.topAnchor.constraintEqualToSystemSpacingBelow(guide

Subclassing NSLayoutConstraint constant based on screen height

Deadly 提交于 2019-12-06 03:43:26
I have a project with a Tab Bar, and a custom Navigation bar for each of the tabs. Each of the Navigation bar UIViews have a height constraint constant set in the storyboard. I would like to subclass this NSLayoutConstraint (for the Nav height), so that it changes the height for iPhone X. The Navigation bar needs to be much taller on an iPhone X, and since I'm not using "out of the box" objects, my constraints need to be manually set. Essentially, I want to do something like the following in the subclass, so I don't have to repeat a bunch of code and make unnecessary outlets: override func

iPhone X - How are we supposed to handle the space above table section headers? It's showing through the content

偶尔善良 提交于 2019-12-06 03:29:38
I have a tableview with multiple sections and section headers for each section. As you know, section header moves with the tableview. So if there are more than one sections, the current section's header sticks to the top of the tableview while the content of that section scrolls under the header. I am trying to figure out on how it's supposed to get adapted for the iPhone X as the space above the header is showing through the content as you notice in this screenshot. I looked at the Apple view on how to adapt for the iPhone X notch but all their examples had a search bar view on top so they

iPhone X status bar height

旧城冷巷雨未停 提交于 2019-12-05 15:57:14
问题 I have developed an app without autoLayout or interface-builder , all by code. It runs ok in all iPhones except iPhone X where the top bar stays under the new black thing in the middle. It's possible to get that height by code, so I can shift my Navigationbar that height down and all runs normal ? The solutions I see, they use auto layout. I just want the get the distance to shift it down.. 回答1: In my Swift app, I get the frame of the status bar with Swift: UIApplication.shared.statusBarFrame

iPhone X - Set the color of the area around home indicator

十年热恋 提交于 2019-12-05 15:25:15
I'm pretty much new to Xcode when trying to align a sheet to the safe area of iPhone X, it leaves a transparent area below the sheet. Is there a way to set the fill of that area w/o expanding the sheet or align outside of the safe area? Here is my tiny extension. If anybody can suggest an improvement to not access added view by "magic number" tag - welcome! extension UIViewController { private static let insetBackgroundViewTag = 98721 //Cool number func paintSafeAreaBottomInset(withColor color: UIColor) { guard #available(iOS 11.0, *) else { return } if let insetView = view.viewWithTag

Biometry Type when user denied biometry usage

…衆ロ難τιáo~ 提交于 2019-12-05 15:05:32
In our app, the user has to register to the device biometry in order to use it for authentication. The registration text and legal notes are according to the relevant biometry (register to touch ID or register to face ID) As far as I found, the biometry type is obtainable via the LAContext, but if the user denies usage of biometry, then the context returns biometryType=.none Any ideas other that asking for the screen size and comparing to iphone X (bad bad code)? static fileprivate var biometryType: DSLocalAuthenticationBiometryType { let context = LAContext() var error: NSError? let _ =

How to set bottom safe area to XIB in iOS?

蹲街弑〆低调 提交于 2019-12-05 12:24:44
I want to open custom popup view(designed in XIB) which is displaying from bottom but rightnow in iPhoneX simulator, it displayed from bottom of the screen. i want to open popup in safe area. Result in iPhone-X And XIB Layout with constraints. Solution in simple words: Remove bottom constraint with superview and attach it (bottom constraint) with bottom (anchor) layout constraint of 'Safe Area' Follow these steps to find solution: Enable 'Safe Area Layout', if not enabled. Remove 'Bottom constraint' if it shows you connection with with Super view and re-attach with safe layout bottom anchor.