-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
588 additions
and
23 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
23 changes: 23 additions & 0 deletions
23
Coinone-iOS/Coinone-iOS/Resource/Assets.xcassets/switchDown.imageset/Contents.json
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,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x", | ||
"filename" : "switchDown.png" | ||
}, | ||
{ | ||
"scale" : "2x", | ||
"idiom" : "universal", | ||
"filename" : "[email protected]" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x", | ||
"filename" : "[email protected]" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+280 Bytes
...one-iOS/Coinone-iOS/Resource/Assets.xcassets/switchDown.imageset/switchDown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+425 Bytes
...-iOS/Coinone-iOS/Resource/Assets.xcassets/switchDown.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+569 Bytes
...-iOS/Coinone-iOS/Resource/Assets.xcassets/switchDown.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
139 changes: 139 additions & 0 deletions
139
Coinone-iOS/Coinone-iOS/Source/Cells/CoinListTableViewCell.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,139 @@ | ||
// | ||
// CoinListTableViewCell.swift | ||
// Coinone-iOS | ||
// | ||
// Created by ๋ ธํ์ on 2021/05/20. | ||
// | ||
import SnapKit | ||
import Then | ||
import UIKit | ||
|
||
// MARK: - CoinListTableViewCell | ||
class CoinListTableViewCell: UITableViewCell { | ||
|
||
// MARK: - Identifier | ||
let identifier = "CoinListTableViewCell" | ||
|
||
// MARK: - LifeCycles | ||
override func awakeFromNib() { | ||
super.awakeFromNib() | ||
layout() | ||
|
||
} | ||
|
||
// MARK: - Components | ||
let containerView = UIView() | ||
let coinTitleContainerView = UIView() | ||
let coinTitleLogoImageView = UIImageView() | ||
let coinTitleEnglishLabel = UILabel() | ||
let coinTitleKoreanLabel = UILabel() | ||
|
||
let coinCurrentPriceLabel = UILabel() | ||
let coinFluctuationDegreeLabel = UILabel() | ||
let coinTotalPriceLabel = UILabel() | ||
} | ||
|
||
// MARK: - Extensions | ||
extension CoinListTableViewCell { | ||
|
||
// MARK: - Helpers | ||
func layout() { | ||
self.backgroundColor = .clear | ||
layoutContainerView() | ||
layoutCoinTitleContainerView() | ||
layoutCoinTitleEnglishLabel() | ||
layoutCoinTitleLogoImageView() | ||
layoutCoinTitleKoreanLabel() | ||
layoutCoinTotalPriceLabel() | ||
layoutCoinFluctuationDegreeLabel() | ||
layoutCoinCurrentPriceLabel() | ||
} | ||
func layoutContainerView() { | ||
self.contentView.add(containerView) { | ||
$0.backgroundColor = .white | ||
$0.snp.makeConstraints { | ||
$0.top.equalTo(self.contentView.snp.top).offset(6) | ||
$0.leading.equalTo(self.contentView.snp.leading).offset(20) | ||
$0.trailing.equalTo(self.contentView.snp.trailing).offset(-20) | ||
$0.bottom.equalTo(self.contentView.snp.bottom).offset(-6) | ||
} | ||
} | ||
} | ||
func layoutCoinTitleContainerView() { | ||
self.containerView.add(coinTitleContainerView) { | ||
$0.backgroundColor = .clear | ||
$0.snp.makeConstraints { | ||
$0.leading.equalTo(self.containerView.snp.leading).offset(13) | ||
$0.centerY.equalToSuperview() | ||
$0.height.equalTo(34) | ||
$0.width.equalTo(50) | ||
} | ||
} | ||
} | ||
func layoutCoinTitleEnglishLabel() { | ||
self.coinTitleContainerView.add(coinTitleEnglishLabel) { | ||
$0.snp.makeConstraints { | ||
$0.leading.equalTo(self.coinTitleContainerView.snp.leading).offset(22) | ||
$0.top.equalTo(self.coinTitleContainerView.snp.top) | ||
} | ||
} | ||
} | ||
func layoutCoinTitleLogoImageView() { | ||
self.coinTitleContainerView.add(coinTitleLogoImageView) { | ||
$0.snp.makeConstraints { | ||
$0.leading.equalTo(self.coinTitleContainerView.snp.leading) | ||
$0.top.equalTo(self.coinTitleEnglishLabel.snp.top) | ||
$0.width.height.equalTo(12) | ||
} | ||
} | ||
} | ||
func layoutCoinTitleKoreanLabel() { | ||
self.coinTitleContainerView.add(coinTitleKoreanLabel) { | ||
$0.snp.makeConstraints { | ||
$0.leading.equalTo(self.coinTitleEnglishLabel.snp.leading) | ||
$0.top.equalTo(self.coinTitleEnglishLabel.snp.bottom) | ||
} | ||
} | ||
} | ||
func layoutCoinTotalPriceLabel() { | ||
self.containerView.add(coinTotalPriceLabel) { | ||
$0.snp.makeConstraints { | ||
$0.trailing.equalTo(self.containerView.snp.trailing).offset(-10) | ||
$0.centerY.equalTo(self.containerView.snp.centerY) | ||
} | ||
} | ||
} | ||
func layoutCoinFluctuationDegreeLabel() { | ||
self.containerView.add(coinFluctuationDegreeLabel) { | ||
$0.snp.makeConstraints { | ||
$0.trailing.equalTo(self.coinTotalPriceLabel.snp.leading).offset(-24) | ||
$0.centerY.equalTo(self.containerView.snp.centerY) | ||
} | ||
} | ||
} | ||
func layoutCoinCurrentPriceLabel() { | ||
self.containerView.add(coinCurrentPriceLabel) { | ||
$0.snp.makeConstraints { | ||
$0.trailing.equalTo(self.coinFluctuationDegreeLabel.snp.leading).offset(-24) | ||
$0.centerY.equalTo(self.containerView.snp.centerY) | ||
} | ||
} | ||
} | ||
func dataBind(coinLogoImageName: String, coinEnglishTitle: String, coinKoreanTitle: String, coinCurrentPrice: Float, riseOrDescent: String, percentage: Float, coinTotalPrice: Float) { | ||
let formatter = NumberFormatter().then { | ||
$0.numberStyle = .decimal | ||
} | ||
self.coinTitleLogoImageView.image = UIImage(named: coinLogoImageName) | ||
self.coinTitleEnglishLabel.setLabel(text: coinEnglishTitle, textColor: .black, font: .notoSansKRBoldFont(fontSize: 14)) | ||
self.coinTitleKoreanLabel.setLabel(text: coinKoreanTitle, textColor: .coinGray, font: .notoSansKRMediumFont(fontSize: 10)) | ||
if riseOrDescent == "+" { | ||
self.coinCurrentPriceLabel.setLabel(text: "\(formatter.string(from: NSNumber(value: coinCurrentPrice))!)", textColor: .textRed, font: .boldSystemFont(ofSize: 14)) | ||
self.coinFluctuationDegreeLabel.setLabel(text: "\(riseOrDescent)\(percentage)%", textColor: .textRed, font: .systemFont(ofSize: 14, weight: .regular)) | ||
} | ||
else { | ||
self.coinCurrentPriceLabel.setLabel(text: "\(formatter.string(from: NSNumber(value: coinCurrentPrice))!)", textColor: .mainBlue, font: .boldSystemFont(ofSize: 14)) | ||
self.coinFluctuationDegreeLabel.setLabel(text: "\(riseOrDescent)\(percentage)%", textColor: .mainBlue, font: .systemFont(ofSize: 14, weight: .regular)) | ||
} | ||
self.coinTotalPriceLabel.setLabel(text: "\(formatter.string(from: NSNumber(value:coinTotalPrice))!)์ต", textColor: .coinGray, font: .systemFont(ofSize: 14, weight: .regular)) | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
Coinone-iOS/Coinone-iOS/Source/Cells/FilterCollectionViewCell.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,58 @@ | ||
// | ||
// FilterCollectionViewCell.swift | ||
// Coinone-iOS | ||
// | ||
// Created by ๋ ธํ์ on 2021/05/20. | ||
// | ||
import SnapKit | ||
import Then | ||
import UIKit | ||
|
||
// MARK: - FilterCollectionViewCell | ||
class FilterCollectionViewCell: UICollectionViewCell { | ||
|
||
// MARK: - Identifier | ||
let identifier = "FilterCollectionViewCell" | ||
|
||
// MARK: - LifeCycles | ||
override func awakeFromNib() { | ||
super.awakeFromNib() | ||
layout() | ||
} | ||
|
||
// MARK: - Components | ||
let filterTitleLabel = UILabel() | ||
let filterButton = UIButton() | ||
} | ||
// MARK: - Extensions | ||
extension FilterCollectionViewCell { | ||
// MARK: - Helpers | ||
func layout() { | ||
self.contentView.layer.borderWidth = 1 | ||
self.contentView.layer.borderColor = CGColor(red: 240/255, green: 240/255, blue: 240/255, alpha: 1) | ||
layoutFilterLabel() | ||
layoutFilterButton() | ||
} | ||
func layoutFilterLabel() { | ||
self.contentView.add(filterTitleLabel) { | ||
$0.snp.makeConstraints { | ||
$0.leading.equalTo(self.contentView.snp.leading).offset(8) | ||
$0.centerY.equalTo(self.contentView.snp.centerY) | ||
} | ||
} | ||
} | ||
func layoutFilterButton() { | ||
self.contentView.add(filterButton) { | ||
$0.setBackgroundImage(UIImage(named: "switch"), for: .normal) | ||
$0.setBackgroundImage(UIImage(named: "switchDown"), for: .selected) | ||
$0.snp.makeConstraints { | ||
$0.trailing.equalTo(self.contentView.snp.trailing).offset(-6) | ||
$0.centerY.equalTo(self.contentView.snp.centerY) | ||
$0.top.equalTo(self.filterTitleLabel.snp.top) | ||
} | ||
} | ||
} | ||
func dataBind(title: String) { | ||
self.filterTitleLabel.setLabel(text: title, textColor: .coinGray, font: .notoSansKRBoldFont(fontSize: 12)) | ||
} | ||
} |
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,19 @@ | ||
// | ||
// CoinListModel.swift | ||
// Coinone-iOS | ||
// | ||
// Created by ๋ ธํ์ on 2021/05/20. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
struct CoinListModel { | ||
var coinLogoImageName: String | ||
var coinEnglishTitle: String | ||
var coinKoreanTitle: String | ||
var coinCurrentPrice: Float | ||
var riseOrDescent: String | ||
var percentage: Float | ||
var coinTotalPrice: Float | ||
} |
Oops, something went wrong.