Skip to content
Open
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
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Expo1900/.DS_Store
Binary file not shown.
157 changes: 151 additions & 6 deletions Expo1900/Expo1900.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,36 @@
objects = {

/* Begin PBXBuildFile section */
2B07DACF28E41ABA0049B823 /* Expo1900Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B07DACE28E41ABA0049B823 /* Expo1900Tests.swift */; };
2B6F854428ED20D000CE9E76 /* WorkPieceItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B6F854328ED20D000CE9E76 /* WorkPieceItemViewController.swift */; };
2BA683FD28EC05AB00A58B88 /* ExhibitionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BA683FC28EC05AB00A58B88 /* ExhibitionViewController.swift */; };
2BA683FF28EC0BE400A58B88 /* WorkPieceItemTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BA683FE28EC0BE400A58B88 /* WorkPieceItemTableViewCell.swift */; };
C79FF4B52589F401005FB0FD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C79FF4B42589F401005FB0FD /* AppDelegate.swift */; };
C79FF4B72589F401005FB0FD /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C79FF4B62589F401005FB0FD /* SceneDelegate.swift */; };
C79FF4B92589F401005FB0FD /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C79FF4B82589F401005FB0FD /* ViewController.swift */; };
C79FF4BC2589F401005FB0FD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C79FF4BA2589F401005FB0FD /* Main.storyboard */; };
C79FF4BE2589F404005FB0FD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C79FF4BD2589F404005FB0FD /* Assets.xcassets */; };
C79FF4C12589F404005FB0FD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C79FF4BF2589F404005FB0FD /* LaunchScreen.storyboard */; };
FA4B47FB28DAB0D20065700D /* EntryResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4B47FA28DAB0D20065700D /* EntryResponse.swift */; };
FA4B47FB28DAB0D20065700D /* Exhibition.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4B47FA28DAB0D20065700D /* Exhibition.swift */; };
FA4B481D28DC498C0065700D /* WorkPieceInformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4B481C28DC498C0065700D /* WorkPieceInformation.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
2B07DAD028E41ABA0049B823 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = C79FF4A92589F401005FB0FD /* Project object */;
proxyType = 1;
remoteGlobalIDString = C79FF4B02589F401005FB0FD;
remoteInfo = Expo1900;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
2B07DACC28E41ABA0049B823 /* Expo1900Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Expo1900Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2B07DACE28E41ABA0049B823 /* Expo1900Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Expo1900Tests.swift; sourceTree = "<group>"; };
2B6F854328ED20D000CE9E76 /* WorkPieceItemViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkPieceItemViewController.swift; sourceTree = "<group>"; };
2BA683FC28EC05AB00A58B88 /* ExhibitionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExhibitionViewController.swift; sourceTree = "<group>"; };
2BA683FE28EC0BE400A58B88 /* WorkPieceItemTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkPieceItemTableViewCell.swift; sourceTree = "<group>"; };
C79FF4B12589F401005FB0FD /* Expo1900.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Expo1900.app; sourceTree = BUILT_PRODUCTS_DIR; };
C79FF4B42589F401005FB0FD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
C79FF4B62589F401005FB0FD /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -25,10 +45,18 @@
C79FF4BD2589F404005FB0FD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
C79FF4C02589F404005FB0FD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
C79FF4C22589F404005FB0FD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FA4B47FA28DAB0D20065700D /* EntryResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntryResponse.swift; sourceTree = "<group>"; };
FA4B47FA28DAB0D20065700D /* Exhibition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Exhibition.swift; sourceTree = "<group>"; };
FA4B481C28DC498C0065700D /* WorkPieceInformation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkPieceInformation.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
2B07DAC928E41ABA0049B823 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
C79FF4AE2589F401005FB0FD /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -39,10 +67,19 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
2B07DACD28E41ABA0049B823 /* Expo1900Tests */ = {
isa = PBXGroup;
children = (
2B07DACE28E41ABA0049B823 /* Expo1900Tests.swift */,
);
path = Expo1900Tests;
sourceTree = "<group>";
};
325EC45628DAF01A001C3FB2 /* Model */ = {
isa = PBXGroup;
children = (
FA4B47FA28DAB0D20065700D /* EntryResponse.swift */,
FA4B47FA28DAB0D20065700D /* Exhibition.swift */,
FA4B481C28DC498C0065700D /* WorkPieceInformation.swift */,
);
path = Model;
sourceTree = "<group>";
Expand All @@ -62,6 +99,9 @@
C79FF4B82589F401005FB0FD /* ViewController.swift */,
C79FF4B62589F401005FB0FD /* SceneDelegate.swift */,
C79FF4B42589F401005FB0FD /* AppDelegate.swift */,
2BA683FC28EC05AB00A58B88 /* ExhibitionViewController.swift */,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

파일위치를 수정하면 좋을 거같아요! 커스텀 셀과 앱,씬 딜리게이트, 뷰컨트롤러들끼리 섞여있군요!

2BA683FE28EC0BE400A58B88 /* WorkPieceItemTableViewCell.swift */,
2B6F854328ED20D000CE9E76 /* WorkPieceItemViewController.swift */,
);
path = Controller;
sourceTree = "<group>";
Expand All @@ -70,6 +110,7 @@
isa = PBXGroup;
children = (
C79FF4B32589F401005FB0FD /* Expo1900 */,
2B07DACD28E41ABA0049B823 /* Expo1900Tests */,
C79FF4B22589F401005FB0FD /* Products */,
);
sourceTree = "<group>";
Expand All @@ -78,15 +119,16 @@
isa = PBXGroup;
children = (
C79FF4B12589F401005FB0FD /* Expo1900.app */,
2B07DACC28E41ABA0049B823 /* Expo1900Tests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
C79FF4B32589F401005FB0FD /* Expo1900 */ = {
isa = PBXGroup;
children = (
325EC45828DAF029001C3FB2 /* Controller */,
325EC45728DAF023001C3FB2 /* View */,
325EC45828DAF029001C3FB2 /* Controller */,
325EC45628DAF01A001C3FB2 /* Model */,
C79FF4BD2589F404005FB0FD /* Assets.xcassets */,
C79FF4C22589F404005FB0FD /* Info.plist */,
Expand All @@ -97,6 +139,24 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
2B07DACB28E41ABA0049B823 /* Expo1900Tests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2B07DAD428E41ABA0049B823 /* Build configuration list for PBXNativeTarget "Expo1900Tests" */;
buildPhases = (
2B07DAC828E41ABA0049B823 /* Sources */,
2B07DAC928E41ABA0049B823 /* Frameworks */,
2B07DACA28E41ABA0049B823 /* Resources */,
);
buildRules = (
);
dependencies = (
2B07DAD128E41ABA0049B823 /* PBXTargetDependency */,
);
name = Expo1900Tests;
productName = Expo1900Tests;
productReference = 2B07DACC28E41ABA0049B823 /* Expo1900Tests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
C79FF4B02589F401005FB0FD /* Expo1900 */ = {
isa = PBXNativeTarget;
buildConfigurationList = C79FF4C52589F404005FB0FD /* Build configuration list for PBXNativeTarget "Expo1900" */;
Expand All @@ -120,9 +180,13 @@
C79FF4A92589F401005FB0FD /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1210;
LastSwiftUpdateCheck = 1400;
LastUpgradeCheck = 1210;
TargetAttributes = {
2B07DACB28E41ABA0049B823 = {
CreatedOnToolsVersion = 14.0;
TestTargetID = C79FF4B02589F401005FB0FD;
};
C79FF4B02589F401005FB0FD = {
CreatedOnToolsVersion = 12.1;
};
Expand All @@ -142,11 +206,19 @@
projectRoot = "";
targets = (
C79FF4B02589F401005FB0FD /* Expo1900 */,
2B07DACB28E41ABA0049B823 /* Expo1900Tests */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
2B07DACA28E41ABA0049B823 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
C79FF4AF2589F401005FB0FD /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -160,19 +232,39 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
2B07DAC828E41ABA0049B823 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2B07DACF28E41ABA0049B823 /* Expo1900Tests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
C79FF4AD2589F401005FB0FD /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C79FF4B92589F401005FB0FD /* ViewController.swift in Sources */,
2B6F854428ED20D000CE9E76 /* WorkPieceItemViewController.swift in Sources */,
FA4B481D28DC498C0065700D /* WorkPieceInformation.swift in Sources */,
C79FF4B52589F401005FB0FD /* AppDelegate.swift in Sources */,
FA4B47FB28DAB0D20065700D /* EntryResponse.swift in Sources */,
FA4B47FB28DAB0D20065700D /* Exhibition.swift in Sources */,
C79FF4B72589F401005FB0FD /* SceneDelegate.swift in Sources */,
2BA683FF28EC0BE400A58B88 /* WorkPieceItemTableViewCell.swift in Sources */,
2BA683FD28EC05AB00A58B88 /* ExhibitionViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
2B07DAD128E41ABA0049B823 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = C79FF4B02589F401005FB0FD /* Expo1900 */;
targetProxy = 2B07DAD028E41ABA0049B823 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
C79FF4BA2589F401005FB0FD /* Main.storyboard */ = {
isa = PBXVariantGroup;
Expand All @@ -193,6 +285,50 @@
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
2B07DAD228E41ABA0049B823 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MACOSX_DEPLOYMENT_TARGET = 12.3;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = class.Expo1900Tests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Expo1900.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Expo1900";
};
name = Debug;
};
2B07DAD328E41ABA0049B823 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MACOSX_DEPLOYMENT_TARGET = 12.3;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = class.Expo1900Tests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Expo1900.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Expo1900";
};
name = Release;
};
C79FF4C32589F404005FB0FD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -348,6 +484,15 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
2B07DAD428E41ABA0049B823 /* Build configuration list for PBXNativeTarget "Expo1900Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2B07DAD228E41ABA0049B823 /* Debug */,
2B07DAD328E41ABA0049B823 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C79FF4AC2589F401005FB0FD /* Build configuration list for PBXProject "Expo1900" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
6 changes: 0 additions & 6 deletions Expo1900/Expo1900/Assets.xcassets/expo_assets/Contents.json

This file was deleted.

65 changes: 65 additions & 0 deletions Expo1900/Expo1900/Controller/ExhibitionViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//
// ExhibitionViewController.swift
// Expo1900
//
// Created by 임채윤 on 2022/10/04.
//

import UIKit

class ExhibitionViewController: UIViewController {
@IBOutlet weak var workPieceItemTableView: UITableView!
@IBOutlet weak var navigationBarItem: UINavigationItem!

var workPieceInformationData = [WorkPieceInformation]()

let cellName = "workPieceItemCell"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cell identifier를 상수로 저장한 부분 너무 좋습니다 👍
다만 특정 메서드에서만 사용하는 상수라면 해당 메서드 내부에서 선언해주세요!


override func viewDidLoad() {
super.viewDidLoad()
workPieceInformationJsonParsingData()
workPieceItemTableView.delegate = self
workPieceItemTableView.dataSource = self
}

func workPieceInformationJsonParsingData() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main VC에서 언급했던 내용처럼 파싱 모델을 만들어서 구현해보면 좋을 거같아요!

let jsonDecoder = JSONDecoder()
guard let dataAsset = NSDataAsset(name: "items"),
let data = try? jsonDecoder.decode([WorkPieceInformation].self, from: dataAsset.data) else { return }

workPieceInformationData = data
}

override func viewWillAppear(_ animated: Bool) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

viewDidLoad 메서드와 다른 위치에 있군요!
생명주기 메서드는 순서별로 같은 위치상에 있으면 읽기 좋답니다 ㅎㅎ

navigationBarItem.title = "한국의 출품작"
self.navigationController?.navigationBar.isHidden = false
}

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "workPieceItemDetail" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

segue의 identifier를 통해 데이터를 전달했군요!
이 방법도 있지만 TableView의 선택된 Indexpath의 Row의 내용을 그대로 전달하는 방법은 어떨까요??
WorkPieceItemViewController와 협동해서 구현해보면 좋을 거같아요!

지금 방식도 틀리지는 않습니다 !! 😀

if let destination = segue.destination as? WorkPieceItemViewController {
if let selectedIndex = self.workPieceItemTableView.indexPathForSelectedRow?.row {
destination.prepareImage = workPieceInformationData[selectedIndex].imageName
destination.prepareDescriptionLabel = workPieceInformationData[selectedIndex].description
destination.prepareTitleName = workPieceInformationData[selectedIndex].name
}
}
}
}
}

extension ExhibitionViewController: UITableViewDataSource, UITableViewDelegate {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return workPieceInformationData.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let workPieceItemCell = workPieceItemTableView.dequeueReusableCell(withIdentifier: cellName, for: indexPath) as? WorkPieceItemTableViewCell else { return UITableViewCell() }

workPieceItemCell.workPieceItemImageView.image = UIImage(named: workPieceInformationData[indexPath.row].imageName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

커스텀 셀 타입에서 메서드를 통해 조금 더 간결하게 표현해보세요!! 💪

workPieceItemCell.workPieceItemTitleLabel.text = workPieceInformationData[indexPath.row].name
workPieceItemCell.workPieceItemDescriptionLabel.text = workPieceInformationData[indexPath.row].shortDescription

return workPieceItemCell
}
}
Loading