Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

디자인 변경사항 적용 #73

Merged
merged 8 commits into from
Nov 13, 2021
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
8 changes: 8 additions & 0 deletions HikingClub.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
06AB8CC0273287B4007F32AA /* CategoryTabCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 06AB8CBE273287B4007F32AA /* CategoryTabCollectionViewCell.xib */; };
06B68F9727228FF9007174E1 /* NDSearchTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06B68F9627228FF9007174E1 /* NDSearchTextField.swift */; };
06BC1F74271C1B79001A6584 /* NDAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06BC1F73271C1B79001A6584 /* NDAlert.swift */; };
06BE34932740225400F4917A /* CategoryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06BE34922740225400F4917A /* CategoryModel.swift */; };
06BE349527403FFB00F4917A /* EmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06BE349427403FFB00F4917A /* EmptyView.swift */; };
06D4FF2A27390A8400300AE5 /* UserDefault+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06D4FF2927390A8400300AE5 /* UserDefault+.swift */; };
06D4FF2C27390F3900300AE5 /* UserDefaultManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06D4FF2B27390F3900300AE5 /* UserDefaultManager.swift */; };
06D4FF2F273939C100300AE5 /* RecentSearchUserDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06D4FF2E273939C100300AE5 /* RecentSearchUserDefault.swift */; };
Expand Down Expand Up @@ -178,6 +180,8 @@
06AB8CBE273287B4007F32AA /* CategoryTabCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CategoryTabCollectionViewCell.xib; sourceTree = "<group>"; };
06B68F9627228FF9007174E1 /* NDSearchTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NDSearchTextField.swift; sourceTree = "<group>"; };
06BC1F73271C1B79001A6584 /* NDAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NDAlert.swift; sourceTree = "<group>"; };
06BE34922740225400F4917A /* CategoryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryModel.swift; sourceTree = "<group>"; };
06BE349427403FFB00F4917A /* EmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyView.swift; sourceTree = "<group>"; };
06D4FF2927390A8400300AE5 /* UserDefault+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefault+.swift"; sourceTree = "<group>"; };
06D4FF2B27390F3900300AE5 /* UserDefaultManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultManager.swift; sourceTree = "<group>"; };
06D4FF2E273939C100300AE5 /* RecentSearchUserDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentSearchUserDefault.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -383,6 +387,7 @@
children = (
06D4FF312739452200300AE5 /* CategoryCollectionView.swift */,
06D4FF352739494100300AE5 /* CategoryTabCollectionView.swift */,
06BE349427403FFB00F4917A /* EmptyView.swift */,
);
path = View;
sourceTree = "<group>";
Expand Down Expand Up @@ -622,6 +627,7 @@
isa = PBXGroup;
children = (
7760CA9D27259F53006B39A9 /* PlaceModel.swift */,
06BE34922740225400F4917A /* CategoryModel.swift */,
);
path = Response;
sourceTree = "<group>";
Expand Down Expand Up @@ -898,6 +904,7 @@
06A1ECB12712C10A00EA78D8 /* NDButtonTheme.swift in Sources */,
06A1EC992708A7F300EA78D8 /* UIFont+.swift in Sources */,
77E5913827115F890070F381 /* LoginNavigationViewController.swift in Sources */,
06BE34932740225400F4917A /* CategoryModel.swift in Sources */,
77221371274040C900A42CCA /* InitialSettingViewModel.swift in Sources */,
77C69BE927294775004C2207 /* SignUpInputViewModel.swift in Sources */,
0654DFEE273682CE00B96F15 /* SearchResultViewController.swift in Sources */,
Expand Down Expand Up @@ -948,6 +955,7 @@
06A1EC8E27088F3E00EA78D8 /* HitThemeTableHeaderView.swift in Sources */,
06962E902727FC250021402F /* NDTabButton.swift in Sources */,
06D4FF2C27390F3900300AE5 /* UserDefaultManager.swift in Sources */,
06BE349527403FFB00F4917A /* EmptyView.swift in Sources */,
06A1ECB927198ED200EA78D8 /* UITextField+.swift in Sources */,
06962E93272927770021402F /* SearchViewController.swift in Sources */,
06A1ECA02708CEFA00EA78D8 /* HitThemeHeaderCollectionViewCell.swift in Sources */,
Expand Down
1 change: 1 addition & 0 deletions HikingClub/Feature/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ final class HomeViewController: BaseViewController<HomeViewModel> {
private lazy var locationTabbar: CategoryTabCollectionView = {
let tabbar = CategoryTabCollectionView()
tabbar.backgroundColor = .gray100
tabbar.contentInset = .init(top: 0, left: 16, bottom: 0, right: 70)
tabbar.rx.setDelegate(self).disposed(by: disposeBag)
return tabbar
}()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class HitThemeHeaderCollectionViewCell: UICollectionViewCell {
super.awakeFromNib()
titleLabel.setFont(.semiBold16)
titleLabel.text = "단풍길"
backgroundColor = .gray100
layer.cornerRadius = 12
imageView.image = CategoryIcon(rawValue: "FOOD")?.themeImage
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@
<rect key="frame" x="0.0" y="0.0" width="144" height="104"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="SampleImage" translatesAutoresizingMaskIntoConstraints="NO" id="KVk-nx-1MK">
<rect key="frame" x="37" y="4" width="106" height="94"/>
<constraints>
<constraint firstAttribute="width" constant="106" id="Qb3-w7-GdS"/>
<constraint firstAttribute="height" constant="94" id="a11-rT-WMj"/>
</constraints>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="KVk-nx-1MK">
<rect key="frame" x="0.0" y="0.0" width="144" height="104"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5aY-FN-HGU">
<rect key="frame" x="12" y="71" width="42" height="21"/>
Expand All @@ -35,11 +31,11 @@
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="5aY-FN-HGU" secondAttribute="bottom" constant="12" id="3rt-HU-lo6"/>
<constraint firstAttribute="trailing" secondItem="KVk-nx-1MK" secondAttribute="trailing" constant="1" id="EU1-ae-FDG"/>
<constraint firstAttribute="trailing" secondItem="KVk-nx-1MK" secondAttribute="trailing" id="EU1-ae-FDG"/>
<constraint firstItem="5aY-FN-HGU" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="12" id="Gnw-dL-8iC"/>
<constraint firstItem="KVk-nx-1MK" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="4" id="aA5-BT-WFW"/>
<constraint firstAttribute="bottom" secondItem="KVk-nx-1MK" secondAttribute="bottom" constant="6" id="ak1-jC-9c9"/>
<constraint firstItem="KVk-nx-1MK" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="37" id="y2P-Es-VW9"/>
<constraint firstItem="KVk-nx-1MK" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="aA5-BT-WFW"/>
<constraint firstAttribute="bottom" secondItem="KVk-nx-1MK" secondAttribute="bottom" id="ak1-jC-9c9"/>
<constraint firstItem="KVk-nx-1MK" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="y2P-Es-VW9"/>
</constraints>
<size key="customSize" width="300" height="140"/>
<connections>
Expand All @@ -49,7 +45,4 @@
<point key="canvasLocation" x="-43.478260869565219" y="87.053571428571431"/>
</collectionViewCell>
</objects>
<resources>
<image name="SampleImage" width="343" height="104"/>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import UIKit

final class HitThemeTableHeaderView: UIView {
@IBOutlet private weak var hitThemeLabel: UILabel!
@IBOutlet private weak var collectionView: UICollectionView!
@IBOutlet private weak var iconImageView: UIImageView!

override func awakeFromNib() {
super.awakeFromNib()
Expand All @@ -18,9 +18,7 @@ final class HitThemeTableHeaderView: UIView {
}

func configureUI() {
hitThemeLabel.text = "인기 테마"
hitThemeLabel.setFont(.semiBold20)
hitThemeLabel.textColor = .gray400
iconImageView.setImage(.logo_gray)
}

func setCollectionView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="218"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" insetsLayoutMarginsFromSafeArea="NO" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Kd-bi-zpX">
<rect key="frame" x="50" y="60" width="42" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="gxv-oE-nAa">
<rect key="frame" x="0.0" y="94" width="414" height="104"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
Expand All @@ -34,11 +28,11 @@
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
</collectionView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="AKX-42-I0j">
<rect key="frame" x="16" y="58" width="24" height="24"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="AKX-42-I0j">
<rect key="frame" x="16" y="58" width="81.5" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="24" id="8MH-8o-QYV"/>
<constraint firstAttribute="width" constant="24" id="bEq-x7-iez"/>
<constraint firstAttribute="width" constant="81.5" id="NOS-zB-SLm"/>
</constraints>
</imageView>
</subviews>
Expand All @@ -47,17 +41,15 @@
<constraints>
<constraint firstItem="AKX-42-I0j" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="16" id="8fF-eF-7EG"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="gxv-oE-nAa" secondAttribute="trailing" id="9XB-g5-7bv"/>
<constraint firstItem="4Kd-bi-zpX" firstAttribute="leading" secondItem="AKX-42-I0j" secondAttribute="trailing" constant="10" id="FpL-dX-fwP"/>
<constraint firstItem="gxv-oE-nAa" firstAttribute="top" secondItem="AKX-42-I0j" secondAttribute="bottom" constant="12" id="KI3-il-5Qw"/>
<constraint firstItem="4Kd-bi-zpX" firstAttribute="centerY" secondItem="AKX-42-I0j" secondAttribute="centerY" id="cYf-FG-bhU"/>
<constraint firstItem="gxv-oE-nAa" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="f1e-VE-a98"/>
<constraint firstItem="AKX-42-I0j" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" constant="14" id="pfW-gO-pF2"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="gxv-oE-nAa" secondAttribute="bottom" constant="20" id="qEy-Yv-oSV"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="collectionView" destination="gxv-oE-nAa" id="Wdr-70-VlC"/>
<outlet property="hitThemeLabel" destination="4Kd-bi-zpX" id="tmC-54-mqy"/>
<outlet property="iconImageView" destination="AKX-42-I0j" id="GjW-RJ-xaf"/>
</connections>
<point key="canvasLocation" x="128.98550724637681" y="-49.888392857142854"/>
</view>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class RoadTableViewCell: UITableViewCell {
}

func configure(tags: [String]) {
let num = Int.random(in: 1...4)
roadImageView.image = UIImage(named: "sample_\(num)")
setRoadTitleLabelTopConstraint()
settingRoadHashTagStackView(tags)
titleStackView.spacing = roadImageView.image == nil ? 0 : 14
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19162" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19144"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -80,7 +80,7 @@
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="zQk-L4-qRj">
<rect key="frame" x="16" y="16" width="376" height="193"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="SampleImage" translatesAutoresizingMaskIntoConstraints="NO" id="MiL-Uw-ekf">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="MiL-Uw-ekf">
<rect key="frame" x="0.0" y="0.0" width="376" height="155"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gLG-Qh-DEx">
Expand Down Expand Up @@ -181,7 +181,6 @@
</tableViewCell>
</objects>
<resources>
<image name="SampleImage" width="343" height="104"/>
<image name="icon_contentList_bookMark_selected_yellow_24" width="24" height="24"/>
<image name="icon_footprint_green500_16" width="16" height="16"/>
<image name="icon_location_green500_16" width="16" height="16"/>
Expand Down
41 changes: 37 additions & 4 deletions HikingClub/Feature/Search/Cell/CategoryCollectionViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,39 @@

import UIKit

enum CategoryIcon: String, Decodable {
case nature = "NATURE"
case nightView = "NIGHT_VIEW"
case lake = "LAKE"
case cherryBlossom = "CHERRY_BLOSSOM"
case exercise = "EXERCISE"
case food = "FOOD"
case couple = "LOVER"
case children = "CHILD"
case pet = "PET_DOG"

var icon: UIImage? {
switch self {
case .nature: return AssetImage.icon_category_trees_28.image
case .nightView: return AssetImage.icon_category_moonStar_28.image
case .cherryBlossom: return AssetImage.icon_category_lake_28.image
case .children: return AssetImage.icon_category_kindergartenHat_28.image
case .couple: return AssetImage.icon_category_heart_28.image
case .exercise: return AssetImage.icon_category_sneakers_28.image
case .food: return AssetImage.icon_category_bungeoppang_28.image
case .lake: return AssetImage.icon_category_lake_28.image
case .pet: return AssetImage.icon_category_dog_28.image
}
}

var themeImage: UIImage? {
let num = Int.random(in: 1...4)
return UIImage(named: "sample_\(num)")
}
}

// TODO: 카테고리별 키값에맞게 이미지 넣어주기

final class CategoryCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var imageView: UIImageView!
Expand All @@ -19,12 +52,12 @@ final class CategoryCollectionViewCell: UICollectionViewCell {
private func attribute() {
titleLabel.setFont(.semiBold16)
titleLabel.textColor = .green700
imageView.setImage(.icon_crossX_gray700_16)
backgroundColor = .gray100
backgroundColor = .gray50
layer.cornerRadius = 8
}

func configure(with model: String) {
titleLabel.text = model
func configure(with model: CategoryModel) {
titleLabel.text = model.name
imageView.image = model.key.icon
}
}
Loading