[Solved] how to change the wallpaper using OC or Swift on mac [closed]


You gan get all the screens from this code:

let screens = NSScreen.screens

And set wallpaper By This code

let newWallpaperURL = URL(/* ... */)
for i in screens {
 try! NSWorkspace.shared().setDesktopImageURL(newWallpaperURL, for: i, options: [:])
}

solved how to change the wallpaper using OC or Swift on mac [closed]