Hi,
I'm creating a small app for a file download website that I run.
I currently have a UI where the user can choose, from a dropdown, a file that we have hosted, and then a download button appears. When they click Download, I want them to be presented with an NSSavePanel to choose a directory for the file - before the file starts to download.
I've tried:
from a Hacking With Swift tutorial but I think that's more for iOS.
When running that code, I can see the network usage of the app in Xcode go up - so it's working - but it starts straight away and there is no destination selection option.
Basically, I need a way to add a save dialog box to that snippet above.
If anyone can help I'd be hugely grateful. Thanks so much in advance!
I'm creating a small app for a file download website that I run.
I currently have a UI where the user can choose, from a dropdown, a file that we have hosted, and then a download button appears. When they click Download, I want them to be presented with an NSSavePanel to choose a directory for the file - before the file starts to download.
I've tried:
Code Block Swift let url = URL(string: "https://www.apple.com")! let task = URLSession.shared.downloadTask(with: url) { localURL, urlResponse, error in if let localURL = localURL { if let string = try? String(contentsOf: localURL) { print(string) } } } task.resume()
from a Hacking With Swift tutorial but I think that's more for iOS.
When running that code, I can see the network usage of the app in Xcode go up - so it's working - but it starts straight away and there is no destination selection option.
Basically, I need a way to add a save dialog box to that snippet above.
If anyone can help I'd be hugely grateful. Thanks so much in advance!