mutating func loadFresh(completion: (result: APIResult<DeserializedType>) -> ()) -> CancellableToken {
self.currentPage =
// self.isNoMoreData = false return self.doRequest() { result in
if case .Success(let entities) = result {
if entities.isEmpty {
// self.isNoMoreData = true
} else {
self.currentPage +=
}
} completion(result: result)
}
}
mutating func loadMore(completion: (result: APIResult<DeserializedType>) -> ()) -> CancellableToken { // self.isNoMoreData = false return self.doRequest() { result in
if case .Success(let entities) = result {
if entities.isEmpty {
// self.isNoMoreData = true
} else {
self.currentPage +=
}
} completion(result: result)
}
}
https://www.github.com/MengTo/DesignerNewsApp/