I want to create shortcut of my application on desktop programatically and also add it to the docbar. At present i am doing it using bristow and emmet executables using shell script. I want to know is there any API in any of the frameworks that helps me to do using swift
Did you read this and follow the links ?
There’s no good way to programmatically manipulate items in the Dock. This isn’t an accident. Apple consider the Dock setup to be something that the user controls, and apps shouldn’t be messing with it.
You’ll find lots of folks who ignore this advice and use various unsupported techniques to modify the Dock setup. You are, of course, free to do the same, but I’d caution you against that. To start, it’s unsupported and might break in weird ways in the future. Beyond that, it’ll make users grumpy. If the user has gone to the trouble of installing your app, they won’t have a problem finding it in the Applications directory, and they are also quite capable of adding your app to their Dock. Doing it for them isn’t a big win for most users, and it’s a big lose for some fraction of users, like myself, who will hate you forever if you monkey with our Dock (-:
Similar logic applies to the Desktop folder, and to the various recent items lists.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"