-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ Rank Model & API 구현 * ❇️ Rank API & Model 변경 * ✨ RankerTableViewCell Configuration 구현 * ✨ Cheering Map Rank API 바인딩 로직 구현 * 🐛 TableView Bind 로직 버그 수정 * 🐛 스크롤 화면 업데이트 버그 수정
- Loading branch information
Showing
16 changed files
with
298 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Revision.swift | ||
// Dear-World | ||
// | ||
// Created by dongyoung.lee on 2020/12/31. | ||
// | ||
|
||
import Foundation | ||
|
||
@propertyWrapper | ||
struct Revision<T>: Equatable { | ||
var projectedValue: UInt = 0 | ||
var wrappedValue: T { | ||
didSet { projectedValue += 1 } | ||
} | ||
} | ||
extension Revision { | ||
static func == (lhs: Revision<T>, rhs: Revision<T>) -> Bool { | ||
let r1 = lhs.projectedValue == rhs.projectedValue | ||
return r1 | ||
} | ||
} | ||
extension Revision where T: Equatable { | ||
static func == (lhs: Revision<T>, rhs: Revision<T>) -> Bool { | ||
let r1 = lhs.projectedValue == rhs.projectedValue | ||
let r2 = lhs.wrappedValue == rhs.wrappedValue | ||
return r1 && r2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,6 @@ | |
import Foundation | ||
|
||
enum Message { | ||
enum API {} | ||
enum Model {} | ||
enum API {} | ||
enum Model {} | ||
} |
18 changes: 18 additions & 0 deletions
18
Dear-World/Dear-World/Source/Domain/World/API/World.API.Rank.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// World.API.Rank.swift | ||
// Dear-World | ||
// | ||
// Created by dongyoung.lee on 2020/12/29. | ||
// | ||
|
||
import Alamofire | ||
import Foundation | ||
|
||
extension World.API { | ||
struct Rank: ServiceAPI { | ||
typealias Response = World.Model.Rank | ||
|
||
var method: HTTPMethod { .get } | ||
var path: String { "api/v1/countries/rank" } | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
Dear-World/Dear-World/Source/Domain/World/Model/World.Model.Country.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// World.Model.Country.swift | ||
// Dear-World | ||
// | ||
// Created by dongyoung.lee on 2020/12/29. | ||
// | ||
|
||
import Foundation | ||
|
||
extension World.Model { | ||
struct Country: Decodable { | ||
let id: Int | ||
let code: String | ||
let name: String | ||
let emoji: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case id | ||
case code | ||
case name = "fullName" | ||
case emoji = "emojiUnicode" | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Dear-World/Dear-World/Source/Domain/World/Model/World.Model.Rank.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// World.Model.Rank.swift | ||
// Dear-World | ||
// | ||
// Created by dongyoung.lee on 2020/12/29. | ||
// | ||
|
||
import Foundation | ||
|
||
extension World.Model { | ||
struct Rank: Decodable { | ||
let ranking: [Ranker] | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
Dear-World/Dear-World/Source/Domain/World/Model/World.Model.Ranker.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// World.Model.Ranker.swift | ||
// Dear-World | ||
// | ||
// Created by dongyoung.lee on 2020/12/31. | ||
// | ||
|
||
import Foundation | ||
|
||
extension World.Model { | ||
struct Ranker: Decodable { | ||
let messageCount: Int | ||
let likeCount: Int | ||
let population: Int? | ||
let level: String | ||
let country: Country | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// World.swift | ||
// Dear-World | ||
// | ||
// Created by dongyoung.lee on 2020/12/29. | ||
// | ||
|
||
import Foundation | ||
|
||
enum World { | ||
enum API {} | ||
enum Model {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.