forked from Runnect/Runnect-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Runnect#39 courseDiscoveryVC UI 수정
- Loading branch information
1 parent
cd1f9e3
commit e7ee494
Showing
13 changed files
with
416 additions
and
3 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
22 changes: 22 additions & 0 deletions
22
Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/adimage.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,22 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Mask group.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "Mask group@2x.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+713 KB
...iOS/Runnect-iOS/Global/Resource/Assets.xcassets/adimage.imageset/Mask group.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
+262 KB
.../Runnect-iOS/Global/Resource/Assets.xcassets/adimage.imageset/Mask group@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions
93
Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Reuse/MapCollectionViewCell.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,93 @@ | ||
// | ||
// MapCollectionViewCell.swift | ||
// Runnect-iOS | ||
// | ||
// Created by YEONOO on 2023/01/02. | ||
// | ||
|
||
import UIKit | ||
import SnapKit | ||
|
||
import Then | ||
|
||
class MapCollectionViewCell: UICollectionViewCell { | ||
|
||
// MARK: - Identifier | ||
static let identifier = "MapCollectionViewCell" | ||
// MARK: - UI Components | ||
private let mapContainerView = UIView() | ||
private let mapImageView = UIImageView().then { | ||
$0.image = ImageLiterals.imgLogo | ||
} | ||
private let titleLabel = UILabel().then { | ||
$0.text = "제목제목제목제목제목" | ||
$0.font = UIFont.b4 | ||
$0.textColor = UIColor.black | ||
} | ||
private let locationLabel = UILabel().then { | ||
$0.text = "00시 00구" | ||
$0.font = UIFont.b6 | ||
$0.textColor = UIColor.g2 | ||
} | ||
private let heartButton = UIImageView().then { | ||
$0.image = ImageLiterals.icHeartFill | ||
} | ||
// MARK: - Life cycle | ||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
layout() | ||
|
||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
} | ||
|
||
// MARK: - Extensions | ||
|
||
extension MapCollectionViewCell { | ||
// MARK: - Layout Helpers | ||
|
||
private func layout() { | ||
contentView.backgroundColor = .clear | ||
mapImageView.backgroundColor = .systemGray4 | ||
[mapContainerView, mapImageView, titleLabel, locationLabel, heartButton].forEach { | ||
contentView.addSubview($0)} | ||
mapContainerView.addSubview(mapImageView) | ||
mapContainerView.snp.makeConstraints { | ||
$0.top.equalToSuperview() | ||
$0.centerX.equalToSuperview() | ||
$0.leading.equalToSuperview() | ||
$0.height.equalTo(161) | ||
} | ||
mapImageView.snp.makeConstraints { | ||
$0.top.leading.trailing.equalToSuperview() | ||
$0.height.equalTo(110) | ||
|
||
} | ||
titleLabel.snp.makeConstraints { | ||
$0.top.equalTo(mapImageView.snp.bottom).offset(4) | ||
$0.leading.equalTo(self.mapContainerView.snp.leading) | ||
} | ||
heartButton.snp.makeConstraints { | ||
$0.top.equalTo(mapImageView.snp.bottom).offset(4) | ||
$0.width.equalTo(14) | ||
$0.height.equalTo(12) | ||
$0.trailing.equalTo(self.mapContainerView.snp.trailing) | ||
} | ||
locationLabel.snp.makeConstraints { | ||
$0.top.equalTo(titleLabel.snp.bottom).offset(1) | ||
$0.leading.equalTo(self.mapContainerView.snp.leading) | ||
} | ||
} | ||
|
||
// MARK: - General Helpers | ||
|
||
func dataBind(model: MapModel) { | ||
mapImageView.image = UIImage(named: model.mapImage) | ||
titleLabel.text = model.title | ||
locationLabel.text = model.location | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Reuse/MapModel.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,14 @@ | ||
// | ||
// MapModel.swift | ||
// Runnect-iOS | ||
// | ||
// Created by YEONOO on 2023/01/03. | ||
// | ||
|
||
import Foundation | ||
|
||
struct MapModel { | ||
let mapImage: String | ||
let title: String | ||
let location: String | ||
} |
Oops, something went wrong.