加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

无法在iOS 11中设置备用应用程序图标

发布时间:2020-12-14 19:18:52 所属栏目:百科 来源:网络整理
导读:我无法将应用程序的图标更改为iOS 11中的备用图标( Xcode 9,beta 3). 但是,它在iOS 10.3中运行良好(使用以下代码): if #available(iOS 10.3,*) { guard let iconName = MySingletonClass.sharedInstance.iconName() else { return } delay(0.01) { UIApplic
我无法将应用程序的图标更改为iOS 11中的备用图标( Xcode 9,beta 3).

但是,它在iOS 10.3中运行良好(使用以下代码):

if #available(iOS 10.3,*) {
        guard let iconName = MySingletonClass.sharedInstance.iconName() else { return }
        delay(0.01) {
            UIApplication.shared.setAlternateIconName(iconName,completionHandler: { (error) in
                if let error = error {
                    print(error.localizedDescription)
                } else {
                    print("Success!")
                }
            })
        }
    } else {
        // Fallback on earlier versions
    }

我的plist设置如下:

enter image description here

我发现它很奇怪,因为我在iOS 11中使用了其他使用备用应用程序图标的应用程序.在iOS 11中是否存在已知错误?

注意:如果你想知道我为什么要使用延迟,see this post

解决方法

我通过在ViewController中实现它来解决这个问题,而不是AppDelegate的appDidFinishLaunchingWithOptions

相关的问题/答案指出,仍然需要在延迟时间内运行它才能工作.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读