Skip to content

Commit

Permalink
Merge pull request #14 from DeveloperAcademy-POSTECH/Feat/#11
Browse files Browse the repository at this point in the history
Feat/#11
  • Loading branch information
TopiaYu authored Aug 19, 2024
2 parents 8d19228 + 210a5fb commit f6c928b
Show file tree
Hide file tree
Showing 13 changed files with 403 additions and 39 deletions.
12 changes: 10 additions & 2 deletions MC2Maps.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/* Begin PBXBuildFile section */
A88329EE2C6DEBCC00D6CC87 /* MapLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = A88329ED2C6DEBCC00D6CC87 /* MapLocation.swift */; };
A88329F22C71EA6100D6CC87 /* ModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A88329F12C71EA6100D6CC87 /* ModalView.swift */; };
A88CEC682C73164200B4B1EF /* Timetest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A88CEC672C73164200B4B1EF /* Timetest.swift */; };
EAF2746D2C1C6B2C00D90AEA /* MC2MapsApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF2746C2C1C6B2C00D90AEA /* MC2MapsApp.swift */; };
EAF2746F2C1C6B2C00D90AEA /* MapsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF2746E2C1C6B2C00D90AEA /* MapsView.swift */; };
EAF274712C1C6B2E00D90AEA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAF274702C1C6B2E00D90AEA /* Assets.xcassets */; };
Expand All @@ -16,6 +18,8 @@

/* Begin PBXFileReference section */
A88329ED2C6DEBCC00D6CC87 /* MapLocation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapLocation.swift; sourceTree = "<group>"; };
A88329F12C71EA6100D6CC87 /* ModalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalView.swift; sourceTree = "<group>"; };
A88CEC672C73164200B4B1EF /* Timetest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Timetest.swift; sourceTree = "<group>"; };
EAF274692C1C6B2C00D90AEA /* MC2Maps.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MC2Maps.app; sourceTree = BUILT_PRODUCTS_DIR; };
EAF2746C2C1C6B2C00D90AEA /* MC2MapsApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MC2MapsApp.swift; sourceTree = "<group>"; };
EAF2746E2C1C6B2C00D90AEA /* MapsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapsView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -57,7 +61,9 @@
EAF5A4462C22D14600EA2907 /* Info.plist */,
EAF2746C2C1C6B2C00D90AEA /* MC2MapsApp.swift */,
EAF2746E2C1C6B2C00D90AEA /* MapsView.swift */,
A88329F12C71EA6100D6CC87 /* ModalView.swift */,
A88329ED2C6DEBCC00D6CC87 /* MapLocation.swift */,
A88CEC672C73164200B4B1EF /* Timetest.swift */,
EAF274702C1C6B2E00D90AEA /* Assets.xcassets */,
EAF274722C1C6B2E00D90AEA /* Preview Content */,
);
Expand Down Expand Up @@ -144,6 +150,8 @@
files = (
EAF2746F2C1C6B2C00D90AEA /* MapsView.swift in Sources */,
EAF2746D2C1C6B2C00D90AEA /* MC2MapsApp.swift in Sources */,
A88CEC682C73164200B4B1EF /* Timetest.swift in Sources */,
A88329F22C71EA6100D6CC87 /* ModalView.swift in Sources */,
A88329EE2C6DEBCC00D6CC87 /* MapLocation.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -278,7 +286,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"MC2Maps/Preview Content\"";
DEVELOPMENT_TEAM = RQW4ABCWWT;
DEVELOPMENT_TEAM = J75PB3W4SD;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MC2Maps/Info.plist;
Expand Down Expand Up @@ -310,7 +318,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"MC2Maps/Preview Content\"";
DEVELOPMENT_TEAM = RQW4ABCWWT;
DEVELOPMENT_TEAM = J75PB3W4SD;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MC2Maps/Info.plist;
Expand Down
Binary file not shown.
Binary file added MC2Maps/Assets.xcassets/.DS_Store
Binary file not shown.
Binary file modified MC2Maps/Assets.xcassets/네잎.imageset/네잎.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions MC2Maps/Assets.xcassets/네잎원.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "네잎원.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified MC2Maps/Assets.xcassets/세잎.imageset/세잎.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions MC2Maps/Assets.xcassets/세잎원.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "세잎원.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion MC2Maps/MapLocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ final class GeoServiceManager: NSObject, CLLocationManagerDelegate {
let locality = address.locality ?? ""
let subLocality = address.subLocality ?? ""
let subThoroughfare = address.subThoroughfare ?? ""
let fullAddress = "\(country) \(administrativeArea) \(locality) \(subLocality) \(subThoroughfare)"
let fullAddress = "\(country)\n\(administrativeArea)\n\(locality)\n\(subLocality)\n\(subThoroughfare)"



DispatchQueue.main.async {
Expand Down
56 changes: 20 additions & 36 deletions MC2Maps/MapsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ struct MapsView: View {
@State private var hasStayedAtLocation: Bool = false // 현재 위치에서 00초 이상 머물렀는지 여부
@State private var cloverCounts: (threeLeaf: Int, fourLeaf: Int) = (0, 0) // 세잎, 네잎 클로버 수


let geoServiceManager = GeoServiceManager()
let maxAnnotations = 48 // 최대 어노테이션 수
let gridSize = 6
let cellSize = 0.0001
Expand Down Expand Up @@ -148,45 +146,31 @@ struct MapsView: View {
checkMidnight()
}
//MARK: 올라오는 모달 : 네잎클로바 선택시
.sheet(item: $selectedSpecialAnnotation) { annotation in
VStack {
HStack{
Text("네잎클로버")
.font(.title)
Image("네잎")
.resizable()
.frame(width: 30,height: 30)
}
Text("북: \(annotation.coordinate.latitude)")
Text("동: \(annotation.coordinate.longitude)")
// 도로명 주소 표시
if let roadAddress = roadAddress {
Text("주소: \(roadAddress)")
} else {
Text("주소를 불러오는 중...")
.onAppear {
let location = CLLocation(latitude: annotation.coordinate.latitude,
longitude: annotation.coordinate.longitude)
geoServiceManager.getRoadAddress(for: location) { address in
self.roadAddress = address
}
}
}
Text("오늘은 이곳에서 00만큼 머물렀습니다")
// 클로버 수 표시
Text("세잎 클로버: \(cloverCounts.threeLeaf)")
Text("네잎 클로버: \(cloverCounts.fourLeaf)")
.sheet(item: $selectedSpecialAnnotation)
{ annotation in
ScrollView{
VStack {
HStack {
Spacer()

Button("Close") {
selectedSpecialAnnotation = nil
}
Spacer()

.presentationDetents([.fraction(0.1), .medium, .large])
.presentationDragIndicator(.visible)
.presentationBackgroundInteraction(.enabled)
.interactiveDismissDisabled()
}
.padding(.trailing, 18)
//클로버 수 표시
Text("세잎 클로버: \(cloverCounts.threeLeaf)")
Text("네잎 클로버: \(cloverCounts.fourLeaf)")
.presentationDetents([.fraction(0.1), .medium, .large])
.presentationDragIndicator(.visible)
.presentationBackgroundInteraction(.enabled)
.interactiveDismissDisabled()

}
Spacer()
}
}

}

//MARK: 어노테이션을 추가하는 함수
Expand Down
Loading

0 comments on commit f6c928b

Please sign in to comment.