Closed cojoj closed 9 years ago
The old one [XCS] returns Array
of 6 Int
s but the new one has 7...
Confirmed 👌
7th field is a time is same as in String
version, so it's SSSZZZZ
.
In that case we can convert [Int]
to String
and pass it to the regular method from JSON.swift
. That way we'll save some memory as calendar calculations are expensive.
If that works (would probably warrant a test case for both Xcode 6 and 7) then :+1:
Good job reverse engineering it ;) That's how we do things here! On Thu, Jul 23, 2015 at 8:18 AM Mateusz Zając notifications@github.com wrote:
Confirmed 👌
7th field is a time is same as in String version, so it's SSSZZZZ.
In that case we can convert [Int] to String and pass it to the regular method from JSON.swift. That way we'll save some memory as calendar calculations are expensive.
— Reply to this email directly or view it on GitHub https://github.com/czechboy0/XcodeServerSDK/issues/78#issuecomment-124002978 .
@czechboy0 I can't find this anywhere in code so I'll simply ask. In some responses we're getting date but in form of array of components. Didiyou write a method or extension for handling this? I only found
dateForKey()
andoptionalDateForKey()
but they work withString
s.We need something to get this array by calling
arrayForKey()
and returnNSDateComponents
or date formattedString
.Got any hints how you want it to be implemented? Here are my ideas:
NSDate
extension
toNSArray
which will createNSDate
orNSDateComponents
orString
In any case we'll have to manually take fields from
Array
and put them inNSDateComponents
like:Which kind of sucks... What's more,
Array
of components we get from XCS has 7 fields and I wonder what is the 7th one... It doesn't look like a timezone... Nanoseconds?