Skip to content

Commit

Permalink
Merge pull request #33 from BE-SOPT-Collaboration-Seminar-Coinone/fea…
Browse files Browse the repository at this point in the history
…ture/#30

[Fix] 거래소 뷰 데이터 바인딩 오류 수정
  • Loading branch information
pcsoyeon authored Jun 3, 2021
2 parents e4c354c + 4ee92a5 commit fcb9443
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Coinone-iOS/Coinone-iOS/Source/Cells/StockTVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ extension StockTVC {
}

extension StockTVC {
func setData(coinLogoImageName: String, coinEnglishTitle: String, coinKoreanTitle: String, coinCurrentPrice: Float, riseOrDescent: String, percentage: Float, coinTotalPrice: Float) {
func setData(coinLogoImageName: String, coinEnglishTitle: String, coinKoreanTitle: String, coinCurrentPrice: Float, riseOrDescent: String, percentage: Double, coinTotalPrice: Float) {
let formatter = NumberFormatter().then {
$0.numberStyle = .decimal
}
Expand Down
7 changes: 4 additions & 3 deletions Coinone-iOS/Coinone-iOS/Source/Models/StockModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ struct StockModel {
var logoImage: String!
var title: String!
var subTitle: String!
var curValue: String!
var rate: String!
var transPrice: Int!
var curValue: Float!
var riseOrDescent: String
var rate: Double!
var transPrice: Float!
}
24 changes: 14 additions & 10 deletions Coinone-iOS/Coinone-iOS/Source/ViewControllers/GeoraesoVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class GeoraesoVC: UIViewController {

tableView.backgroundColor = .tableViewGray
tableView.tableFooterView = UIView(frame: .zero)
tableView.separatorStyle = .none

tableView.register(StockTVC.self, forCellReuseIdentifier: StockTVC.identifier)

Expand Down Expand Up @@ -305,23 +306,26 @@ class GeoraesoVC: UIViewController {
// MARK: - DummyData
func setDummyData() {
stockList.append(contentsOf: [
StockModel(logoImage: "",
StockModel(logoImage: "coinLogo",
title: "XRP",
subTitle: "리플",
curValue: "1,625",
rate: "-0.37%",
curValue: 1625,
riseOrDescent: "-",
rate: 0.37,
transPrice: 2059),
StockModel(logoImage: "",
StockModel(logoImage: "coinLogo",
title: "XRP",
subTitle: "리플",
curValue: "1,500",
rate: "-0.37%",
curValue: 1625,
riseOrDescent: "-",
rate: 0.37,
transPrice: 2489),
StockModel(logoImage: "",
StockModel(logoImage: "coinLogo",
title: "XRP",
subTitle: "리플",
curValue: "1,000",
rate: "-0.37%",
curValue: 1625,
riseOrDescent: "-",
rate: 0.37,
transPrice: 1280)])
}
}
Expand Down Expand Up @@ -446,7 +450,7 @@ extension GeoraesoVC: UITableViewDataSource {
cell.contentView.backgroundColor = .tableViewGray

let data = stockList[indexPath.row]
cell.setData(logoPath: data.title, title: data.title, subTitle: data.subTitle, curValue: data.curValue, rate: data.rate, transPrice: data.transPrice)
cell.setData(coinLogoImageName: data.logoImage, coinEnglishTitle: data.title, coinKoreanTitle: data.subTitle, coinCurrentPrice: data.curValue, riseOrDescent: data.riseOrDescent, percentage: data.rate, coinTotalPrice: data.transPrice)
return cell
}
}
Expand Down

0 comments on commit fcb9443

Please sign in to comment.