csexton / captured-mac

Captured
http://www.capturedapp.com
MIT License
5 stars 1 forks source link

Fix deprecation warning for `sendSynchronousRequest` #45

Closed csexton closed 8 years ago

csexton commented 8 years ago

I was getting a warning when building. And I really hate warnings.

⚠️ Warning:'sendSynchronousRequest(_:returningResponse:)' was deprecated: Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession)

Moved AWS S3 API requests to use NSURLSession#dataTaskWithRequest. And had to do some semaphore gymnastics to make the requests synchronous. I know what you are gonna say, don't make no requests synchronous because that's bad. Well, I wanna manage my own threads, dammit. So I am using semaphores to make it synchronous up in here.