Ezra
Ezra

Reputation: 670

About URL encoding on macOS 10.11

The CFURLCreateStringByAddingPercentEscapes function was deprecated after 10.11, but String.addingPercentEncoding(withAllowedCharacters:) only available after 10.12.

So, what should I use on macOS 10.11 without warnings?

Upvotes: 0

Views: 69

Answers (1)

Brendan Shanks
Brendan Shanks

Reputation: 3236

NSString stringByAddingPercentEncodingWithAllowedCharacters: has been present since OS X 10.9. Maybe it's only had that name in Swift since 10.12, and it was available under a different name in 10.9?

Upvotes: 1

Related Questions