Skip to content

Commit 9a9e768

Browse files
authored
Merge pull request #18 from BE-SOPT-Collaboration-Seminar-Coinone/feature/#3
🎨 TransactionViewController 구현완료
2 parents 3099bff + 2d79939 commit 9a9e768

File tree

14 files changed

+588
-13
lines changed

14 files changed

+588
-13
lines changed

Coinone-iOS/Coinone-iOS.xcodeproj/project.pbxproj

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
/* Begin PBXBuildFile section */
1010
06A1A45591145692DA4F18C7 /* Pods_Coinone_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E0AB500236EDF60103A408AE /* Pods_Coinone_iOS.framework */; };
11+
CC0A1A9726564240000B65B9 /* FilterCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0A1A9626564240000B65B9 /* FilterCollectionViewCell.swift */; };
12+
CC0A1A992656425A000B65B9 /* CoinListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0A1A982656425A000B65B9 /* CoinListTableViewCell.swift */; };
13+
CC0A1A9C265642E9000B65B9 /* TitleCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0A1A9B265642E9000B65B9 /* TitleCollectionReusableView.swift */; };
14+
CC0A1A9E2656434B000B65B9 /* CoinListCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0A1A9D2656434B000B65B9 /* CoinListCollectionReusableView.swift */; };
15+
CC0A1AA026564FDA000B65B9 /* CoinListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0A1A9F26564FDA000B65B9 /* CoinListModel.swift */; };
1116
CC0E23272652232700B982A0 /* MyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0E23262652232700B982A0 /* MyViewController.swift */; };
1217
CC0E232B265223FE00B982A0 /* StockTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0E232A265223FE00B982A0 /* StockTVC.swift */; };
1318
CC0E232D2652241D00B982A0 /* StockModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0E232C2652241D00B982A0 /* StockModel.swift */; };
@@ -50,6 +55,11 @@
5055
/* Begin PBXFileReference section */
5156
3E2F6097EABAAACC664AB52A /* Pods-Coinone-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Coinone-iOS.debug.xcconfig"; path = "Target Support Files/Pods-Coinone-iOS/Pods-Coinone-iOS.debug.xcconfig"; sourceTree = "<group>"; };
5257
4BA5E0330054E48E147B52CA /* Pods-Coinone-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Coinone-iOS.release.xcconfig"; path = "Target Support Files/Pods-Coinone-iOS/Pods-Coinone-iOS.release.xcconfig"; sourceTree = "<group>"; };
58+
CC0A1A9626564240000B65B9 /* FilterCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterCollectionViewCell.swift; sourceTree = "<group>"; };
59+
CC0A1A982656425A000B65B9 /* CoinListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinListTableViewCell.swift; sourceTree = "<group>"; };
60+
CC0A1A9B265642E9000B65B9 /* TitleCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleCollectionReusableView.swift; sourceTree = "<group>"; };
61+
CC0A1A9D2656434B000B65B9 /* CoinListCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinListCollectionReusableView.swift; sourceTree = "<group>"; };
62+
CC0A1A9F26564FDA000B65B9 /* CoinListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinListModel.swift; sourceTree = "<group>"; };
5363
CC0E23262652232700B982A0 /* MyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyViewController.swift; sourceTree = "<group>"; };
5464
CC0E232A265223FE00B982A0 /* StockTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StockTVC.swift; sourceTree = "<group>"; };
5565
CC0E232C2652241D00B982A0 /* StockModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StockModel.swift; sourceTree = "<group>"; };
@@ -104,13 +114,24 @@
104114
/* End PBXFrameworksBuildPhase section */
105115

