generated from 30th-THE-SOPT-iOS-Part/KimTaeHyeon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
159 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 28 additions & 5 deletions
33
Seminar/7th-Seminar/7th-Seminar/Base.lproj/Main.storyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> | ||
<device id="retina6_1" orientation="portrait" appearance="light"/> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="System colors in document resources" minToolsVersion="11.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--View Controller--> | ||
<scene sceneID="tne-QT-ifu"> | ||
<objects> | ||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController"> | ||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="_th_Seminar" customModuleProvider="target" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> | ||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | ||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
<subviews> | ||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="Tlk-7c-rpQ"> | ||
<rect key="frame" x="0.0" y="44" width="414" height="818"/> | ||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | ||
</tableView> | ||
</subviews> | ||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> | ||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | ||
<constraints> | ||
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="Tlk-7c-rpQ" secondAttribute="trailing" id="AXU-se-p8X"/> | ||
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="Tlk-7c-rpQ" secondAttribute="bottom" id="EzY-Zk-Yrh"/> | ||
<constraint firstItem="Tlk-7c-rpQ" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="j4L-ls-EQf"/> | ||
<constraint firstItem="Tlk-7c-rpQ" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="rNG-ZJ-SuC"/> | ||
</constraints> | ||
</view> | ||
<connections> | ||
<outlet property="tableView" destination="Tlk-7c-rpQ" id="mwc-E2-ZtW"/> | ||
</connections> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="35" y="98"/> | ||
</scene> | ||
</scenes> | ||
<resources> | ||
<systemColor name="systemBackgroundColor"> | ||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
</systemColor> | ||
</resources> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// MockParser.swift | ||
// 7th-Seminar | ||
// | ||
// Created by 소연 on 2022/05/28. | ||
// | ||
|
||
import Foundation | ||
|
||
final class MockParser { | ||
static func load<D: Codable>(_ type: D.Type, from resourceName: String) -> D? { | ||
guard let path = Bundle.main.path(forResource: resourceName, ofType: "json") else { | ||
return nil | ||
} | ||
|
||
guard let jsonString = try? String(contentsOfFile: path) else { | ||
return nil | ||
} | ||
|
||
print(jsonString) | ||
|
||
let decoder = JSONDecoder() | ||
let data = jsonString.data(using: .utf8) | ||
print(data) | ||
|
||
guard let data = data else { return nil } | ||
return try? decoder.decode(type, from: data) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[ | ||
{ | ||
"userId": 1, | ||
"id": 1, | ||
"title": "delectus aut autem", | ||
"completed": false | ||
}, | ||
{ | ||
"userId": 1, | ||
"id": 2, | ||
"title": "quis ut nam facilis et officia qui", | ||
"completed": false | ||
}, | ||
{ | ||
"userId": 1, | ||
"id": 3, | ||
"title": "fugiat veniam minus", | ||
"completed": false | ||
}, | ||
{ | ||
"userId": 1, | ||
"id": 4, | ||
"title": "et porro tempora", | ||
"completed": true | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Todo.swift | ||
// 7th-Seminar | ||
// | ||
// Created by 소연 on 2022/05/28. | ||
// | ||
|
||
import Foundation | ||
|
||
struct Todo: Codable { | ||
let userId: Int | ||
let id: Int | ||
let title: String | ||
let completed: Bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// TodoManager.swift | ||
// 7th-Seminar | ||
// | ||
// Created by 소연 on 2022/05/28. | ||
// | ||
|
||
import Foundation | ||
|
||
final class TodoManager { | ||
// service code | ||
static let shared = TodoManager() | ||
private init() {} | ||
} | ||
|
||
extension TodoManager { | ||
func getTodoMock() -> [Todo] { | ||
return MockParser.load([Todo].self, from: "Todo")! | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters