Skip to content

Commit

Permalink
Merge branch 'main' into feature/#1
Browse files Browse the repository at this point in the history
  • Loading branch information
hansolnoh95 committed May 20, 2021
2 parents 7caebd2 + a611ff0 commit 2c538ab
Show file tree
Hide file tree
Showing 15 changed files with 588 additions and 23 deletions.
28 changes: 28 additions & 0 deletions Coinone-iOS/Coinone-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

/* Begin PBXBuildFile section */
06A1A45591145692DA4F18C7 /* Pods_Coinone_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E0AB500236EDF60103A408AE /* Pods_Coinone_iOS.framework */; };
CC0A1A9726564240000B65B9 /* FilterCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0A1A9626564240000B65B9 /* FilterCollectionViewCell.swift */; };
CC0A1A992656425A000B65B9 /* CoinListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0A1A982656425A000B65B9 /* CoinListTableViewCell.swift */; };
CC0A1A9C265642E9000B65B9 /* TitleCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0A1A9B265642E9000B65B9 /* TitleCollectionReusableView.swift */; };
CC0A1A9E2656434B000B65B9 /* CoinListCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0A1A9D2656434B000B65B9 /* CoinListCollectionReusableView.swift */; };
CC0A1AA026564FDA000B65B9 /* CoinListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0A1A9F26564FDA000B65B9 /* CoinListModel.swift */; };
CC0E23272652232700B982A0 /* MyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0E23262652232700B982A0 /* MyViewController.swift */; };
CC0E232B265223FE00B982A0 /* StockTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0E232A265223FE00B982A0 /* StockTVC.swift */; };
CC0E232D2652241D00B982A0 /* StockModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0E232C2652241D00B982A0 /* StockModel.swift */; };
Expand Down Expand Up @@ -50,6 +55,11 @@
/* Begin PBXFileReference section */
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>"; };
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>"; };
CC0A1A9626564240000B65B9 /* FilterCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterCollectionViewCell.swift; sourceTree = "<group>"; };
CC0A1A982656425A000B65B9 /* CoinListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinListTableViewCell.swift; sourceTree = "<group>"; };
CC0A1A9B265642E9000B65B9 /* TitleCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleCollectionReusableView.swift; sourceTree = "<group>"; };
CC0A1A9D2656434B000B65B9 /* CoinListCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinListCollectionReusableView.swift; sourceTree = "<group>"; };
CC0A1A9F26564FDA000B65B9 /* CoinListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinListModel.swift; sourceTree = "<group>"; };
CC0E23262652232700B982A0 /* MyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyViewController.swift; sourceTree = "<group>"; };
CC0E232A265223FE00B982A0 /* StockTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StockTVC.swift; sourceTree = "<group>"; };
CC0E232C2652241D00B982A0 /* StockModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StockModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -104,13 +114,24 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
CC0A1A9A265642B6000B65B9 /* ReusableViews */ = {
isa = PBXGroup;
children = (
CC0A1A9B265642E9000B65B9 /* TitleCollectionReusableView.swift */,
CC0A1A9D2656434B000B65B9 /* CoinListCollectionReusableView.swift */,
);
path = ReusableViews;
sourceTree = "<group>";
};
CC0E2328265223B000B982A0 /* Cells */ = {
isa = PBXGroup;
children = (
CC0E232A265223FE00B982A0 /* StockTVC.swift */,
CC770CFD26540902004095A6 /* TopMenuCollectionViewCell.swift */,
CC770D02265426FA004095A6 /* FavoriteTableViewCell.swift */,
E8EC22B1265445210027E8A8 /* MyTableViewCell.swift */,
CC0A1A9626564240000B65B9 /* FilterCollectionViewCell.swift */,
CC0A1A982656425A000B65B9 /* CoinListTableViewCell.swift */,
);
path = Cells;
sourceTree = "<group>";
Expand All @@ -121,6 +142,7 @@
CC0E232C2652241D00B982A0 /* StockModel.swift */,
CC770D0426542DDF004095A6 /* CoinModel.swift */,
E8EC22B5265448200027E8A8 /* MyListDataModel.swift */,
CC0A1A9F26564FDA000B65B9 /* CoinListModel.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -177,6 +199,7 @@
CCAA9A1A264FAA0C008E50BF /* Source */ = {
isa = PBXGroup;
children = (
CC0A1A9A265642B6000B65B9 /* ReusableViews */,
CC0E2329265223B800B982A0 /* Models */,
CC0E2328265223B000B982A0 /* Cells */,
CCAA9A1E264FAA6C008E50BF /* ViewControllers */,
Expand Down Expand Up @@ -386,23 +409,28 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CC0A1A9C265642E9000B65B9 /* TitleCollectionReusableView.swift in Sources */,
CCAA9A34264FAF68008E50BF /* UIView+.swift in Sources */,
CC6608BE265450B0004DD7D2 /* PopupHsViewController.swift in Sources */,
CC0E232D2652241D00B982A0 /* StockModel.swift in Sources */,
CCAA9A2B264FACDD008E50BF /* UIColor+.swift in Sources */,
CC770CF8265396CF004095A6 /* UILabel+.swift in Sources */,
CC0E232B265223FE00B982A0 /* StockTVC.swift in Sources */,
CC0A1A992656425A000B65B9 /* CoinListTableViewCell.swift in Sources */,
CC770CFE26540903004095A6 /* TopMenuCollectionViewCell.swift in Sources */,
CC770D03265426FA004095A6 /* FavoriteTableViewCell.swift in Sources */,
CC272E5B26517E6000637BCE /* TabbarViewController.swift in Sources */,
E8EC22B6265448200027E8A8 /* MyListDataModel.swift in Sources */,
CCA0ECC6264FA7A4001CC563 /* AppDelegate.swift in Sources */,
CC26A39F2655075600C09C0D /* PopupViewController.swift in Sources */,
CC770CFC265397BD004095A6 /* UIFont+.swift in Sources */,
CC0A1AA026564FDA000B65B9 /* CoinListModel.swift in Sources */,
CC0A1A9726564240000B65B9 /* FilterCollectionViewCell.swift in Sources */,
E8EC22B2265445210027E8A8 /* MyTableViewCell.swift in Sources */,
CC0E23272652232700B982A0 /* MyViewController.swift in Sources */,
CCAA9A2E264FAEB9008E50BF /* CALayer+.swift in Sources */,
CC272E6226517F0500637BCE /* HomeViewController.swift in Sources */,
CC0A1A9E2656434B000B65B9 /* CoinListCollectionReusableView.swift in Sources */,
CC0E232F2652244F00B982A0 /* GeoraesoVC.swift in Sources */,
CC770D0126540943004095A6 /* Identifiable.swift in Sources */,
CCA0ECC8264FA7A4001CC563 /* SceneDelegate.swift in Sources */,
Expand Down
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"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Coinone-iOS/Coinone-iOS/Resource/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>My</string>
<string>Main</string>
</dict>
</array>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ extension Identifiable {
extension UITableViewCell: Identifiable {}
extension UICollectionViewCell: Identifiable {}
extension UIViewController: Identifiable {}
extension UICollectionReusableView: Identifiable {}
139 changes: 139 additions & 0 deletions Coinone-iOS/Coinone-iOS/Source/Cells/CoinListTableViewCell.swift
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))
}
}
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))
}
}
19 changes: 19 additions & 0 deletions Coinone-iOS/Coinone-iOS/Source/Models/CoinListModel.swift
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
}
Loading

0 comments on commit 2c538ab

Please sign in to comment.