22

With iOS 13 just out I was testing my app in Xcode 11 GM2, it uses the dictionary you can enable on the iPhone to do a word lookup. The performance on iOS12 has been spot on, it is virtually instantaneous.

However, this seems to have changed with iOS 13. The code below, which is fairly standard, takes 3 seconds to respond!!! This happens on both iOS13 simulators and real devices with iOS13.

I have not seen anything this having been reported as an issue with iOS13 SDK or Xcode 11.

Could this be a bug that needs reporting? Or am I doing something wrong.

It's making my app look unresponsive. How do I deal with this?

This is easy to reproduce and the same code with an iOS 12.x simulator works normally.

My code is below:

import UIKit

//I'm using storyboard with 1 button.

class ViewController: UIViewController {

    @IBOutlet weak var buttonTestUIRefVC: UIButton!

    @IBAction func testUIRefVCTapped(_ sender: UIButton) {

        if UIReferenceLibraryViewController.dictionaryHasDefinition(forTerm: "test") {
            let referenceVC = UIReferenceLibraryViewController(term: "test")
            present(referenceVC, animated: true)
        }
    }
}

From the code above, the bit UIReferenceLibraryViewController.dictionaryHasDefinition(forTerm: "test") is what introduces the 3 second delay.

Here is a PORTION of the debug log, I have not seen those "Old state: 1 new state:1" statements before, they only show up in iOS 13. What do they mean?

2019-09-20 09:38:09.175923+0100 DictionaryServicesTest[18527:3511667] Creating client/daemon connection: C94E0479-7F79-4E22-895D-7F1FEFB75C8E
2019-09-20 09:38:09.201599+0100 DictionaryServicesTest[18527:3511667] Got the query meta data reply for: com.apple.MobileAsset.DictionaryServices.dictionary2, response: 0
2019-09-20 09:38:09.218045+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.226942+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.235839+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.244599+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.253388+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.262388+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.271329+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.280346+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.289581+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.298508+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.307121+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.339668+0100 DictionaryServicesTest[18527:3511667] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-09-20 09:38:09.339682+0100 DictionaryServicesTest[18527:3511797] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-09-20 09:38:09.339880+0100 DictionaryServicesTest[18527:3511797] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-09-20 09:38:09.352755+0100 DictionaryServicesTest[18527:3511667] Old state: 2 new state:2
2019-09-20 09:38:09.353305+0100 DictionaryServicesTest[18527:3511667] Consumed extension
2019-09-20 09:38:09.364478+0100 DictionaryServicesTest[18527:3511667] Old state: 2 new state:2
2019-09-20 09:38:09.373088+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.382055+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:09.391300+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1

......


2019-09-20 09:38:10.298739+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:10.308036+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:10.331372+0100 DictionaryServicesTest[18527:3511667] Got the query meta data reply for: com.apple.MobileAsset.DictionaryServices.dictionary2, response: 0
2019-09-20 09:38:10.347474+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:10.356643+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1

.....

2019-09-20 09:38:11.357946+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:11.367701+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:11.377362+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:11.387062+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:11.396676+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:11.406346+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:11.433850+0100 DictionaryServicesTest[18527:3511667] Got the query meta data reply for: com.apple.MobileAsset.DictionaryServices.dictionary2, response: 0
2019-09-20 09:38:11.450337+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:11.459251+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1



....


2019-09-20 09:38:12.490703+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:12.500646+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
2019-09-20 09:38:12.510725+0100 DictionaryServicesTest[18527:3511667] Old state: 1 new state:1
Cœur
  • 37,241
  • 25
  • 195
  • 267
David K
  • 221
  • 1
  • 6
  • 5
    Confirmed this problem still existed in Xcode 11.2.1. Even on device, it's still incredibly slow. – Legolas Wang Nov 15 '19 at 04:01
  • Confirmed.. seeing same problem with Xcode Version 11.3 (11C29) and on iOS 13.3. – Pankaj Kulkarni Jan 07 '20 at 18:47
  • Still experiencing this on Xcode 11.3.1. Anyone know anything? – Miles Alden Feb 09 '20 at 02:01
  • 1
    I'm seeing a significant delay even without the check for the word being in the dictionary. Opening the built-in dictionary by selecting a word in a text view, e.g. Safari, is more or less instant. I wonder if there could be a workaround that leverages this. Is it possible to simulate a tap on the "Look Up" button in the little menu that shows up when text is selected..? – pbouf77 Feb 13 '20 at 19:48
  • Just filed "feedback" (is that the same as a "radar"?) with Apple. I don't think it's public but for the record it's FB7601358. – pbouf77 Feb 26 '20 at 16:04
  • Bug still exists in iOS 15.4, checking `UIReferenceLibraryViewController.dictionaryHasDefinition(forTerm:word)` takes hundreds of milliseconds – Lou Zell May 29 '22 at 01:20

1 Answers1

1

Trying to Update to the iPadOS 14.0, I find that this problem is gone.

Shawn 736
  • 39
  • 4