Skip to content

Commit

Permalink
Refactor: Section 2.4. update
Browse files Browse the repository at this point in the history
### Motivation
- Section 2.4. Create the List of Landmarks

### Key Changes
- Section 2.4. Create the List of Landmarks 예제 코드 및 주석 추가

### To Reviewers
- 없음
  • Loading branch information
garlicvread committed Aug 11, 2022
1 parent e785d93 commit 342acc7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tutorial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
941CE6C628A4B42100484938 /* Landmark.swift in Sources */ = {isa = PBXBuildFile; fileRef = 941CE6C528A4B42100484938 /* Landmark.swift */; };
941CE6C828A4B83C00484938 /* ModelData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 941CE6C728A4B83C00484938 /* ModelData.swift */; };
941CE6CC28A4BC7900484938 /* LandmarkRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 941CE6CB28A4BC7900484938 /* LandmarkRow.swift */; };
941CE6CE28A4C2E400484938 /* LandmarkList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 941CE6CD28A4C2E400484938 /* LandmarkList.swift */; };
9D5E3EBA280475CB0076AFDF /* tutorialApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D5E3EB9280475CB0076AFDF /* tutorialApp.swift */; };
9D5E3EBC280475CB0076AFDF /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D5E3EBB280475CB0076AFDF /* ContentView.swift */; };
9D5E3EC1280475CC0076AFDF /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9D5E3EC0280475CC0076AFDF /* Preview Assets.xcassets */; };
Expand All @@ -29,6 +30,7 @@
941CE6C528A4B42100484938 /* Landmark.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Landmark.swift; sourceTree = "<group>"; };
941CE6C728A4B83C00484938 /* ModelData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelData.swift; sourceTree = "<group>"; };
941CE6CB28A4BC7900484938 /* LandmarkRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkRow.swift; sourceTree = "<group>"; };
941CE6CD28A4C2E400484938 /* LandmarkList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LandmarkList.swift; sourceTree = "<group>"; };
9D5E3EB6280475CB0076AFDF /* SwiftUITutorialWithNotes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftUITutorialWithNotes.app; sourceTree = BUILT_PRODUCTS_DIR; };
9D5E3EB9280475CB0076AFDF /* tutorialApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = tutorialApp.swift; sourceTree = "<group>"; };
9D5E3EBB280475CB0076AFDF /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -63,6 +65,7 @@
941CE6B928A4963700484938 /* CircleImage.swift */,
941CE6C128A499BD00484938 /* MapView.swift */,
941CE6CB28A4BC7900484938 /* LandmarkRow.swift */,
941CE6CD28A4C2E400484938 /* LandmarkList.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -187,6 +190,7 @@
941CE6BB28A4963700484938 /* CircleImage.swift in Sources */,
941CE6C228A499BD00484938 /* MapView.swift in Sources */,
9D5E3EBA280475CB0076AFDF /* tutorialApp.swift in Sources */,
941CE6CE28A4C2E400484938 /* LandmarkList.swift in Sources */,
940ECDAE28A37ECF00092638 /* MainContentView.swift in Sources */,
941CE6C628A4B42100484938 /* Landmark.swift in Sources */,
941CE6CC28A4BC7900484938 /* LandmarkRow.swift in Sources */,
Expand Down
Binary file not shown.
23 changes: 23 additions & 0 deletions tutorial/Views/LandmarkList.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// LandmarkList.swift
// tutorial
//
// Created by 김제필 on 8/11/22.
//

import SwiftUI

struct LandmarkList: View {
var body: some View {
List { // 2.4.2. List 객체 내부에 LandmarkRow 인스턴스를 배치한다
LandmarkRow(landmark: landmarks[0])
LandmarkRow(landmark: landmarks[1])
}
}
}

struct LandmarkList_Previews: PreviewProvider {
static var previews: some View {
LandmarkList()
}
}
4 changes: 4 additions & 0 deletions tutorial/Views/LandmarkRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ struct LandmarkRow_Previews: PreviewProvider {
.previewLayout(.fixed(width: 300, height: 70))
}
}


// 여기까지 마쳤다면 LandmarkList.swift 파일을 생성하자.
// 해당 파일은 SwiftUIView 파일이다.

0 comments on commit 342acc7

Please sign in to comment.