Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Pinit/Pinit/DesignSystem/DesignSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,25 @@ import UIKit

enum DesignSystemColor {
case Purple
case Purple50
case Lavender
case Lavender10
case Lavender1
}
extension DesignSystemColor {
var value: UIColor {
switch self {
case .Purple:
UIColor(hex: "#561CE2")
case .Purple50:
UIColor(hex: "#8562D5")
case .Lavender:
UIColor(hex: "#6450E2")

case .Lavender10:
UIColor(hex: "#C2BFD2")
case .Lavender1:
UIColor(hex: "#CECCCF")

}
}
}
Expand Down
12 changes: 0 additions & 12 deletions Pinit/Pinit/Repository/Moya/Network.swift

This file was deleted.

29 changes: 15 additions & 14 deletions Pinit/Pinit/Views/Cells/PinRecordCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ final class PinRecordCell: UICollectionViewCell {
}()
public lazy var thumbnailImageView: UIImageView = {
let imageView = UIImageView()
imageView.contentMode = .scaleToFill
imageView.contentMode = .scaleAspectFill
imageView.backgroundColor = .lightGray
imageView.clipsToBounds = true
return imageView
}()
private lazy var pinTitleLabel: UILabel = {
Expand Down Expand Up @@ -98,19 +99,19 @@ final class PinRecordCell: UICollectionViewCell {
extension PinRecordCell {
func captureMapSnapshotWithPin(center: CLLocationCoordinate2D, imageSize: CGSize, completion: @escaping (UIImage?) -> Void) {
let options = MKMapSnapshotter.Options()
options.region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.003, longitudeDelta: 0.003))
options.size = imageSize
options.mapType = .standard

let snapshotter = MKMapSnapshotter(options: options)
snapshotter.start { snapshot, error in
guard let snapshot = snapshot, error == nil else {
print("스냅샷 생성 실패")
completion(nil)
return
}

completion(snapshot.image)
options.region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.003, longitudeDelta: 0.003))
options.size = imageSize
options.mapType = .standard

let snapshotter = MKMapSnapshotter(options: options)
snapshotter.start { snapshot, error in
guard let snapshot = snapshot, error == nil else {
print("스냅샷 생성 실패")
completion(nil)
return
}

completion(snapshot.image)
}
}
}
62 changes: 37 additions & 25 deletions Pinit/Pinit/Views/Cells/ReviewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ import SnapKit

class ReviewCell: UITableViewCell {

// MARK: - init
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)

addComponents()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// MARK: - 컴포넌트 설정
public lazy var reviewCellPanel: UIView = {
let view = UIView()
Expand All @@ -31,7 +20,7 @@ class ReviewCell: UITableViewCell {
public lazy var reviewDate: UILabel = {
let label = UILabel()
label.text = "25년 3월 3일"
label.font = DesignSystemFont.Pretendard_SemiBold16.value
label.font = DesignSystemFont.Pretendard_Bold16.value
return label
}()

Expand All @@ -49,31 +38,54 @@ class ReviewCell: UITableViewCell {
return button
}()

// MARK: - init
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
addComponents()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func layoutSubviews() {
super.layoutSubviews()

contentView.frame = contentView.frame.inset(by: UIEdgeInsets(top: 4, left: 0, bottom: 2, right: 0))
}


override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)

if selected {
contentView.layer.shadowOffset = CGSize(width: 10, height: 10)
contentView.layer.shadowColor = DesignSystemColor.Purple.value.cgColor
}else{
contentView.layer.shadowOffset = CGSize(width: 10, height: 10)
contentView.layer.shadowColor = DesignSystemColor.Purple.value.cgColor
}
}


// MARK: - 데이터 설정 메서드
func configure(date: String, desc: String) {
reviewDate.text = date
reviewText.text = desc
}




