Skip to content

Commit 65e7e57

Browse files
committed
Fix protocol method signatures to avoid using UIKit IndexPath extension member, row.
1 parent 2ab422e commit 65e7e57

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Common/ExchangeDataStore.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,37 +98,37 @@ public class ExchangeDataStore<T: TickerType, U: BalanceType> {
9898

9999
extension ExchangeDataStore: TickerTableViewDataSource {
100100

101-
private func ticker(for section: Int, for row: Int, for viewType: TickerViewType) -> T? {
101+
private func ticker(section: Int, row: Int, viewType: TickerViewType) -> T? {
102102
switch viewType {
103103
case .quantity: return tickerByQuantityCCY[section][row]
104104
case .price: return tickerByPriceCCY[section][row]
105105
default: return nil
106106
}
107107
}
108108

109-
public func sectionCount(for viewType: TickerViewType) -> Int {
109+
public func sectionCount(viewType: TickerViewType) -> Int {
110110
switch viewType {
111111
case .quantity: return tickerByQuantityCCY.count
112112
case .price: return tickerByPriceCCY.count
113113
default: return 0
114114
}
115115
}
116-
public func rowCount(for section: Int, for viewType: TickerViewType) -> Int {
116+
public func rowCount(section: Int, viewType: TickerViewType) -> Int {
117117
switch viewType {
118118
case .quantity: return tickerByQuantityCCY[section].count
119119
case .price: return tickerByPriceCCY[section].count
120120
default: return 0
121121
}
122122
}
123-
public func sectionHeaderTitle(for section: Int, for viewType: TickerViewType) -> String? {
123+
public func sectionHeaderTitle(section: Int, viewType: TickerViewType) -> String? {
124124
switch viewType {
125125
case .quantity: return tickerByQuantityCCY[section][0].symbol.quantity.name
126126
case .price: return tickerByPriceCCY[section][0].symbol.price.name
127127
default: return nil
128128
}
129129
}
130-
public func displayableTicker(forindexPath: IndexPath, for viewType: TickerViewType) -> DisplayableTickerType? {
131-
guard let t = ticker(for: forindexPath.section, for: forindexPath.row, for: viewType) else { return nil }
130+
public func displayableTicker(section: Int, row: Int, viewType: TickerViewType) -> DisplayableTickerType? {
131+
guard let t = ticker(section: section, row: row, viewType: viewType) else { return nil }
132132
let displayable = DisplayableTicker(name: t.symbol.quantity.name, price: displayablePrice(ticker: t), priceInUSD: t.formattedPriceInUSD)
133133
return displayable
134134
}

Common/Ticker.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public struct DisplayableTicker: DisplayableTickerType {
6464
}
6565

6666
public protocol TickerTableViewDataSource {
67-
func sectionCount(for viewType: TickerViewType) -> Int
68-
func rowCount(for section: Int, for viewType: TickerViewType) -> Int
69-
func sectionHeaderTitle(for section: Int, for viewType: TickerViewType) -> String?
70-
func displayableTicker(forindexPath: IndexPath, for viewType: TickerViewType) -> DisplayableTickerType?
67+
func sectionCount(viewType: TickerViewType) -> Int
68+
func rowCount(section: Int, viewType: TickerViewType) -> Int
69+
func sectionHeaderTitle(section: Int, viewType: TickerViewType) -> String?
70+
func displayableTicker(section: Int, row: Int, viewType: TickerViewType) -> DisplayableTickerType?
7171
}

0 commit comments

Comments
 (0)