|
6 | 6 | // |
7 | 7 | import UIKit |
8 | 8 |
|
9 | | -struct ProducerEntity { |
10 | | - //이름, 위,경도(지역), 생일, 각자사진, 소개, 문구, 기분(날씨) |
11 | | - let title: String |
12 | | - let latitude: Double |
13 | | - let longitude: Double |
14 | | - let date: String |
15 | | - let mediaPath: UIImage |
16 | | - let description: String? |
17 | | - let weather: String |
| 9 | +extension PinEntity { |
| 10 | + |
| 11 | + private static func toDate(_ dateString: String)-> Date { |
| 12 | + let dateFormatter = DateFormatter() |
| 13 | + dateFormatter.dateFormat = "yyyy-MM-dd" |
| 14 | + dateFormatter.timeZone = TimeZone.current // 현재 시간대 사용 |
| 15 | + dateFormatter.locale = Locale(identifier: "ko_KR") // 한국 로캘 설정 (선택사항) |
| 16 | + |
| 17 | + if let date = dateFormatter.date(from: dateString) { |
| 18 | + return date |
| 19 | + }else{ |
| 20 | + return Date() |
| 21 | + } |
| 22 | + } |
18 | 23 |
|
19 | 24 |
|
20 | | - static let sampleData: [ProducerEntity] = [ |
| 25 | + static let producerData: [PinEntity] = [ |
21 | 26 | //데이터 부분들 |
22 | 27 |
|
23 | | - ProducerEntity( |
| 28 | + PinEntity( |
| 29 | + pin_id: UUID(), |
24 | 30 | title: "JustHm", |
25 | 31 | latitude: 37.9244577, |
26 | | - longitude: 128.800009, //본인 지역의 의,경도 |
27 | | - date: "1998-05-01", //생년월일 |
28 | | - mediaPath: UIImage(named: "JustHMImg")!, |
29 | | - description: "안녕하세요 ! 감자 개발자 안정흠입니다!",//istj |
30 | | - weather: "구름"), |
| 32 | + longitude: 128.800009,//본인 지역의 의,경도 |
| 33 | + address: "", |
| 34 | + date: toDate("1998-05-01"), //생년월일 |
| 35 | + weather: "istj", |
| 36 | + description: "안녕하세요 ! 감자 개발자 안정흠입니다!", |
| 37 | + mediaPath: UIImage(named: "JustHMImg")! |
| 38 | + ), |
31 | 39 |
|
32 | | - ProducerEntity( |
| 40 | + PinEntity( |
| 41 | + pin_id: UUID(), |
33 | 42 | title: "Ikhwan0204", |
34 | 43 | latitude: 37.506610, |
35 | | - longitude: 126.885332, //본인 지역의 의,경도 |
36 | | - date: "2002-04-12", //생년월일 |
37 | | - mediaPath: UIImage(named: "Ikhwan0204Img")!, |
38 | | - description: "개발개바발 개발자 이규현입니다.ㅎㅎㅎ", //enfj |
39 | | - weather: "흐림"), |
| 44 | + longitude: 126.885332, |
| 45 | + address: "", |
| 46 | + date: toDate("2002-04-12"), |
| 47 | + weather: "enfj", |
| 48 | + description: "개발개바발 개발자 이규현입니다.ㅎㅎㅎ", |
| 49 | + mediaPath: UIImage(named: "Ikhwan0204Img")! |
| 50 | + ), |
40 | 51 |
|
41 | | - ProducerEntity( |
| 52 | + PinEntity( |
| 53 | + pin_id: UUID(), |
42 | 54 | title: "IntakHan304", |
43 | 55 | latitude: 37.434981, |
44 | | - longitude: 126.902328, //본인 지역의 의,경도 |
45 | | - date: "1991-03-04", //생년월일 |
46 | | - mediaPath: UIImage(named: "IntakHan304Img")!, |
47 | | - description: "나는 누구 입니다3", |
48 | | - weather: "비"), |
| 56 | + longitude: 126.902328, |
| 57 | + address: "", |
| 58 | + date: toDate("1991-03-04"), |
| 59 | + weather: "infj" , |
| 60 | + description: "처음 시작하는 개발자 한인탁 입니다.", |
| 61 | + mediaPath: UIImage(named: "IntakHan304Img")! |
| 62 | + ), |
49 | 63 |
|
50 | | - ProducerEntity( |
| 64 | + PinEntity( |
| 65 | + pin_id: UUID(), |
51 | 66 | title: "HISEHOONAN", |
52 | 67 | latitude: 37.508645, |
53 | | - longitude: 126.703513, //본인 지역의 의,경도 |
54 | | - date: "1998.06.17", //생년월일 |
55 | | - mediaPath: UIImage(named: "HISEHOONImg")! , |
56 | | - description: "안녕하세요 ! 개발새발 개발자 안세훈입니다 !",//infp |
57 | | - weather: "눈"), |
| 68 | + longitude: 126.703513, |
| 69 | + address: "", |
| 70 | + date: toDate("1999.06.17"), |
| 71 | + weather: "infp", |
| 72 | + description: "안녕하세요 ! 개발새발 개발자 안세훈입니다 ! ", |
| 73 | + mediaPath: UIImage(named: "HISEHOONImg")! |
| 74 | + ), |
58 | 75 |
|
59 | | - ProducerEntity( |
| 76 | + PinEntity( |
| 77 | + pin_id: UUID(), |
60 | 78 | title: "kut7728", |
61 | 79 | latitude: 37.554267, |
62 | 80 | longitude: 126.953922, //본인 지역의 의,경도 |
63 | | - date: "1998.03.02", //생년월일 |
64 | | - mediaPath: UIImage(named: "kut7728Img")! , |
65 | | - description: "네이티브 앱, 애플, 테크기기에 관심이 많은 앱 개발자(지망)입니다.", //infj |
66 | | - weather: "맑음") |
| 81 | + address: "", |
| 82 | + date: toDate("1998.03.02"), //생년월일 |
| 83 | + weather: "intj", |
| 84 | + description: "네이티브 앱, 애플, 테크기기에 관심이 많은 앱 개발자(지망)입니다.", // |
| 85 | + mediaPath: UIImage(named: "kut7728Img")! |
| 86 | + ) |
67 | 87 | ] |
68 | 88 | } |
0 commit comments