ios 更换app图标

107 阅读1分钟

 在Assets中添加新的AppIcon(可以多套)

Build Setting中将

设置为YES;

最后代码:

if UIApplication.shared.supportsAlternateIcons{

UIApplication.shared.setAlternateIconName("AppIcon1") { (error) in

if let error = error {

print("设置AppIcon失败:\(error.localizedDescription)")

} else {

print("成功设置AppIcon")

}

}

}