我可以在 Swift 5 和 IOS 12 中以编程方式更改 iOS 屏幕壁纸吗

Can I change iOS Screen wallpaper programmatically In Swift 5 and IOS 12

我想更换 iOS 12

的主屏幕和锁屏壁纸

简答:

In one word it is not possible. In Apple devices, There is no provision for the change iOS Screen wallpaper programmatically. The user has to do that manually through the settings or photos app. For things like changing wallpapers, you'd need to jailbreak your device.

长答案:

在 iOS 9.0 之前,有一些 hack 可以完美地工作。不幸的是,从 iOS > 9.0 开始,别无选择。

参考CMFWallpaper。或许对你有帮助。

Set the wallpaper (lock and/or home screen) on iOS using Apple's private API. Please be aware that including this code in an App Store submission will result in a rejection.