Back in 2013, I gave a presentation at NSLondon, touching on some slightly hidden goodies in iOS 7. In 2014, in an attempt to set a bit of a tradition, it was time to present on the same theme, this time for iOS 8. The NSLondon crew are kind enough to record many of the videos, and so if you wish, you may witness my ugly mug spreading the gospel of iOS 8 below:
A few important followup notes:
I got confused (sorry!). Query components are percent en/decoded for you after all.
The big caveat here is if you have a URL scheme where + is used to represent a space (rather than the formal %20 sequence). NSURLQueryItem will be unable to fully handle your setup out of the box: it will leave any + characters unchanged since they’re perfectly legal, and will also decode instances of %2B to be a + symbol. Your code will then be unable to distinguish between the two.
To work around this, my best suggestion right now is to pre-process such URLs to convert + symbols to %20 so NSURLQueryItem can do the right thing from now. Oh, and make sure to test your code throughly. That one’s always a good suggestion ;-)
I meant to point out that the WWDC video on this is much more informative than I could hope to be in a few minutes. Go check it out!
Just thought I’d note we’re using this in The Hit List for attaching information to bug reports. Works a treat.
After a bit of reflection, the NSFormattingContextDynamic option is actually dead handy. If your app is localised, the location of dates within their format strings might well change, dependent on language. And so it’s very useful if Apple can handle that automatically for you.