Code=3072 “The operation was cancelled” when setting alternate app icon

后端 未结 2 1253
轮回少年
轮回少年 2021-02-20 16:44

I am trying to set an alternate app icon named MyIcon in my iOS app. I have a MyIcon.png image in my project bundle (not in my Assets folder) and it is

2条回答
  •  旧巷少年郎
    2021-02-20 17:34

    I was stuck with this error for quite a while and tried all sorts of things but couldn't work out what I was doing wrong. I was changing the icon from AppDelegate.application(didFinishLaunchingWithOptions:). Delaying the call with a timer as suggested above did solve it.

    It is worth noting that this problem is due to UIKit trying to show a UIAlertController with the message

    You have changed the icon for $(PRODUCT_NAME)

    and that didn't seem to work at that point. You need to wait until a root view controller is loaded.

    This is because this API is not meant to for the developer to update the icon arbitrarily, but for the user to deliverability choose one.

提交回复
热议问题