A Swift API framework for ZhiHu's Daily News.
Sad, you cannot support both of them together somehow.
NB Not a single change related to Quick and Nimble. Big fat claps :clap::clap::clap: for the Quick team for creating such an un-breaking API!
Fix Int
subscript for TimelineCollection
to play nice with TabliView.
Basically it means the nth item in a TimelineCollection
should be the nth item going backward from the end of the collection, i.e. timeline[n] == timeline[timeline.endIndex - 1 - n]
.
This plays well with how UITableView
orders the sections in itself.
-- Top --
-- Section 0 -- ... -- timeline[endIndex - 1] --
-- Section 1 -- ... -- timeline[endIndex - 2] --
-- Section 2 -- ... -- timeline[endIndex - 3] --
.
.
.
Mainly added the DailyInMemoryStore
and TimelineCollection
for it.
And updated to Xcode 7.0 and Swift 2.0. YEAH!!!!1!
NSDate.daysAfter
557f070DailyInMemoryStore
TimelineCollection
to store dailies in DailyInMemoryStore
f1a6ef1TimelineCollection
TimelineCollection
and DateIndex
f5d24b7TimelineCollection
aa41da5DateIndex
defaults to init with today's date 09ed7d9DailyAPI
now take non-nil values only 6d174ebNSDate.daysBefore
to return earlier dates. 1bb1559DailyAPI.daily(forDate:)
6fcf6b4The 1
in YEAH!!!!1!
at the beginning is intended.
DailyAPI.newsExtra(newsId:)
1d967a2shortComments
, longComments
, comments
in DailyAPI
4ac599dComment
a5b3931completionHandlers
will be called on NSThread.mainThread()
e68a21etoNSDate
method to parse date
in Daily
4fe1796final
for better performance c528bcfDailyAPI
3019b49DailyNews
to Daily
596f48fdateFormat
into DailyConstants
bcdc817create
functions as private b41e459Extracted main body of the following methods into a generic function DailyAPI.request(URLRequest:, completionHandler:)
.
DailyAPI.latestDaily
DailyAPI.dailyNews
DailyAPI.news