diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/Color/home_gradient1.colorset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/Color/home_gradient1.colorset/Contents.json new file mode 100644 index 00000000..04541345 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/Color/home_gradient1.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0xF7", + "green" : "0xF7", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0xF7", + "green" : "0xF7", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/Color/home_gradient2.colorset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/Color/home_gradient2.colorset/Contents.json new file mode 100644 index 00000000..1f95df3d --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/Color/home_gradient2.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0xFD", + "green" : "0xFD", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0xFD", + "green" : "0xFD", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_character.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_character.imageset/Contents.json new file mode 100644 index 00000000..ee256e45 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_character.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "체리.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_character.imageset/\354\262\264\353\246\254.svg" "b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_character.imageset/\354\262\264\353\246\254.svg" new file mode 100644 index 00000000..d1f6657e --- /dev/null +++ "b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_character.imageset/\354\262\264\353\246\254.svg" @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_logo.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_logo.imageset/Contents.json new file mode 100644 index 00000000..247f6747 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_logo.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "cherrish_logo.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_logo.imageset/cherrish_logo.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_logo.imageset/cherrish_logo.svg new file mode 100644 index 00000000..8be96028 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/cherrish_logo.imageset/cherrish_logo.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar1.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar1.imageset/Contents.json new file mode 100644 index 00000000..a4fdccf7 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar1.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "home_chellenge_bar.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar1.imageset/home_chellenge_bar.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar1.imageset/home_chellenge_bar.svg new file mode 100644 index 00000000..335a36c7 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar1.imageset/home_chellenge_bar.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar2.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar2.imageset/Contents.json new file mode 100644 index 00000000..a5d9fd7b --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "home_chellenge_bar2.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar2.imageset/home_chellenge_bar2.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar2.imageset/home_chellenge_bar2.svg new file mode 100644 index 00000000..a3219da1 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar2.imageset/home_chellenge_bar2.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar3.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar3.imageset/Contents.json new file mode 100644 index 00000000..1f033af1 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "home_chellenge_bar3.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar3.imageset/home_chellenge_bar3.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar3.imageset/home_chellenge_bar3.svg new file mode 100644 index 00000000..1856b9a2 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar3.imageset/home_chellenge_bar3.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar4.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar4.imageset/Contents.json new file mode 100644 index 00000000..6ce25a4f --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar4.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "home_chellenge_bar4.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar4.imageset/home_chellenge_bar4.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar4.imageset/home_chellenge_bar4.svg new file mode 100644 index 00000000..b716ac98 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/home_icon/home_chellenge_bar4.imageset/home_chellenge_bar4.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishPicker.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishPicker.swift new file mode 100644 index 00000000..1a542c7f --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishPicker.swift @@ -0,0 +1,98 @@ +// +// CherrishPicker.swift +// Cherrish-iOS +// +// Created by 송성용 on 1/14/26. +// + +import SwiftUI +import UIKit + +struct CustomWheelPicker: View { + @Binding var selection: Int + let range: ClosedRange + var width: CGFloat = 74.adjustedW + + var body: some View { + ZStack { + RoundedRectangle(cornerRadius: 12) + .fill(.gray300) + .frame(width: width, height: 44.adjustedH) + + PickerViewRepresentable(selection: $selection, range: range) + .frame(width: width + 20.adjustedW, height: 132.adjustedH) + } + .frame(width: width, height: 132.adjustedH) + .clipped() + } +} + +private struct PickerViewRepresentable: UIViewRepresentable { + @Binding var selection: Int + let range: ClosedRange + + func makeUIView(context: Context) -> UIPickerView { + let picker = UIPickerView() + picker.delegate = context.coordinator + picker.dataSource = context.coordinator + + picker.subviews.forEach { subview in + subview.backgroundColor = .clear + } + + let row = selection - range.lowerBound + picker.selectRow(row, inComponent: 0, animated: true) + + return picker + } + + func updateUIView(_ uiView: UIPickerView, context: Context) { + let row = selection - range.lowerBound + if uiView.selectedRow(inComponent: 0) != row { + uiView.selectRow(row, inComponent: 0, animated: true) + } + } + + func makeCoordinator() -> Coordinator { + Coordinator(self) + } +} + +extension PickerViewRepresentable { + class Coordinator: NSObject, UIPickerViewDelegate, UIPickerViewDataSource { + var parent: PickerViewRepresentable + + init(_ parent: PickerViewRepresentable) { + self.parent = parent + } + + func numberOfComponents(in pickerView: UIPickerView) -> Int { + 1 + } + + func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { + parent.range.count + } + + func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { + parent.selection = parent.range.lowerBound + row + } + + func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView { + let label = (view as? UILabel) ?? UILabel() + label.text = "\(parent.range.lowerBound + row)" + label.textAlignment = .center + label.font = UIFont(name: PretendardWeight.medium.rawValue, size: 18) + label.textColor = UIColor(.gray1000) + return label + } + + func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat { + 44.adjustedH + } + + func pickerView(_ pickerView: UIPickerView, widthForComponent component: Int) -> CGFloat { + 60.adjustedW + } + } +}