无需越狱
,使用苹果的私有Api动态改变壁纸
和类似home键
(appStore可用)的小功能的例子,模拟器和真机可用,有用赏个小星星吧
- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks/PhotoLibrary 加入到 build phases -> link binary with libs(拖进去,不要add other)
- #import "UIImage+ZJWallPaper.h"
- 使用一个存在的image实例调用 "UIImage+ZJWallPaper.h" 的方法就行了
[wallPaperImage zj_saveAsHomeScreen];//设为主屏幕壁纸
[wallPaperImage zj_saveAsLockScreen];//设为锁屏壁纸
[wallPaperImage zj_saveAsHomeScreenAndLockScreen];//同时设置为锁屏和主屏幕壁纸