Skip to content

Commit

Permalink
Merge pull request #8 from HoonHaChoi/PR-Unit1-MainUI_and_NetworkRequest
Browse files Browse the repository at this point in the history
[iOS][Neo & JeJe] MainUI and NetworkRequest
  • Loading branch information
HoonHaChoi committed Apr 30, 2021
2 parents 1ae4476 + 60c3a38 commit 7a691ae
Show file tree
Hide file tree
Showing 34 changed files with 1,696 additions and 0 deletions.
486 changes: 486 additions & 0 deletions Side-dish/Side-dish.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
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>
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>
17 changes: 17 additions & 0 deletions Side-dish/Side-dish/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// AppDelegate.swift
// Side-dish
//
// Created by HOONHA CHOI on 2021/04/19.
//

import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions Side-dish/Side-dish/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.176",
"green" : "0.827",
"red" : "0.510"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "0.776",
"red" : "0.525"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
25 changes: 25 additions & 0 deletions Side-dish/Side-dish/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
17 changes: 17 additions & 0 deletions Side-dish/Side-dish/DIContainer.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// DIContainer.swift
// Side-dish
//
// Created by HOONHA CHOI on 2021/04/20.
//

import Foundation

class DIContainer {
static func createDI() -> SideDishViewModel {
let networkManage = NetworkManager()
let useCase = SideDishUseCase(networkManager: networkManage)
let viewModel = SideDishViewModel(sideDishUseCase: useCase)
return viewModel
}
}
40 changes: 40 additions & 0 deletions Side-dish/Side-dish/DataLayer/Model/Item.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// Item.swift
// Side-dish
//
// Created by 조중윤 on 2021/04/19.
//

import Foundation

struct Item: Codable, Hashable {
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 = "론칭특가"
}
13 changes: 13 additions & 0 deletions Side-dish/Side-dish/DataLayer/Model/SideDishes.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Category.swift
// Side-dish
//
// Created by 조중윤 on 2021/04/19.
//

import Foundation

struct SideDishes: Codable {
let statusCode: Int
let body: [Item]
}
39 changes: 39 additions & 0 deletions Side-dish/Side-dish/DataLayer/Network/EndPoint.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// EndPoint.swift
// Side-dish
//
// Created by HOONHA CHOI on 2021/04/19.
//

import Foundation

enum Endpoint {
private static let scheme = "https"
private static let host = "h3rb9c0ugl.execute-api.ap-northeast-2.amazonaws.com"
private static let basicPath = "/develop/baminchan/"

static func url(path : Path) -> URL? {
var components = URLComponents()
components.scheme = Endpoint.scheme
components.host = Endpoint.host
components.path = basicPath + "\(path)"
return components.url
}
}

enum Path: CaseIterable {
case main
case soup
case side

var title : String {
switch self {
case .main:
return "한그릇 뚝딱 메인요리"
case .soup:
return "김이 모락모락 국,찌깨"
case .side:
return "언제 먹어도 든든한 밑반찬"
}
}
}
Loading

0 comments on commit 7a691ae

Please sign in to comment.