ios11

Xcode9 code coverage is not displayed

半世苍凉 提交于 2019-12-20 10:24:41
问题 I have been trying to get the code coverage for my project using Xcode 9 . All test case run successfully but did not generate the code coverage report under Code coverage tab. I tried following things: Enable the Gather code coverage in scheme. Enable Code Coverage Support for my target. Enable the Show case bundle option. Is there extra setting require to check code coverage report ? or should I missed something ? Thanks in advance. 回答1: Issue Resolve in Version 9.3, to get the code

iOS 11: ATS (App Transport Security) no longer accepts custom anchor certs?

前提是你 提交于 2019-12-20 08:28:35
问题 I am leasing a self signed certificate using NSMutableURLRequest and when the certificate is anchored using a custom certificate with SecTrustSetAnchorCertificates IOS 11 fails with the following error message: refreshPreferences: HangTracerEnabled: 1 refreshPreferences: HangTracerDuration: 500 refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0 ATS failed system trust System Trust failed for [1:0x1c417dc40] TIC SSL Trust Error [1:0x1c417dc40]: 3:0 NSURLSession

Cropped characters - iOS11 - Alert Dialog

↘锁芯ラ 提交于 2019-12-19 11:58:07
问题 Cropped characters - iOS11 - Alert Dialog. How to fix it? [ func settingsButtonPressed() { let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) let closeAction = UIAlertAction(title: "Anuluj", style: .cancel) { (action) in //do nothing } alert.addAction(closeAction) let restorePurchases = UIAlertAction(title: "Przywróć zakupy", style: .default) { (action) in self.restorePurchases() } alert.addAction(restorePurchases) let refreshCatalogs = UIAlertAction(title:

iOS11 photo library access is possible even if settings are set to “never”

流过昼夜 提交于 2019-12-19 11:26:42
问题 if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) { let imagePicker = UIImagePickerController() imagePicker.sourceType = .photoLibrary imagePicker.allowsEditing = true self.present(imagePicker, animated: true, completion: { }) } Even if I set access to Photos in Settings to "Never" with above code I can still present image picker and show photos. I'll check for PHPhotoLibrary.authorizationStatus() before showing it, but I would like to know is this expected behaviour? 回答1: Okay,

iOS11 UISearchBar missing in UINavigationBar when embedded in UISplitViewController

喜你入骨 提交于 2019-12-19 10:57:33
问题 Strange things seem to happen when using the new iOS 11 navigationItem.searchController method on a detail view of a UISplitViewController . The searchBar partly appears as a blank space on the first presentation, then appears in the wrong UITableViewController , but corrects itself after a few push and pops of UITableViewController . I used to put the searchBar in the tableHeaderView , but I changed the code according to the WWDC recommendation: if (@available(iOS 11.0, *)) { self

Replay kit Not working IPAD IOS11 BUG

泪湿孤枕 提交于 2019-12-19 10:16:24
问题 I am using following code to record screen. It is working fine for ios10 and ios9 @IBAction func btnRecordTapped(_ sender: UIButton) { if RPScreenRecorder.shared().isAvailable { if #available(iOS 10.0, *) { RPScreenRecorder.shared().startRecording(handler: { (error) in guard error == nil else { print("Record failed with error \(error!.localizedDescription)") return } DispatchQueue.main.async { sender.removeTarget(self, action: #selector(self.btnRecordTapped(_:)), for: .touchUpInside) sender

iOS11 UIBarButtonItem action not get called

会有一股神秘感。 提交于 2019-12-19 06:17:31
问题 I used Xcode9 Beta6 to build the project, the action was called correctly on iOS10 device, however it is not work on iOS11 device. In My project, there are some viewControllers have a UIToolBar on the top, and the toolBar contains some UIBarButtonItems. There is one this kind of viewController, whose UIBarButtonItem action is not called when I tap the UIBarButtonItem. I can see the tapping animation (the icon become dim first and back to normal after finger released) At the end of viewDidLoad

iOS 11 - disable smart quotes

别来无恙 提交于 2019-12-19 05:11:05
问题 iOS 11 adds smart quotes when typing. In macOS we can disable smart quotes on a NSTextView by setting: textView.automaticQuoteSubstitutionEnabled = NO; Neither UITextField or UITextView seem to have this property or the enabledTextCheckingTypes property. How can smart quotes be disabled on iOS 11? 回答1: Smart quotes and other features such as smart dashes are controlled via the UITextInputTraits Protocol which is adopted by both UITextField and UITextView . Specifically, the smartQuotesType

NSLocale returning wrong value in iOS 11

爱⌒轻易说出口 提交于 2019-12-19 03:24:19
问题 Starting from iOS 11.0, the following code returns "de_US" instead of "en_US" : // => Returns "de_US" NSString *regionCode = [[NSLocale currentLocale] objectForKey:NSLocaleIdentifier]; NSLog(@"Region code: %@", regionCode); Below iOS 11, it returns "en_US". My device has for language and region English / United States. Preferred languages (despite I do not use them in my code) are in order: English Deutsch French Is it a known issue of iOS 11? Has the API changed? 回答1: Found it! It's a change

How to change background color of the text field in the UISearchController?

冷暖自知 提交于 2019-12-19 03:08:21
问题 How to change the default grey background at UISearchController search text field? 回答1: Here is a an example on how to set the textField background. class ViewController: UIViewController { let searchController = UISearchController(searchResultsController: nil) private lazy var searchTextField: UITextField? = { [unowned self] in var textField: UITextField? self.searchController.searchBar.subviews.forEach({ view in view.subviews.forEach({ view in if let view = view as? UITextField { textField