2019-2 기말 코딩 문제
코딩 결과물 발표 일자
시험시간표 참조 : 2019.12.19(목) 1반(10:00~10:50), 2반(11:00~11:50), 3반(12:00~12:50)
703실습실, 소스 코드 발표/질의응답
(문제 1) data1.xml 파일을 parsing하여 아래와 같이 [[String:String]] 형태의 자료구조에 결과를 console에 출력하시오.
data1.xml
<root>
<elements>
<item>
<lat>35.166197</lat>
<lng>129.072594</lng>
<title>동의과학대학교</title>
</item>
<item>
<lat>35.166197</lat>
<lng>129.072594</lng>
<title>부산시민공원</title>
</item>
<item>
<lat>35.164437</lat>
<lng>129.064962</lng>
<title>송상현광장</title>
</item>
</elements>
</root>
- 프로그램 출력 결과
[["lat": "35.166025", "lng": "129.072500", "title": "동의과학대학교"],
["lat": "35.168465", "lng": "129.057189", "title": "부산시민공원"],
["lat": "35.164411", "lng": "129.064973", "title": "송상현광장"]]
(문제 2) data1.xml 파일을 parsing하여 위치정보(3개)를 지도(MapView)에 annotation point로 출력하시오. 이때 annotation point는 지도에 꽉차게 하시오(center가 필요 없음).
(문제 3) data2.xml 파일을 parsing하고, 주소(addr)을 geocoding하여 지도(MapView)에 출력하시오.
data2.xml 파일
<root>
<elements>
<item>
<addr> 부산광역시 부산진구 양정동 양지로 54 </addr>
<title>동의과학대학교</title>
</item>
<item>
<addr> 부산광역시 부산진구 범전동 시민공원로 73 </addr>
<title>부산시민공원</title>
</item>
<item>
<addr> 부산광역시 부산진구 전포동 전포2동 중앙대로 818 </addr>
<title>송상현광장</title>
</item>
</elements>
</root>
- 조건 ) 아래
MKMapViewDelegate
method를 사용하여 annotation point의 색깔(Green, Red, Blue)을 바꾸고,CalloutAccessary
를 누를때AlertView
에 메시지를 출력한다.
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) ->MKAnnotationView? {
......
}
func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control:
UIControl) {
UIAlertController
.......
}