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
75 changes: 42 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
## 프로젝트 번호 : 프로젝트 이름

간략한 설명

이 앱의 레퍼런스는 [soapyigu의 Swift-30-Projects Project 04 - TodoTDD](https://github.com/soapyigu/Swift-30-Projects/tree/master/Project%2004%20-%20TodoTDD)입니다.

기본 기능을 모두 구현했다면, 디자인 및 추가 기능 구현은 자유롭게 해주세요.

## 가이드

영상 가이드는 [코드스쿼드 pr연습](https://www.youtube.com/watch?v=lFinZfu3QO0)을 참조해주세요.

1. 본인 이름으로 브랜치(ex: PAKA)를 생성한 후, 자신의 레포로 fork해주세요.

2. fork 한 레포에서 기능 또는 화면 단위로 새 브랜치(ex: pr1)를 생성 후 작업 및 커밋합니다.

3. 커밋했던 브랜치(pr1)에서 자신의 이름 브랜치(PAKA)로 PR을 올려주세요.

4. 코드 리뷰를 받고 모든 수정사항을 반영한 후 `squash and merge` 옵션으로 자신의 브랜치에 merge해주세요.

5. merge했던 브랜치(pr1)에서 fork한 레포의 main 브랜치로 checkout후 해당 브랜치(pr1)를 삭제합니다.

6. 다음 명령어들을 순차적으로 실행합니다.

```
git remote add upstream https://github.com/Swift-Master/Project1-GoodAsOldPhones

git fetch upstream `본인의 브랜치명(ex:PAKA)`

git rebase upstream `upstream/본인의브랜치명(ex:PAKA)`
# Project4 : ToDoTDD

## 20230608

### Main 화면
- Navigation Item으로 Input 화면 이동
- TableView

### Input 화면
- TextField, DatePicker

## 20230609

### MVC 구조 변경
```markdown
- Project
- Sources
- AppDelegate.swift
- SceneDelegate.swift
- Models
- ...
- Views
- ...
- Controllers
- ...
- Helpers
- ...
- Resources
- Assets.xcassets
- ...
- Supporting Files
- Info.plist
- ...
- Tests
- ...
```
info.plist의 경우 루트 경로가 지정되어 있어서 Build Setting에서 경로를 변경해주어야 됨

7. 2번으로 돌아가 새로운 작업을 반복합니다.
### Detail 화면
- `import MapKit`
- 입력한 주소를 지도 가운데로 이동
- Annotation을 사용하여 이동한 주소에 핀을 꽂고, 설명 출력

## 실제 화면
![시뮬레이터화면](./ToDoTDD.gif)
## 구현 화면
<img src="./ToDoTDD_step1.gif" width="300" />
100 changes: 86 additions & 14 deletions ToDoListOfTDD/ToDoListOfTDD.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
objects = {

/* Begin PBXBuildFile section */
653CF0802A31998200581290 /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653CF07F2A31998200581290 /* Model.swift */; };
653CF0822A319A3500581290 /* InputViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653CF0812A319A3500581290 /* InputViewController.swift */; };
653CF0842A31BB2600581290 /* MainTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653CF0832A31BB2600581290 /* MainTableViewCell.swift */; };
653CF08D2A32C2B400581290 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653CF08C2A32C2B400581290 /* DetailViewController.swift */; };
6E52A5502A2108FD009A81D2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E52A54F2A2108FD009A81D2 /* AppDelegate.swift */; };
6E52A5522A2108FD009A81D2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E52A5512A2108FD009A81D2 /* SceneDelegate.swift */; };
6E52A5542A2108FD009A81D2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E52A5532A2108FD009A81D2 /* ViewController.swift */; };
6E52A5542A2108FD009A81D2 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E52A5532A2108FD009A81D2 /* MainViewController.swift */; };
6E52A5572A2108FD009A81D2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6E52A5552A2108FD009A81D2 /* Main.storyboard */; };
6E52A5592A2108FE009A81D2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6E52A5582A2108FE009A81D2 /* Assets.xcassets */; };
6E52A55C2A2108FE009A81D2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6E52A55A2A2108FE009A81D2 /* LaunchScreen.storyboard */; };
Expand All @@ -36,10 +40,14 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
653CF07F2A31998200581290 /* Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = "<group>"; };
653CF0812A319A3500581290 /* InputViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputViewController.swift; sourceTree = "<group>"; };
653CF0832A31BB2600581290 /* MainTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTableViewCell.swift; sourceTree = "<group>"; };
653CF08C2A32C2B400581290 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = "<group>"; };
6E52A54C2A2108FD009A81D2 /* ToDoListOfTDD.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ToDoListOfTDD.app; sourceTree = BUILT_PRODUCTS_DIR; };
6E52A54F2A2108FD009A81D2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
6E52A5512A2108FD009A81D2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
6E52A5532A2108FD009A81D2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
6E52A5532A2108FD009A81D2 /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
6E52A5562A2108FD009A81D2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
6E52A5582A2108FE009A81D2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
6E52A55B2A2108FE009A81D2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -76,6 +84,62 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
653CF0852A32B9F800581290 /* Sources */ = {
isa = PBXGroup;
children = (
653CF08A2A32BA4B00581290 /* Controllers */,
653CF0892A32BA4300581290 /* Views */,
653CF0882A32BA3C00581290 /* Models */,
6E52A5512A2108FD009A81D2 /* SceneDelegate.swift */,
6E52A54F2A2108FD009A81D2 /* AppDelegate.swift */,
);
path = Sources;
sourceTree = "<group>";
};
653CF0862A32BA0900581290 /* Resources */ = {
isa = PBXGroup;
children = (
6E52A5582A2108FE009A81D2 /* Assets.xcassets */,
);
path = Resources;
sourceTree = "<group>";
};
653CF0872A32BA1A00581290 /* SupportingFiles */ = {
isa = PBXGroup;
children = (
6E52A55D2A2108FE009A81D2 /* Info.plist */,
);
path = SupportingFiles;
sourceTree = "<group>";
};
653CF0882A32BA3C00581290 /* Models */ = {
isa = PBXGroup;
children = (
653CF07F2A31998200581290 /* Model.swift */,
);
path = Models;
sourceTree = "<group>";
};
653CF0892A32BA4300581290 /* Views */ = {
isa = PBXGroup;
children = (
653CF0832A31BB2600581290 /* MainTableViewCell.swift */,
6E52A55A2A2108FE009A81D2 /* LaunchScreen.storyboard */,
6E52A5552A2108FD009A81D2 /* Main.storyboard */,
);
path = Views;
sourceTree = "<group>";
};
653CF08A2A32BA4B00581290 /* Controllers */ = {
isa = PBXGroup;
children = (
6E52A5532A2108FD009A81D2 /* MainViewController.swift */,
653CF0812A319A3500581290 /* InputViewController.swift */,
653CF08C2A32C2B400581290 /* DetailViewController.swift */,
);
path = Controllers;
sourceTree = "<group>";
};
6E52A5432A2108FD009A81D2 = {
isa = PBXGroup;
children = (
Expand All @@ -99,13 +163,9 @@
6E52A54E2A2108FD009A81D2 /* ToDoListOfTDD */ = {
isa = PBXGroup;
children = (
6E52A54F2A2108FD009A81D2 /* AppDelegate.swift */,
6E52A5512A2108FD009A81D2 /* SceneDelegate.swift */,
6E52A5532A2108FD009A81D2 /* ViewController.swift */,
6E52A5552A2108FD009A81D2 /* Main.storyboard */,
6E52A5582A2108FE009A81D2 /* Assets.xcassets */,
6E52A55A2A2108FE009A81D2 /* LaunchScreen.storyboard */,
6E52A55D2A2108FE009A81D2 /* Info.plist */,
653CF0872A32BA1A00581290 /* SupportingFiles */,
653CF0862A32BA0900581290 /* Resources */,
653CF0852A32B9F800581290 /* Sources */,
);
path = ToDoListOfTDD;
sourceTree = "<group>";
Expand Down Expand Up @@ -258,9 +318,13 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6E52A5542A2108FD009A81D2 /* ViewController.swift in Sources */,
6E52A5542A2108FD009A81D2 /* MainViewController.swift in Sources */,
653CF0822A319A3500581290 /* InputViewController.swift in Sources */,
6E52A5502A2108FD009A81D2 /* AppDelegate.swift in Sources */,
6E52A5522A2108FD009A81D2 /* SceneDelegate.swift in Sources */,
653CF0842A31BB2600581290 /* MainTableViewCell.swift in Sources */,
653CF0802A31998200581290 /* Model.swift in Sources */,
653CF08D2A32C2B400581290 /* DetailViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -438,22 +502,26 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ToDoListOfTDD/Info.plist;
INFOPLIST_FILE = ToDoListOfTDD/SupportingFiles/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.AKAPUCH.ToDoListOfTDD;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
Expand All @@ -465,22 +533,26 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ToDoListOfTDD/Info.plist;
INFOPLIST_FILE = ToDoListOfTDD/SupportingFiles/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.AKAPUCH.ToDoListOfTDD;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "149131B2-BA73-4837-AC3B-0748220517AA"
type = "1"
version = "2.0">
</Bucket>
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>ToDoListOfTDD.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Binary file added ToDoListOfTDD/ToDoListOfTDD/.DS_Store
Binary file not shown.
24 changes: 0 additions & 24 deletions ToDoListOfTDD/ToDoListOfTDD/Base.lproj/Main.storyboard

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//
// DetailViewController.swift
// ToDoListOfTDD
//
// Created by 편성경 on 2023/06/09.
//

import UIKit
import MapKit

class DetailViewController: UIViewController {

@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var locationLabel: UILabel!

@IBOutlet weak var mapView: MKMapView!

var data: Model?

override func viewDidLoad() {
super.viewDidLoad()

setData()
}

func setData() {
titleLabel.text = data?.title
locationLabel.text = data?.location

getMapData()
}

// MARK: - MapView 설정
func getMapData() {
let geocoder = CLGeocoder()

let address = data!.location

// 주소 -> 위도, 경도 변환
geocoder.geocodeAddressString(address) { placemarks, error in
if let error = error {
print("Geocoder Error : \(error.localizedDescription)")
return
}

if let placemark = placemarks?.first {
let location = placemark.location
if let coordinate = location?.coordinate {
// 위치
let region = MKCoordinateRegion(center: coordinate, latitudinalMeters: 1000, longitudinalMeters: 1000)

// 핀(Annotation)
let annotation = MKPointAnnotation()
annotation.coordinate = CLLocationCoordinate2D(latitude: coordinate.latitude, longitude: coordinate.longitude)
annotation.title = self.data?.title
annotation.subtitle = self.data?.description

self.mapView.addAnnotation(annotation)
self.mapView.setRegion(region, animated: true)
}
}
}
}


}
Loading