Skip to content

Commit

Permalink
Merge pull request #1 from HoonHaChoi/feat-2-side-dish_model
Browse files Browse the repository at this point in the history
Feat 1, 2 (feat-1-Initial_UI) and (feat-2-side-dish_model)
  • Loading branch information
HoonHaChoi committed Apr 19, 2021
2 parents fffce18 + 104d23e commit 63d2844
Show file tree
Hide file tree
Showing 12 changed files with 372 additions and 37 deletions.
56 changes: 44 additions & 12 deletions Side-dish/Side-dish.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,31 @@
objects = {

/* Begin PBXBuildFile section */
8844B7BF262D6C3000FA49E9 /* FoodCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8844B7BE262D6C3000FA49E9 /* FoodCardCell.swift */; };
8844B7C4262D6ED500FA49E9 /* FoodCardCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8844B7C3262D6ED500FA49E9 /* FoodCardCell.xib */; };
8844B7D0262DB6A500FA49E9 /* Item.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8844B7CF262DB6A500FA49E9 /* Item.swift */; };
8844B7D4262DBA3F00FA49E9 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8844B7D3262DBA3F00FA49E9 /* Category.swift */; };
BFCE4953262D4891006C0882 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCE4952262D4891006C0882 /* AppDelegate.swift */; };
BFCE4955262D4891006C0882 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCE4954262D4891006C0882 /* SceneDelegate.swift */; };
BFCE4957262D4891006C0882 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCE4956262D4891006C0882 /* ViewController.swift */; };
BFCE495A262D4891006C0882 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFCE4958262D4891006C0882 /* Main.storyboard */; };
BFCE495C262D4895006C0882 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BFCE495B262D4895006C0882 /* Assets.xcassets */; };
BFCE495F262D4895006C0882 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFCE495D262D4895006C0882 /* LaunchScreen.storyboard */; };
BFCE496F262D883F006C0882 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFCE496E262D883F006C0882 /* Main.storyboard */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
8844B7BE262D6C3000FA49E9 /* FoodCardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FoodCardCell.swift; sourceTree = "<group>"; };
8844B7C3262D6ED500FA49E9 /* FoodCardCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FoodCardCell.xib; sourceTree = "<group>"; };
8844B7CF262DB6A500FA49E9 /* Item.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Item.swift; sourceTree = "<group>"; };
8844B7D3262DBA3F00FA49E9 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = "<group>"; };
BFCE494F262D4891006C0882 /* Side-dish.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Side-dish.app"; sourceTree = BUILT_PRODUCTS_DIR; };
BFCE4952262D4891006C0882 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
BFCE4954262D4891006C0882 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
BFCE4956262D4891006C0882 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
BFCE4959262D4891006C0882 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
BFCE495B262D4895006C0882 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
BFCE495E262D4895006C0882 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
BFCE4960262D4895006C0882 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BFCE496E262D883F006C0882 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -37,6 +45,32 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
8844B7C1262D6CEC00FA49E9 /* View */ = {
isa = PBXGroup;
children = (
8844B7BE262D6C3000FA49E9 /* FoodCardCell.swift */,
8844B7C3262D6ED500FA49E9 /* FoodCardCell.xib */,
);
path = View;
sourceTree = "<group>";
};
8844B7CD262DB62C00FA49E9 /* DataLayer */ = {
isa = PBXGroup;
children = (
8844B7CE262DB63B00FA49E9 /* Model */,
);
path = DataLayer;
sourceTree = "<group>";
};
8844B7CE262DB63B00FA49E9 /* Model */ = {
isa = PBXGroup;
children = (
8844B7CF262DB6A500FA49E9 /* Item.swift */,
8844B7D3262DBA3F00FA49E9 /* Category.swift */,
);
path = Model;
sourceTree = "<group>";
};
BFCE4946262D4891006C0882 = {
isa = PBXGroup;
children = (
Expand All @@ -56,10 +90,12 @@
BFCE4951262D4891006C0882 /* Side-dish */ = {
isa = PBXGroup;
children = (
8844B7CD262DB62C00FA49E9 /* DataLayer */,
BFCE4952262D4891006C0882 /* AppDelegate.swift */,
BFCE4954262D4891006C0882 /* SceneDelegate.swift */,
8844B7C1262D6CEC00FA49E9 /* View */,
BFCE4956262D4891006C0882 /* ViewController.swift */,
BFCE4958262D4891006C0882 /* Main.storyboard */,
BFCE496E262D883F006C0882 /* Main.storyboard */,
BFCE495B262D4895006C0882 /* Assets.xcassets */,
BFCE495D262D4895006C0882 /* LaunchScreen.storyboard */,
BFCE4960262D4895006C0882 /* Info.plist */,
Expand Down Expand Up @@ -124,9 +160,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8844B7C4262D6ED500FA49E9 /* FoodCardCell.xib in Resources */,
BFCE495F262D4895006C0882 /* LaunchScreen.storyboard in Resources */,
BFCE495C262D4895006C0882 /* Assets.xcassets in Resources */,
BFCE495A262D4891006C0882 /* Main.storyboard in Resources */,
BFCE496F262D883F006C0882 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -137,23 +174,18 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8844B7D0262DB6A500FA49E9 /* Item.swift in Sources */,
BFCE4957262D4891006C0882 /* ViewController.swift in Sources */,
BFCE4953262D4891006C0882 /* AppDelegate.swift in Sources */,
BFCE4955262D4891006C0882 /* SceneDelegate.swift in Sources */,
8844B7BF262D6C3000FA49E9 /* FoodCardCell.swift in Sources */,
8844B7D4262DBA3F00FA49E9 /* Category.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
BFCE4958262D4891006C0882 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
BFCE4959262D4891006C0882 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
BFCE495D262D4895006C0882 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Side-dish.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
24 changes: 0 additions & 24 deletions Side-dish/Side-dish/Base.lproj/Main.storyboard

This file was deleted.

18 changes: 18 additions & 0 deletions Side-dish/Side-dish/DataLayer/Model/Category.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Category.swift
// Side-dish
//
// Created by 조중윤 on 2021/04/19.
//

import Foundation

struct Category: Codable {
let categoryID, name: String
let items: [Item]

enum CodingKeys: String, CodingKey {
case categoryID = "category_id"
case name, items
}
}
41 changes: 41 additions & 0 deletions Side-dish/Side-dish/DataLayer/Model/Item.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// Item.swift
// Side-dish
//
// Created by 조중윤 on 2021/04/19.
//

import Foundation

struct Item: Codable {
let detailHash: String
let image: String
let alt: String
let deliveryType: [DeliveryType]
let title: String
let description: String
let nPrice: String?
let sPrice: String
let badge: [Badge]?

enum CodingKeys: String, CodingKey {
case detailHash = "detail_hash"
case image, alt
case deliveryType = "delivery_type"
case title, description
case nPrice = "n_price"
case sPrice = "s_price"
case badge
}
}

enum DeliveryType: String, Codable {
case dawnDelivery = "새벽배송"
case nationDelivery = "전국택배"
}

enum Badge: String, Codable {
case eventPrice = "이벤트특가"
case launchingPrice = "론칭특가"
case bestPrice = "베스트"
}
82 changes: 82 additions & 0 deletions Side-dish/Side-dish/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ETQ-co-NCv">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="collection view cell content view" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="d8q-YB-ASa">
<objects>
<viewController id="hGp-I0-H3m" customClass="ViewController" customModule="Side_dish" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="fGK-fr-HD1">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="glv-hr-1Zj">
<rect key="frame" x="16" y="44" width="382" height="818"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="FJY-EJ-ivF">
<size key="itemSize" width="128" height="128"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="dzH-tk-cUT">
<rect key="frame" x="0.0" y="0.0" width="128" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<collectionViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="RFm-4m-Skm">
<rect key="frame" x="0.0" y="0.0" width="128" height="128"/>
<autoresizingMask key="autoresizingMask"/>
</collectionViewCellContentView>
</collectionViewCell>
</cells>
</collectionView>
</subviews>
<viewLayoutGuide key="safeArea" id="ACr-dB-SwI"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="glv-hr-1Zj" firstAttribute="leading" secondItem="fGK-fr-HD1" secondAttribute="leading" constant="16" id="8j6-e1-g9S"/>
<constraint firstItem="ACr-dB-SwI" firstAttribute="trailing" secondItem="glv-hr-1Zj" secondAttribute="trailing" constant="16" id="Ynq-eS-ldS"/>
<constraint firstItem="ACr-dB-SwI" firstAttribute="bottom" secondItem="glv-hr-1Zj" secondAttribute="bottom" id="jmP-nE-ybx"/>
<constraint firstItem="glv-hr-1Zj" firstAttribute="top" secondItem="ACr-dB-SwI" secondAttribute="top" id="oG6-0X-53F"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="jHs-wW-jUC"/>
<connections>
<outlet property="SideDishCollectionView" destination="glv-hr-1Zj" id="vmT-N9-uG7"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ySh-Mg-ZVv" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="983" y="141"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="SKe-cE-aiu">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" navigationBarHidden="YES" id="ETQ-co-NCv" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="N5n-Eh-W6D">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="hGp-I0-H3m" kind="relationship" relationship="rootViewController" id="zth-7w-ZeX"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Eqb-zu-rEU" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="278" y="129"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
1 change: 1 addition & 0 deletions Side-dish/Side-dish/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
}
}


18 changes: 18 additions & 0 deletions Side-dish/Side-dish/View/FoodCardCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// FoodCardCell.swift
// Side-dish
//
// Created by 조중윤 on 2021/04/19.
//

import UIKit

class FoodCardCell: UICollectionViewCell {
static var identifier: String {
return String(describing: self)
}

static var nib : UINib {
return UINib(nibName: identifier, bundle: nil)
}
}
Loading

0 comments on commit 63d2844

Please sign in to comment.