// MARK: - 레이아웃
private func addComponents() {

self.addSubviews(reviewCellPanel)
reviewCellPanel.addSubviews(reviewDate, reviewText, reviewMenuButton)


reviewCellPanel.snp.makeConstraints {
$0.width.equalToSuperview()
$0.height.equalTo(60)
$0.centerY.equalToSuperview()
reviewCellPanel.snp.makeConstraints{
$0.edges.equalToSuperview()
}

reviewDate.snp.makeConstraints {
$0.top.equalToSuperview()
$0.top.equalToSuperview().inset(10)
$0.leading.equalToSuperview().inset(10)
}

Expand All @@ -82,10 +94,10 @@ class ReviewCell: UITableViewCell {
$0.leading.equalToSuperview().inset(10)
}

reviewMenuButton.snp.makeConstraints {
$0.top.equalToSuperview()
$0.trailing.equalToSuperview().inset(10)
}
// reviewMenuButton.snp.makeConstraints {
// $0.top.equalToSuperview()
// $0.trailing.equalToSuperview().inset(10)
// }

}

Expand Down
17 changes: 10 additions & 7 deletions Pinit/Pinit/Views/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ class HomeViewController: UIViewController {
private var adapter: PinCollectionViewAdapter?
private let mapView = MKMapView(frame: .zero)
private let bottomSheet = CustomBottomSheet()

private lazy var addPinButton: UIButton = {
let button = UIButton()
let image = UIImage(systemName: "pencil.line")
button.setImage(UIImage(systemName: "pencil.line"), for: .normal)
button.backgroundColor = .secondarySystemBackground
button.tintColor = DesignSystemColor.Purple.value
button.backgroundColor = DesignSystemColor.Lavender.value
button.tintColor = .white
button.layer.cornerRadius = circleButtonSize / 2
button.clipsToBounds = true
return button
}()
private lazy var currentLocationButton: UIButton = {
let button = UIButton()
button.setImage(UIImage(systemName: "dot.scope"), for: .normal)
button.backgroundColor = .secondarySystemBackground
button.tintColor = DesignSystemColor.Purple.value
button.backgroundColor = DesignSystemColor.Lavender.value
button.tintColor = .white
button.layer.cornerRadius = circleButtonSize / 2
button.clipsToBounds = true
return button
Expand Down Expand Up @@ -67,7 +67,8 @@ class HomeViewController: UIViewController {
mapView.delegate = self

mapView.showsUserLocation = true
mapView.setCameraZoomRange(.init(minCenterCoordinateDistance: 333, maxCenterCoordinateDistance: 5000), animated: true)
#warning("setCameraZoomRange 주석")
// mapView.setCameraZoomRange(.init(minCenterCoordinateDistance: 333, maxCenterCoordinateDistance: 5000), animated: true)
// Location 불러오기 전 기본값 설정
var currentLocation = CLLocationCoordinate2D(
latitude: 37.277252,
Expand Down Expand Up @@ -298,7 +299,9 @@ extension HomeViewController {
bottomSheetHeight = large
bottomSheet.collectionView.isUserInteractionEnabled = true
}
else if newHeight > (view.frame.height * 0.3) {

else if newHeight > (view.frame.height * 0.25) {
#warning("0.3 -> 0.25")
bottomSheetHeight = medium
bottomSheet.collectionView.isUserInteractionEnabled = true
}
Expand Down
3 changes: 2 additions & 1 deletion Pinit/Pinit/Views/Home/SubViews/CustomBottomSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class CustomBottomSheet: UIView {
let grabber: UIView = {
let grabber = UIView()
grabber.layer.cornerRadius = 4
grabber.backgroundColor = DesignSystemColor.Purple.value
grabber.backgroundColor = DesignSystemColor.Lavender.value
grabber.layer.borderColor = UIColor.white.cgColor
grabber.layer.borderWidth = 1
grabber.clipsToBounds = true
Expand All @@ -33,6 +33,7 @@ final class CustomBottomSheet: UIView {
func setupLayout() {
let cornerRadius = 20.0
self.backgroundColor = .secondarySystemBackground
// self.backgroundColor = DesignSystemColor.Lavender1.value
self.layer.cornerRadius = cornerRadius
// cornerRadius 상단 좌,우측만 적용하기
self.layer.maskedCorners = .init(arrayLiteral: [.layerMaxXMinYCorner, .layerMinXMinYCorner])
Expand Down
24 changes: 14 additions & 10 deletions Pinit/Pinit/Views/PastPin/PastPinViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ final class PastPinViewController: UIViewController {

PinCalendar.backgroundColor = .white
PinCalendar.layer.cornerRadius = 10
PinCalendar.layer.borderColor = DesignSystemColor.Lavender10.value.cgColor
PinCalendar.layer.borderWidth = 2
PinCalendar.locale = Locale.init(identifier: "ko_KR")
PinCalendar.firstWeekday = 1
PinCalendar.appearance.headerDateFormat = "YYYY년 MM월"
Expand All @@ -103,16 +105,18 @@ final class PastPinViewController: UIViewController {

//년월 폰트
PinCalendar.appearance.headerTitleFont = DesignSystemFont.Pretendard_Bold20.value
PinCalendar.appearance.headerTitleColor = .black
PinCalendar.appearance.headerTitleColor = DesignSystemColor.Purple.value
//요일 폰트
PinCalendar.appearance.weekdayFont = DesignSystemFont.Pretendard_Bold12.value
PinCalendar.appearance.weekdayFont = DesignSystemFont.Pretendard_Medium16.value
PinCalendar.appearance.weekdayTextColor = .black
//날짜 폰트
PinCalendar.appearance.titleFont = DesignSystemFont.Pretendard_Medium12.value
PinCalendar.appearance.titleFont = DesignSystemFont.Pretendard_Medium14.value
//오늘
PinCalendar.appearance.todayColor = .systemGray3
PinCalendar.appearance.todayColor = DesignSystemColor.Lavender10.value
PinCalendar.appearance.todaySelectionColor = DesignSystemColor.Purple50.value

//오늘 아님
PinCalendar.appearance.selectionColor = .systemBlue
PinCalendar.appearance.selectionColor = DesignSystemColor.Purple50.value
}
}

Expand All @@ -128,18 +132,18 @@ extension PastPinViewController : FSCalendarDelegate, FSCalendarDataSource, FSCa

}

//해당 pinEntity안에 데이터의 유무에 따라 해당 날짜에 dot이 노출댑니당>.<
func calendar(_ calendar: FSCalendar, numberOfEventsFor date: Date) -> Int {
return pinData.contains { Calendar.current.isDate($0.date, inSameDayAs: date) } ? 1 : 0
}
// //해당 pinEntity안에 데이터의 유무에 따라 해당 날짜에 dot이 노출댑니당>.<
// func calendar(_ calendar: FSCalendar, numberOfEventsFor date: Date) -> Int {
// return pinData.contains { Calendar.current.isDate($0.date, inSameDayAs: date) } ? 1 : 0
// }

func calendar(_ calendar: FSCalendar, appearance: FSCalendarAppearance, titleDefaultColorFor date: Date) -> UIColor? {
let day = Calendar.current.component(.weekday, from: date) - 1

if Calendar.current.shortWeekdaySymbols[day] == "Sun" || Calendar.current.shortWeekdaySymbols[day] == "일" {
return .systemRed //일요일 색
} else if Calendar.current.shortWeekdaySymbols[day] == "Sat" || Calendar.current.shortWeekdaySymbols[day] == "토" {
return .systemBlue //토요일 색
return DesignSystemColor.Purple.value //토요일 색
} else {
return .label //기본색
}
Expand Down
Loading