106116
/* Begin PBXGroup section */
117+
CC0A1A9A265642B6000B65B9 /* ReusableViews */ = {
118+
isa = PBXGroup;
119+
children = (
120+
CC0A1A9B265642E9000B65B9 /* TitleCollectionReusableView.swift */,
121+
CC0A1A9D2656434B000B65B9 /* CoinListCollectionReusableView.swift */,
122+
);
123+
path = ReusableViews;
124+
sourceTree = "<group>";
125+
};
107126
CC0E2328265223B000B982A0 /* Cells */ = {
108127
isa = PBXGroup;
109128
children = (
110129
CC0E232A265223FE00B982A0 /* StockTVC.swift */,
111130
CC770CFD26540902004095A6 /* TopMenuCollectionViewCell.swift */,
112131
CC770D02265426FA004095A6 /* FavoriteTableViewCell.swift */,
113132
E8EC22B1265445210027E8A8 /* MyTableViewCell.swift */,
133+
CC0A1A9626564240000B65B9 /* FilterCollectionViewCell.swift */,
134+
CC0A1A982656425A000B65B9 /* CoinListTableViewCell.swift */,
114135
);
115136
path = Cells;
116137
sourceTree = "<group>";
@@ -121,6 +142,7 @@
121142
CC0E232C2652241D00B982A0 /* StockModel.swift */,
122143
CC770D0426542DDF004095A6 /* CoinModel.swift */,
123144
E8EC22B5265448200027E8A8 /* MyListDataModel.swift */,
145+
CC0A1A9F26564FDA000B65B9 /* CoinListModel.swift */,
124146
);
125147
path = Models;
126148
sourceTree = "<group>";
@@ -177,6 +199,7 @@
177199
CCAA9A1A264FAA0C008E50BF /* Source */ = {
178200
isa = PBXGroup;
179201
children = (
202+
CC0A1A9A265642B6000B65B9 /* ReusableViews */,
180203
CC0E2329265223B800B982A0 /* Models */,
181204
CC0E2328265223B000B982A0 /* Cells */,
182205
CCAA9A1E264FAA6C008E50BF /* ViewControllers */,
@@ -386,23 +409,28 @@
386409
isa = PBXSourcesBuildPhase;
387410
buildActionMask = 2147483647;
388411
files = (
412+
CC0A1A9C265642E9000B65B9 /* TitleCollectionReusableView.swift in Sources */,
389413
CCAA9A34264FAF68008E50BF /* UIView+.swift in Sources */,
390414
CC6608BE265450B0004DD7D2 /* PopupHsViewController.swift in Sources */,
391415
CC0E232D2652241D00B982A0 /* StockModel.swift in Sources */,
392416
CCAA9A2B264FACDD008E50BF /* UIColor+.swift in Sources */,
393417
CC770CF8265396CF004095A6 /* UILabel+.swift in Sources */,
394418
CC0E232B265223FE00B982A0 /* StockTVC.swift in Sources */,
419+
CC0A1A992656425A000B65B9 /* CoinListTableViewCell.swift in Sources */,
395420
CC770CFE26540903004095A6 /* TopMenuCollectionViewCell.swift in Sources */,
396421
CC770D03265426FA004095A6 /* FavoriteTableViewCell.swift in Sources */,
397422
CC272E5B26517E6000637BCE /* TabbarViewController.swift in Sources */,
398423
E8EC22B6265448200027E8A8 /* MyListDataModel.swift in Sources */,
399424
CCA0ECC6264FA7A4001CC563 /* AppDelegate.swift in Sources */,
400425
CC26A39F2655075600C09C0D /* PopupViewController.swift in Sources */,
401426
CC770CFC265397BD004095A6 /* UIFont+.swift in Sources */,
427+
CC0A1AA026564FDA000B65B9 /* CoinListModel.swift in Sources */,
428+
CC0A1A9726564240000B65B9 /* FilterCollectionViewCell.swift in Sources */,
402429
E8EC22B2265445210027E8A8 /* MyTableViewCell.swift in Sources */,
403430
CC0E23272652232700B982A0 /* MyViewController.swift in Sources */,
404431
CCAA9A2E264FAEB9008E50BF /* CALayer+.swift in Sources */,
405432
CC272E6226517F0500637BCE /* HomeViewController.swift in Sources */,
433+
CC0A1A9E2656434B000B65B9 /* CoinListCollectionReusableView.swift in Sources */,
406434
CC0E232F2652244F00B982A0 /* GeoraesoVC.swift in Sources */,
407435
CC770D0126540943004095A6 /* Identifiable.swift in Sources */,
408436
CCA0ECC8264FA7A4001CC563 /* SceneDelegate.swift in Sources */,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"scale" : "1x",
6+
"filename" : "switchDown.png"
7+
},
8+
{
9+
"scale" : "2x",
10+
"idiom" : "universal",
11+
"filename" : "[email protected]"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x",
16+
"filename" : "[email protected]"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
}
23+
}
280 Bytes
Loading
425 Bytes
Loading
569 Bytes
Loading

Coinone-iOS/Coinone-iOS/Resource/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<key>UISceneDelegateClassName</key>
4444
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
4545
<key>UISceneStoryboardFile</key>
46-
<string>Georaeso</string>
46+
<string>Main</string>
4747
</dict>
4848
</array>
4949
</dict>

Coinone-iOS/Coinone-iOS/Resource/Protocol/Identifiable.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ extension Identifiable {
2020
extension UITableViewCell: Identifiable {}
2121
extension UICollectionViewCell: Identifiable {}
2222
extension UIViewController: Identifiable {}
23+
extension UICollectionReusableView: Identifiable {}
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
//
2+
// CoinListTableViewCell.swift
3+
// Coinone-iOS
4+
//
5+
// Created by 노한솔 on 2021/05/20.
6+
//
7+
import SnapKit
8+
import Then
9+
import UIKit
10+
11+
// MARK: - CoinListTableViewCell
12+
class CoinListTableViewCell: UITableViewCell {
13+
14+
// MARK: - Identifier
15+
let identifier = "CoinListTableViewCell"
16+
17+
// MARK: - LifeCycles
18+
override func awakeFromNib() {
19+
super.awakeFromNib()
20+
layout()
21+
22+
}
23+
24+
// MARK: - Components
25+
let containerView = UIView()
26+
let coinTitleContainerView = UIView()
27+
let coinTitleLogoImageView = UIImageView()
28+
let coinTitleEnglishLabel = UILabel()
29+
let coinTitleKoreanLabel = UILabel()
30+
31+
let coinCurrentPriceLabel = UILabel()
32+
let coinFluctuationDegreeLabel = UILabel()
33+
let coinTotalPriceLabel = UILabel()
34+
}
35+
36+
// MARK: - Extensions
37+
extension CoinListTableViewCell {
38+
39+
// MARK: - Helpers
40+
func layout() {
41+
self.backgroundColor = .clear
42+
layoutContainerView()
43+
layoutCoinTitleContainerView()
44+
layoutCoinTitleEnglishLabel()
45+
layoutCoinTitleLogoImageView()
46+
layoutCoinTitleKoreanLabel()
47+
layoutCoinTotalPriceLabel()
48+
layoutCoinFluctuationDegreeLabel()
49+
layoutCoinCurrentPriceLabel()
50+
}
51+
func layoutContainerView() {
52+
self.contentView.add(containerView) {
53+
$0.backgroundColor = .white
54+
$0.snp.makeConstraints {
55+
$0.top.equalTo(self.contentView.snp.top).offset(6)
56+
$0.leading.equalTo(self.contentView.snp.leading).offset(20)
57+
$0.trailing.equalTo(self.contentView.snp.trailing).offset(-20)
58+
$0.bottom.equalTo(self.contentView.snp.bottom).offset(-6)
59+
}
60+
}
61+
}
62+
func layoutCoinTitleContainerView() {
63+
self.containerView.add(coinTitleContainerView) {
64+
$0.backgroundColor = .clear
65+
$0.snp.makeConstraints {
66+
$0.leading.equalTo(self.containerView.snp.leading).offset(13)
67+
$0.centerY.equalToSuperview()
68+
$0.height.equalTo(34)
69+
$0.width.equalTo(50)
70+
}
71+
}
72+
}
73+
func layoutCoinTitleEnglishLabel() {
74+
self.coinTitleContainerView.add(coinTitleEnglishLabel) {
75+
$0.snp.makeConstraints {
76+
$0.leading.equalTo(self.coinTitleContainerView.snp.leading).offset(22)
77+
$0.top.equalTo(self.coinTitleContainerView.snp.top)
78+
}
79+
}
80+
}
81+
func layoutCoinTitleLogoImageView() {
82+
self.coinTitleContainerView.add(coinTitleLogoImageView) {
83+
$0.snp.makeConstraints {
84+
$0.leading.equalTo(self.coinTitleContainerView.snp.leading)
85+
$0.top.equalTo(self.coinTitleEnglishLabel.snp.top)
86+
$0.width.height.equalTo(12)
87+
}
88+
}
89+
}
90+
func layoutCoinTitleKoreanLabel() {
91+
self.coinTitleContainerView.add(coinTitleKoreanLabel) {
92+
$0.snp.makeConstraints {
93+
$0.leading.equalTo(self.coinTitleEnglishLabel.snp.leading)
94+
$0.top.equalTo(self.coinTitleEnglishLabel.snp.bottom)
95+
}
96+
}
97+
}
98+
func layoutCoinTotalPriceLabel() {
99+
self.containerView.add(coinTotalPriceLabel) {
100+
$0.snp.makeConstraints {
101+
$0.trailing.equalTo(self.containerView.snp.trailing).offset(-10)
102+
$0.centerY.equalTo(self.containerView.snp.centerY)
103+
}
104+
}
105+
}
106+
func layoutCoinFluctuationDegreeLabel() {
107+
self.containerView.add(coinFluctuationDegreeLabel) {
108+
$0.snp.makeConstraints {
109+
$0.trailing.equalTo(self.coinTotalPriceLabel.snp.leading).offset(-24)
110+
$0.centerY.equalTo(self.containerView.snp.centerY)
111+
}
112+
}
113+
}
114+
func layoutCoinCurrentPriceLabel() {
115+
self.containerView.add(coinCurrentPriceLabel) {
116+
$0.snp.makeConstraints {
117+
$0.trailing.equalTo(self.coinFluctuationDegreeLabel.snp.leading).offset(-24)
118+
$0.centerY.equalTo(self.containerView.snp.centerY)
119+
}
120+
}
121+
}
122+
func dataBind(coinLogoImageName: String, coinEnglishTitle: String, coinKoreanTitle: String, coinCurrentPrice: Float, riseOrDescent: String, percentage: Float, coinTotalPrice: Float) {
123+
let formatter = NumberFormatter().then {
124+
$0.numberStyle = .decimal
125+
}
126+
self.coinTitleLogoImageView.image = UIImage(named: coinLogoImageName)
127+
self.coinTitleEnglishLabel.setLabel(text: coinEnglishTitle, textColor: .black, font: .notoSansKRBoldFont(fontSize: 14))
128+
self.coinTitleKoreanLabel.setLabel(text: coinKoreanTitle, textColor: .coinGray, font: .notoSansKRMediumFont(fontSize: 10))
129+
if riseOrDescent == "+" {
130+
self.coinCurrentPriceLabel.setLabel(text: "\(formatter.string(from: NSNumber(value: coinCurrentPrice))!)", textColor: .textRed, font: .boldSystemFont(ofSize: 14))
131+
self.coinFluctuationDegreeLabel.setLabel(text: "\(riseOrDescent)\(percentage)%", textColor: .textRed, font: .systemFont(ofSize: 14, weight: .regular))
132+
}
133+
else {
134+
self.coinCurrentPriceLabel.setLabel(text: "\(formatter.string(from: NSNumber(value: coinCurrentPrice))!)", textColor: .mainBlue, font: .boldSystemFont(ofSize: 14))
135+
self.coinFluctuationDegreeLabel.setLabel(text: "\(riseOrDescent)\(percentage)%", textColor: .mainBlue, font: .systemFont(ofSize: 14, weight: .regular))
136+
}
137+
self.coinTotalPriceLabel.setLabel(text: "\(formatter.string(from: NSNumber(value:coinTotalPrice))!)", textColor: .coinGray, font: .systemFont(ofSize: 14, weight: .regular))
138+
}
139+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
//
2+
// FilterCollectionViewCell.swift
3+
// Coinone-iOS
4+
//
5+
// Created by 노한솔 on 2021/05/20.
6+
//
7+
import SnapKit
8+
import Then
9+
import UIKit
10+
11+
// MARK: - FilterCollectionViewCell
12+
class FilterCollectionViewCell: UICollectionViewCell {
13+
14+
// MARK: - Identifier
15+
let identifier = "FilterCollectionViewCell"
16+
17+
// MARK: - LifeCycles
18+
override func awakeFromNib() {
19+
super.awakeFromNib()
20+
layout()
21+
}
22+
23+
// MARK: - Components
24+
let filterTitleLabel = UILabel()
25+
let filterButton = UIButton()
26+
}
27+
// MARK: - Extensions
28+
extension FilterCollectionViewCell {
29+
// MARK: - Helpers
30+
func layout() {
31+
self.contentView.layer.borderWidth = 1
32+
self.contentView.layer.borderColor = CGColor(red: 240/255, green: 240/255, blue: 240/255, alpha: 1)
33+
layoutFilterLabel()
34+
layoutFilterButton()
35+
}
36+
func layoutFilterLabel() {
37+
self.contentView.add(filterTitleLabel) {
38+
$0.snp.makeConstraints {
39+
$0.leading.equalTo(self.contentView.snp.leading).offset(8)
40+
$0.centerY.equalTo(self.contentView.snp.centerY)
41+
}
42+
}
43+
}
44+
func layoutFilterButton() {
45+
self.contentView.add(filterButton) {
46+
$0.setBackgroundImage(UIImage(named: "switch"), for: .normal)
47+
$0.setBackgroundImage(UIImage(named: "switchDown"), for: .selected)
48+
$0.snp.makeConstraints {
49+
$0.trailing.equalTo(self.contentView.snp.trailing).offset(-6)
50+
$0.centerY.equalTo(self.contentView.snp.centerY)
51+
$0.top.equalTo(self.filterTitleLabel.snp.top)
52+
}
53+
}
54+
}
55+
func dataBind(title: String) {
56+
self.filterTitleLabel.setLabel(text: title, textColor: .coinGray, font: .notoSansKRBoldFont(fontSize: 12))
57+
}
58+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// CoinListModel.swift
3+
// Coinone-iOS
4+
//
5+
// Created by 노한솔 on 2021/05/20.
6+
//
7+
8+
import Foundation
9+
import UIKit
10+
11+
struct CoinListModel {
12+
var coinLogoImageName: String
13+
var coinEnglishTitle: String
14+
var coinKoreanTitle: String
15+
var coinCurrentPrice: Float
16+
var riseOrDescent: String
17+
var percentage: Float
18+
var coinTotalPrice: Float
19+
}

0 commit comments

Comments
 (0)