diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/Contents.json b/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/Contents.json new file mode 100644 index 00000000..07b6c57f --- /dev/null +++ b/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "level01.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "level01@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "level01@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/level01.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/level01.png new file mode 100644 index 00000000..5bb2238a Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/level01.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/level01@2x.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/level01@2x.png new file mode 100644 index 00000000..fb620ffe Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/level01@2x.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/level01@3x.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/level01@3x.png new file mode 100644 index 00000000..644d128c Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level01.imageset/level01@3x.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/Contents.json b/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/Contents.json new file mode 100644 index 00000000..24a5fb8a --- /dev/null +++ b/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "level02.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "level02@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "level02@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/level02.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/level02.png new file mode 100644 index 00000000..fb4b77fa Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/level02.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/level02@2x.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/level02@2x.png new file mode 100644 index 00000000..4a68d41a Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/level02@2x.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/level02@3x.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/level02@3x.png new file mode 100644 index 00000000..2e4aa7c3 Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level02.imageset/level02@3x.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/Contents.json b/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/Contents.json new file mode 100644 index 00000000..ae512702 --- /dev/null +++ b/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "level03.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "level03@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "level03@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/level03.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/level03.png new file mode 100644 index 00000000..ffe09233 Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/level03.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/level03@2x.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/level03@2x.png new file mode 100644 index 00000000..aa02575f Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/level03@2x.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/level03@3x.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/level03@3x.png new file mode 100644 index 00000000..941908dd Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level03.imageset/level03@3x.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/Contents.json b/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/Contents.json new file mode 100644 index 00000000..3173069b --- /dev/null +++ b/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "level04.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "level04@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "level04@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/level04.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/level04.png new file mode 100644 index 00000000..a2e10ec2 Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/level04.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/level04@2x.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/level04@2x.png new file mode 100644 index 00000000..0e2ab339 Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/level04@2x.png differ diff --git a/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/level04@3x.png b/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/level04@3x.png new file mode 100644 index 00000000..66c7f119 Binary files /dev/null and b/KkuMulKum/Resource/Assets.xcassets/Image/img_level04.imageset/level04@3x.png differ diff --git a/KkuMulKum/Source/Home/View/HomeView.swift b/KkuMulKum/Source/Home/View/HomeView.swift index 7ec8d3af..eebfa2c1 100644 --- a/KkuMulKum/Source/Home/View/HomeView.swift +++ b/KkuMulKum/Source/Home/View/HomeView.swift @@ -32,6 +32,12 @@ final class HomeView: BaseView { let kkumulLabel = UILabel() + let levelCharacterImage = UIImageView() + + let levelLabel = UILabel() + + let levelCaptionLabel = UILabel() + private let levelView = UIStackView(axis: .horizontal).then { $0.backgroundColor = .white $0.layer.cornerRadius = 12 @@ -39,23 +45,10 @@ final class HomeView: BaseView { $0.distribution = .fill } - let levelLabel = UILabel().then { - $0.setText("Lv.0 새끼 꾸물이", style: .caption01, color: .gray6) - $0.setHighlightText("Lv.0", style: .caption01, color: .maincolor) - } - private let levelCaptionView = UIImageView().then { $0.image = .imgBoard } - let levelCaptionLabel = UILabel().then { - $0.setText( - "아직 한번도 정시에 도착하지 못했어요!\n정시 도착으로 캐릭터를 성장시켜 보세요", - style: .label01, - color: .white - ) - } - private let promiseView = UIView(backgroundColor: .gray0).then { $0.roundCorners( cornerRadius: 16, @@ -116,6 +109,7 @@ final class HomeView: BaseView { contentView.addSubviews( logo, kkumulLabel, + levelCharacterImage, levelView, levelCaptionView, levelCaptionLabel, @@ -161,6 +155,13 @@ final class HomeView: BaseView { $0.top.equalToSuperview().offset(112) } + levelCharacterImage.snp.makeConstraints { + $0.top.equalToSuperview().offset(106) + $0.trailing.equalToSuperview() + $0.width.equalTo(160) + $0.height.equalTo(198) + } + levelView.snp.makeConstraints { $0.trailing.equalToSuperview().offset(-36) $0.top.equalToSuperview().offset(350) @@ -231,12 +232,3 @@ final class HomeView: BaseView { } } } - -//extension HomeView { -// func dataBind(_ data: LoginUserModel) { -// kkumulLabel.setText("\(data.name) 님,\n\(data.promiseCount)번의 약속에서\n\(data.tardyCount)번 꾸물거렸어요!", style: .title02, color: .white) -// kkumulLabel.setHighlightText("\(data.name) 님,", style: .title00, color: .white) -// kkumulLabel.setHighlightText("\(data.promiseCount)번", "\(data.tardyCount)번", style: .title00, color: .lightGreen) -// levelLabel.setText("Lv.\(data.level) \(viewModel.levelName)", style: .caption01, color: .gray6) -// } -//} diff --git a/KkuMulKum/Source/Home/ViewController/HomeViewController.swift b/KkuMulKum/Source/Home/ViewController/HomeViewController.swift index 124579a0..0e7b012f 100644 --- a/KkuMulKum/Source/Home/ViewController/HomeViewController.swift +++ b/KkuMulKum/Source/Home/ViewController/HomeViewController.swift @@ -187,6 +187,7 @@ private extension HomeViewController { viewModel.loginUser.bind { [weak self] _ in DispatchQueue.main.async { let data = self?.viewModel.loginUser.value + self?.rootView.kkumulLabel.setText( "\(data?.name ?? "") 님,\n\(data?.promiseCount ?? 0)번의 약속에서\n\(data?.tardyCount ?? 0)번 꾸물거렸어요!", style: .title02, @@ -203,6 +204,28 @@ private extension HomeViewController { style: .title00, color: .lightGreen ) + self?.rootView.levelLabel.setText( + "Lv.\(data?.level ?? 0) \(self?.viewModel.levelName.value ?? "")", + style: .caption01, + color: .gray6 + ) + self?.rootView.levelLabel.setHighlightText( + "Lv.\(data?.level ?? 0)", + style: .caption01, + color: .maincolor + ) + self?.rootView.levelCaptionLabel.setText( + self?.viewModel.levelCaption.value ?? "", + style: .label01, + color: .white + ) + switch data?.level { + case 1: self?.rootView.levelCharacterImage.image = .imgLevel01 + case 2: self?.rootView.levelCharacterImage.image = .imgLevel02 + case 3: self?.rootView.levelCharacterImage.image = .imgLevel03 + case 4: self?.rootView.levelCharacterImage.image = .imgLevel04 + default: break + } } } }