2015-10-13 104 views
6

我设置了一些3D触控功能,并想使用已经从网上下载的图像作为音频封面图片(可以通过SDWebImage的高速缓存访​​问)在UIApplicationShortcutItem,就像苹果公司的音乐应用程序(见截图)。UIApplicationShortcutItem - 我能否使用网络作为UIApplicationShortcutIcon下载的图像?

Apple Music screenshot

这可能吗?它看起来并不像我不能把图像中的应用程序的包,据我所知?我猜苹果正在做一些开发者无法做到的事情?

UIApplicationShortcutItem的文档只有具备以下条件:

// Create an icon using a system-defined image. 
+ (instancetype)iconWithType:(UIApplicationShortcutIconType)type; 

// Create an icon from a custom image. 
// The provided image named will be loaded from the app's bundle 
// and will be masked to conform to the system-defined icon style. 
+ (instancetype)iconWithTemplateImageName:(NSString *)templateImageName; 

回答

3

你是正确的。它是目前不可能(至少与公众API)的第三方应用程序来使用非模板图像,也不是可以下载的图像,并把它作为UIApplicationShortcutIcon。如果你想看看这些能力在未来的版本中添加,请考虑在bugreport.apple.com提交增强请求。