【问题标题】:How to display error word at progressed Broadcast Upload Extension(iOS, replaykit)如何在进行中的广播上传扩展(iOS,replaykit)中显示错误字
【发布时间】:2018-03-13 14:13:49
【问题描述】:

我遇到了一个小问题。

我使用 replaykit 练习了广播上传扩展,

我想在发生异常时显示错误代码。

但我没有办法。

你会教我一个方法吗?

我讨厌 (null) 并想替换其他单词。

【问题讨论】:

  • 我打赌这里应该显示一些代码......

标签: ios swift replaykit


【解决方案1】:

使用finishBroadcastWithError,NSError必须用'NSLocalizedFailureReasonErrorKey'来描述。

【讨论】:

    【解决方案2】:

    您可以通过此协议处理此问题

    finishBroadcastWithError()

    在 RPBroadcast 处理程序中

    更多信息请参考apple Doc

    示例:

    let userInfo = [NSLocalizedFailureReasonErrorKey: "You have Stopped Screen Sharing"]
            finishBroadcastWithError(NSError(domain: "ScreenShare", code: -1, userInfo: userInfo))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-31
      • 1970-01-01
      • 1970-01-01
      • 2021-12-22
      • 2016-12-17
      • 2019-08-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多