Load app icon from xcassets

前端 未结 3 1360
暖寄归人
暖寄归人 2021-02-02 11:11

I\'d like to display the app icon inside my app. The icon is in the default assets catalog (Images.xcassets).

How do you load it? I tried the following and

3条回答
  •  心在旅途
    2021-02-02 11:59

    By inspecting the bundle I found that the icon images were renamed as:

    AppIcon76x76~ipad.png
    AppIcon76x76@2x~ipad.png
    AppIcon60x60@2x.png
    

    And so on.

    Thus, using [UIImage imageNamed:@"AppIcon76x76"] or similar works.

    Is this documented somewhere?

提交回复
热议问题