From c9cdef348dcca82f2d24a86e943ac05fdf1e15ce Mon Sep 17 00:00:00 2001 From: Jia Date: Fri, 13 Oct 2017 00:23:58 +0800 Subject: [PATCH] Replace Decodable to Himotoki.Decodable --- Pagination/GitHubRequest.swift | 2 +- Pagination/PaginationResponse.swift | 2 +- Pagination/PaginationResponseType.swift | 4 ++-- Pagination/PaginationViewModel.swift | 2 +- Pagination/Repository.swift | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Pagination/GitHubRequest.swift b/Pagination/GitHubRequest.swift index ee0bdb4..236722b 100644 --- a/Pagination/GitHubRequest.swift +++ b/Pagination/GitHubRequest.swift @@ -13,7 +13,7 @@ extension GitHubRequest { } } -extension GitHubRequest where Response: Decodable { +extension GitHubRequest where Response: Himotoki.Decodable { func response(from object: Any, urlResponse: HTTPURLResponse) throws -> Response { return try decodeValue(object) } diff --git a/Pagination/PaginationResponse.swift b/Pagination/PaginationResponse.swift index 8e56a64..9b1aa02 100644 --- a/Pagination/PaginationResponse.swift +++ b/Pagination/PaginationResponse.swift @@ -1,7 +1,7 @@ import Foundation import Himotoki -struct SearchResponse: PaginationResponse { +struct SearchResponse: PaginationResponse { let elements: [Element] let page: Int let nextPage: Int? diff --git a/Pagination/PaginationResponseType.swift b/Pagination/PaginationResponseType.swift index 60fa816..0e09465 100644 --- a/Pagination/PaginationResponseType.swift +++ b/Pagination/PaginationResponseType.swift @@ -2,14 +2,14 @@ import Foundation import Himotoki protocol PaginationResponse { - associatedtype Element: Decodable + associatedtype Element: Himotoki.Decodable var elements: [Element] { get } var page: Int { get } var nextPage: Int? { get } init(elements: [Element], page: Int, nextPage: Int?) } -struct AnyPaginationResponse: PaginationResponse { +struct AnyPaginationResponse: PaginationResponse { let elements: [Element] let page: Int let nextPage: Int? diff --git a/Pagination/PaginationViewModel.swift b/Pagination/PaginationViewModel.swift index ae3d3c6..06f8050 100644 --- a/Pagination/PaginationViewModel.swift +++ b/Pagination/PaginationViewModel.swift @@ -5,7 +5,7 @@ import APIKit import Action import Himotoki -class PaginationViewModel { +class PaginationViewModel { let indicatorViewAnimating: Driver let elements: Driver<[Element]> let loadError: Driver diff --git a/Pagination/Repository.swift b/Pagination/Repository.swift index ae91c8a..475c02a 100644 --- a/Pagination/Repository.swift +++ b/Pagination/Repository.swift @@ -1,7 +1,7 @@ import Foundation import Himotoki -struct Repository: Decodable { +struct Repository: Himotoki.Decodable { let id: Int let fullName: String let stargazersCount: Int