You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On macOS 10.12 and iOS 10, Foundation has an NSISO8601DateFormatter class built in. It'd be cool if ISO8601DateFormatter wrapped that implementation when it's available, as an aid to clients who'd like to move toward that implementation.
Ingredients:
Don't delete the existing implementation—clients supporting older OS versions will still need it.
Ensure calls to ISO8601DateFormatter methods reach NSISO8601DateFormatter implementations when available. There are many ways you could achieve this: Return an NSISO8601DateFormatter from alloc; have a class cluster; return the result of the NSISO8601DateFormatter implementation at the start of each ISO8601DateFormatter implementation—up to you.
NSISO8601DateFormatter property and method names may differ from those in ISO8601DateFormatter. Add methods with NSISO8601DateFormatter's names to ISO8601DateFormatter that call either the method of the same name on an actual NSISO8601DateFormatter (if possible) or the equivalent method in the ISO8601DateFormatter.
The text was updated successfully, but these errors were encountered:
As a parser, NSISO8601DateFormatter is actually pretty different from boredzo/ISO8601DateFormatter. The NS one is basically just some ISO-8601-specific presets for their date parser. That is, I can take any valid ISO-8601 string and pass it to boredzo/ISO8601DateFormatter and get a Date object out of it. In order to pass an ISO-8601 string to NSISO8601DateFormatter, I have to first tell the parser exactly which variant of ISO-8601 to expect.
That's not workable for my program, so I'll be sticking with boredzo/ISO8601DateFormatter.
It may be feasible to replace the formatting half of ISO8601DateFormatter with the NS implementation.
On macOS 10.12 and iOS 10, Foundation has an NSISO8601DateFormatter class built in. It'd be cool if ISO8601DateFormatter wrapped that implementation when it's available, as an aid to clients who'd like to move toward that implementation.
Ingredients:
alloc
; have a class cluster; return the result of the NSISO8601DateFormatter implementation at the start of each ISO8601DateFormatter implementation—up to you.The text was updated successfully, but these errors were encountered: