CKError localizedDescription

后端 未结 2 1814
醉话见心
醉话见心 2021-01-18 05:50

Aim

  • I would like to display the CKError encountered to the user in the app as an alert.
  • So I would like to extract the string from the
2条回答
  •  被撕碎了的回忆
    2021-01-18 06:26

    Looks like there is another error in the errorUserInfo[NSUnderlyingError]. Try getting the localizedDescription from that error.

    So, that would be:

    ((error as? CKError)?.errorUserInfo[NSUnderlyingErrorKey] as? NSError)?.localizedDescription
    

提交回复
热议问题