ios11

Glitchy animation of UIRefreschControl with large titles for navigation bar

自作多情 提交于 2019-12-05 20:35:39
问题 I have a controller embedded in a navigation controller with Large Titles and a UIRefreshControl. When I pull-to-refresh on my tableView, the animation of the activity indicator is very glitchy. I don't know if I have a bad behaviour in my code ? tableView.refreshControl = UIRefreshControl() tableView.refreshControl?.addTarget(self, action: #selector(downloadData), for: .valueChanged) 回答1: If your have set your navigation bar translucency appearance to false, then you need to include the

ARKit - place a SCNPlane between 2 vector points on a plane in Swift 3 [duplicate]

人走茶凉 提交于 2019-12-05 20:15:33
This question already has an answer here: Scenekit shape between 4 points 1 answer Similar to some of the measuring apps you can see being demonstrated in ARKit, I have a plane with 2 marker nodes on it and a line drawn between the 2. What I need though is an SCNPlane between the 2. So, if your original was the floor and you put a marker either side of a wall, you could represent the physical wall with a SCNPlane in your AR world. Currently I'm placing the line with the following code: let line = SCNGeometry.lineFrom(vector: firstPoint.position, toVector: secondPoint.position) let lineNode =

CoreNFC debug not working

蹲街弑〆低调 提交于 2019-12-05 17:39:07
How programmatically work CoreNFC on xcode-9 func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) { //What I need to do here } func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) { //What I need to do here } override func viewDidLoad() { super.viewDidLoad() let sessionReader = NFCNDEFReaderSession.init(delegate: self, queue: nil, invalidateAfterFirstRead: true) let nfcSession = NFCReaderSession.self let nfcTag = NFCTagCommandConfiguration.init() let tagType = NFCTagType(rawValue: 0) sessionReader.begin() } I want to

Request NSPhotoLibraryAddUsageDescription permission

偶尔善良 提交于 2019-12-05 16:37:57
I'm trying to save image to Photos app on iOS 10 and 11 versions. Therefore on iOS 11 I need to request NSPhotoLibraryAddUsageDescription permission, on iOS 10 NSPhotoLibraryUsageDescription . As Apple documentation claims , [PHPhotoLibrary requestAuthorization:] obtains permission only for NSPhotoLibraryUsageDescription key. If you have both keys in Info.plist file and select "Add photos only" to Photos permissions in your app, [PHPhotoLibrary authorizationStatus] returns PHAuthorizationStatusDenied . Does anybody know how to deal with these permissions? 来源: https://stackoverflow.com

how to prevent screen record in ios11

送分小仙女□ 提交于 2019-12-05 16:03:46
To some reasons, our APP dont't want people record screen, but in ios11 a new feature can let user record there iphone screen, so is there an API or notification indicate me user is recording now thank u very much You can detect if the screen is being recorded with: UIScreen.main.isCaptured // True if this screen is being captured (e.g. recorded, AirPlayed, mirrored, etc.) You can't prevent it using project settings, but you could use a modal or something to request the user to disable it. Not sure how that might workout with your AppStore submission. 李国立 You can use kvo observe

Prompt when trying to dial a phone number using tel:// scheme on iOS 11

自闭症网瘾萝莉.ら 提交于 2019-12-05 13:55:04
I am facing an issue, while trying to start a phone call from my iOS app using: UIApplication open(_:options: completionHandler:) iOS shows an confirmation popup/alert before starting the call with two button Call & Cancel and CompletionHandler called with a Bool parameter having true/false based on button action in iOS 10. But now in iOS11 the problem is that the completionHandler is being called automatically before tapping on "Cancel" or "Call" button of confirmation popup, always having true value. Is this a bug in iOS11 or is there something that I am doing wrong? There has been a

Google Admob live ads not showing in iOS 11 on real device

自作多情 提交于 2019-12-05 13:12:07
I have searched and found posts online and on StackOverflow which have the same or similar error message as me, but none of them are having the same bug as me. They have different conditions i.e. the error message appears in different situations or they are on a different version of iOS etc. I’ve tried all the solutions i’ve found online. Basically I am using Admob to show banner ads and interstitial ads in my iOS app. These have been running in the live app for over a year, they are still currently running live in iOS 10 devices and earlier versions of iOS, without any problems . But when iOS

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.

How do i handle HTTP load failed (error code: -1009 [1:50]) in swift 4?

て烟熏妆下的殇ゞ 提交于 2019-12-05 11:55:41
I created on app using swift 4 and Xcode 9. when I login into my app I send a request and successful login on result which come from json. But when I switch my internet of my phone it crashed and give me this error HTTP load failed (error code: -1009 [1:50]) So how do I handle this error and give popup or any warning to user to check your internet connection without app crashing. Swift 4, Xcode 10.1 You can access to the error code: class ViewController1: UIViewController, URLSessionDataDelegate { ... func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error:

Get the height of keyboard doesn't work on IOS 11 beta

社会主义新天地 提交于 2019-12-05 11:12:32
问题 I have the following code which worked on IOS 10, but now it doesn't work anymore when running on IOS 11 beta. if let userInfo = notification.userInfo { if let keyboardSize = (userInfo[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue { print(keyboardSize) } } This is what I get when I print the size: (0.0, 0.0, 0.0, 0.0) (0.0, 736.0, 414.0, 0.0) Anyone knows why this has stopped working ? Or if I have any other alternatives to get the keyboard size ? 回答1: Use