Skip to content

Commit 62d1c67

Browse files
author
Kim Mincheol
committed
fix: 위치 권한 강제 제거, 위치 권한 요청 문구 수정
1 parent 8dda837 commit 62d1c67

File tree

6 files changed

+152
-152
lines changed

6 files changed

+152
-152
lines changed

Sticky/Features/AppMain.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ struct AppMain: View {
6161
@State private var isActive: Bool = true
6262

6363
private func getRootView() -> AnyView {
64-
if rootViewManager.hasGeofence, locationManager.checkLocationStatus() {
64+
if rootViewManager.hasGeofence {
6565
return AnyView(Main())
6666
} else {
67-
return AnyView(LocationPermission())
67+
return AnyView(Onboarding(type: 0))
6868
}
6969
}
7070
}

Sticky/Features/Onboarding/Onboarding.swift

Lines changed: 139 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import SwiftUI
1010
// MARK: - Onboarding
1111

1212
struct Onboarding: View {
13-
1413
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
1514
@State var SlideGesture = CGSize.zero
1615
@State var SlideOne = false
@@ -22,154 +21,156 @@ struct Onboarding: View {
2221
var type: Int
2322

2423
var body: some View {
25-
VStack {
26-
NavigationLink(destination: SearchAddress(), isActive: $isEndOnboarding) {
27-
EmptyView()
28-
}
29-
HStack {
24+
NavigationView {
25+
VStack {
26+
NavigationLink(destination: SearchAddress(), isActive: $isEndOnboarding) {
27+
EmptyView()
28+
}
29+
HStack {
30+
Spacer()
31+
Button(action: {
32+
isEndOnboarding = true
33+
}, label: {
34+
Text("건너뛰기")
35+
}).padding(.trailing, 16)
36+
.padding(.top, 16)
37+
.font(.custom("AppleSDGothicNeo", size: 14))
38+
.foregroundColor(Color.GrayScale._500)
39+
.isHidden(type != 0)
40+
}
3041
Spacer()
31-
Button(action: {
32-
isEndOnboarding = true
33-
}, label: {
34-
Text("건너뛰기")
35-
}).padding(.trailing, 16)
36-
.padding(.top, 16)
37-
.font(.custom("AppleSDGothicNeo", size: 14))
38-
.foregroundColor(Color.GrayScale._500)
39-
.isHidden(type != 0)
40-
}
41-
Spacer()
42-
ZStack {
43-
Onboarding3()
44-
.offset(x: SlideGesture.width)
45-
.offset(x: SlideTwo ? 0 : 500)
46-
.animation(.spring())
47-
48-
.gesture(
49-
DragGesture().onChanged { value in
50-
self.SlideGesture = value.translation
51-
}
52-
.onEnded { _ in
53-
if self.SlideGesture.width > 150 {
54-
self.SlideTwo = false
55-
self.SlideTwoPrevious = true
42+
ZStack {
43+
Onboarding3()
44+
.offset(x: SlideGesture.width)
45+
.offset(x: SlideTwo ? 0 : 500)
46+
.animation(.spring())
47+
48+
.gesture(
49+
DragGesture().onChanged { value in
50+
self.SlideGesture = value.translation
5651
}
57-
self.SlideGesture = .zero
58-
let impactMed = UIImpactFeedbackGenerator(style: .medium)
59-
impactMed.impactOccurred()
60-
}
61-
)
62-
63-
Onboarding2()
64-
.offset(x: SlideGesture.width)
65-
.offset(x: SlideOne ? 0 : 500)
66-
.offset(x: SlideOnePrevious ? 500 : 0)
67-
.offset(x: SlideTwo ? -500 : 0)
68-
.animation(.spring())
69-
70-
.gesture(
71-
DragGesture().onChanged { value in
72-
self.SlideGesture = value.translation
73-
}
74-
.onEnded { _ in
75-
if self.SlideGesture.width < -150 {
76-
self.SlideOne = true
77-
self.SlideTwo = true
52+
.onEnded { _ in
53+
if self.SlideGesture.width > 150 {
54+
self.SlideTwo = false
55+
self.SlideTwoPrevious = true
56+
}
57+
self.SlideGesture = .zero
58+
let impactMed = UIImpactFeedbackGenerator(style: .medium)
59+
impactMed.impactOccurred()
7860
}
79-
80-
if self.SlideGesture.width > 150 {
81-
self.SlideOnePrevious = true
82-
self.SlideOne = false
61+
)
62+
63+
Onboarding2()
64+
.offset(x: SlideGesture.width)
65+
.offset(x: SlideOne ? 0 : 500)
66+
.offset(x: SlideOnePrevious ? 500 : 0)
67+
.offset(x: SlideTwo ? -500 : 0)
68+
.animation(.spring())
69+
70+
.gesture(
71+
DragGesture().onChanged { value in
72+
self.SlideGesture = value.translation
8373
}
84-
self.SlideGesture = .zero
85-
let impactMed = UIImpactFeedbackGenerator(style: .medium)
86-
impactMed.impactOccurred()
87-
}
88-
)
74+
.onEnded { _ in
75+
if self.SlideGesture.width < -150 {
76+
self.SlideOne = true
77+
self.SlideTwo = true
78+
}
79+
80+
if self.SlideGesture.width > 150 {
81+
self.SlideOnePrevious = true
82+
self.SlideOne = false
83+
}
84+
self.SlideGesture = .zero
85+
let impactMed = UIImpactFeedbackGenerator(style: .medium)
86+
impactMed.impactOccurred()
87+
}
88+
)
8989

90-
Onboarding1()
91-
.offset(x: SlideGesture.width)
92-
.offset(x: SlideOne ? -500 : 0)
90+
Onboarding1()
91+
.offset(x: SlideGesture.width)
92+
.offset(x: SlideOne ? -500 : 0)
9393

94-
.animation(.spring())
94+
.animation(.spring())
9595

96-
.gesture(
97-
DragGesture().onChanged { value in
98-
self.SlideGesture = value.translation
99-
}
100-
.onEnded { _ in
101-
if self.SlideGesture.width < -150 {
102-
self.SlideOne = true
103-
self.SlideOnePrevious = false
96+
.gesture(
97+
DragGesture().onChanged { value in
98+
self.SlideGesture = value.translation
99+
}
100+
.onEnded { _ in
101+
if self.SlideGesture.width < -150 {
102+
self.SlideOne = true
103+
self.SlideOnePrevious = false
104+
}
105+
self.SlideGesture = .zero
106+
let impactMed = UIImpactFeedbackGenerator(style: .medium)
107+
impactMed.impactOccurred()
104108
}
105-
self.SlideGesture = .zero
106-
let impactMed = UIImpactFeedbackGenerator(style: .medium)
107-
impactMed.impactOccurred()
109+
)
110+
}
111+
Spacer()
112+
HStack {
113+
Circle()
114+
.frame(width: 8, height: 8)
115+
.foregroundColor(SlideOne ? Color.GrayScale._200 : Color.Palette.primary)
116+
Circle()
117+
.frame(width: 8, height: 8)
118+
.foregroundColor(SlideOne && !SlideTwo ? Color.Palette.primary : Color.GrayScale._200)
119+
Circle()
120+
.frame(width: 8, height: 8)
121+
.foregroundColor(SlideTwo ? Color.Palette.primary : Color.GrayScale._200)
122+
}
123+
.padding(.bottom, 28)
124+
ZStack {
125+
Button(action: {
126+
if type == 0 {
127+
self.isEndOnboarding = true
128+
} else {
129+
NotificationCenter.default.post(name: .endAboutSticky, object: nil)
108130
}
109-
)
110-
}
111-
Spacer()
112-
HStack {
113-
Circle()
114-
.frame(width: 8, height: 8)
115-
.foregroundColor(SlideOne ? Color.GrayScale._200 : Color.Palette.primary)
116-
Circle()
117-
.frame(width: 8, height: 8)
118-
.foregroundColor(SlideOne && !SlideTwo ? Color.Palette.primary : Color.GrayScale._200)
119-
Circle()
120-
.frame(width: 8, height: 8)
121-
.foregroundColor(SlideTwo ? Color.Palette.primary : Color.GrayScale._200)
122-
}
123-
.padding(.bottom, 28)
124-
ZStack {
125-
Button(action: {
126-
if type == 0 {
127-
self.isEndOnboarding = true
128-
}else{
129-
NotificationCenter.default.post(name: .endAboutSticky, object: nil)
130-
}
131-
}, label: {
132-
Text( type == 0 ? "시작하기" : "완료")
133-
.font(.custom("AppleSDGothicNeo", size: 17))
134-
.foregroundColor(Color.white)
135-
})
136-
.frame(width: 160, height: 60)
137-
.background(Color.Palette.primary)
138-
.cornerRadius(20)
139-
.animation(.spring())
140-
.offset(x: SlideTwo ? 0 : 500)
141-
.shadow(color: Color("shadow"), radius: 24, x: 0, y: 4)
142-
143-
Button(action: {
144-
if !SlideOne {
145-
self.SlideOne = true
146-
self.SlideOnePrevious = false
147-
} else if !SlideTwo {
148-
self.SlideOne = true
149-
self.SlideTwo = true
150-
}
151-
let impactMed = UIImpactFeedbackGenerator(style: .medium)
152-
impactMed.impactOccurred()
153-
}, label: {
154-
Text("다음")
155-
.font(.custom("AppleSDGothicNeo", size: 17))
156-
.foregroundColor(Color.Palette.primary)
157-
158-
})
159-
.frame(width: 160, height: 60)
160-
.background(Color.white)
161-
.cornerRadius(20)
162-
.animation(.spring())
163-
.offset(x: SlideTwo ? -500 : 0)
164-
.shadow(color: Color("shadow"), radius: 24, x: 0, y: 4)
131+
}, label: {
132+
Text(type == 0 ? "시작하기" : "완료")
133+
.font(.custom("AppleSDGothicNeo", size: 17))
134+
.foregroundColor(Color.white)
135+
})
136+
.frame(width: 160, height: 60)
137+
.background(Color.Palette.primary)
138+
.cornerRadius(20)
139+
.animation(.spring())
140+
.offset(x: SlideTwo ? 0 : 500)
141+
.shadow(color: Color("shadow"), radius: 24, x: 0, y: 4)
142+
143+
Button(action: {
144+
if !SlideOne {
145+
self.SlideOne = true
146+
self.SlideOnePrevious = false
147+
} else if !SlideTwo {
148+
self.SlideOne = true
149+
self.SlideTwo = true
150+
}
151+
let impactMed = UIImpactFeedbackGenerator(style: .medium)
152+
impactMed.impactOccurred()
153+
}, label: {
154+
Text("다음")
155+
.font(.custom("AppleSDGothicNeo", size: 17))
156+
.foregroundColor(Color.Palette.primary)
157+
158+
})
159+
.frame(width: 160, height: 60)
160+
.background(Color.white)
161+
.cornerRadius(20)
162+
.animation(.spring())
163+
.offset(x: SlideTwo ? -500 : 0)
164+
.shadow(color: Color("shadow"), radius: 24, x: 0, y: 4)
165+
}
166+
.padding(.bottom, 32)
165167
}
166-
.padding(.bottom, 32)
167-
}
168-
.navigationBarHidden(true)
169-
.onReceive(NotificationCenter.default.publisher(for: .endAboutSticky), perform: { _ in
168+
.navigationBarHidden(true)
169+
.onReceive(NotificationCenter.default.publisher(for: .endAboutSticky), perform: { _ in
170170

171-
presentationMode.wrappedValue.dismiss()
172-
})
171+
presentationMode.wrappedValue.dismiss()
172+
})
173+
}
173174
}
174175
}
175176

Sticky/Features/Onboarding/Views/LocationPermission.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ struct LocationPermission: View {
2424
Spacer()
2525
Image("logo-blue")
2626
.resizable()
27-
.frame(minWidth: /*@START_MENU_TOKEN@*/0/*@END_MENU_TOKEN@*/, maxWidth: /*@START_MENU_TOKEN@*/ .infinity/*@END_MENU_TOKEN@*/,
28-
minHeight: 0, maxHeight: /*@START_MENU_TOKEN@*/ .infinity/*@END_MENU_TOKEN@*/,
29-
alignment: /*@START_MENU_TOKEN@*/ .center/*@END_MENU_TOKEN@*/)
27+
.frame(minWidth: 0, maxWidth: .infinity,
28+
minHeight: 0, maxHeight: .infinity,
29+
alignment: .center)
3030
.scaledToFit()
3131

3232
Text("""

Sticky/Features/SearchAddress/Views/SearchAddress.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct SearchAddress: View {
3939
EditText(
4040
input: $locationSearchService.searchQuery,
4141
placeholder:
42-
locationManager.checkLocationStatus() ? "도로명, 건물명 또는 지번으로 검색" : "위치 정보를 항상으로 체크해주세요.",
42+
"도로명, 건물명 또는 지번으로 검색",
4343
accentColor: .white
4444
)
4545
.padding(.bottom, 8)
@@ -54,7 +54,7 @@ struct SearchAddress: View {
5454
text: "현재 위치로 주소 찾기",
5555
borderWidth: 2.0,
5656
borderColor: Color.Border.primary,
57-
fontColor: locationManager.checkLocationStatus() ? Color.TextIconLight.primary : Color.GrayScale._300,
57+
fontColor: Color.TextIconLight.primary,
5858
icon: "here",
5959
cornerRadius: 16.0
6060
)
@@ -105,7 +105,6 @@ struct SearchAddress: View {
105105
Spacer()
106106
}
107107
}
108-
.allowsHitTesting(locationManager.checkLocationStatus()) // 항상 처리 확인
109108
.navigationBarBackButtonHidden(true)
110109
.navigationBarItems(leading: backButton)
111110
.navigationBarTitle("", displayMode: .inline)

Sticky/en.lproj/InfoPlist.strings

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
*/
88

9-
NSLocationAlwaysAndWhenInUseUsageDescription = "We need access to your location to show you how many accumulate times.";
10-
NSLocationAlwaysUsageDescription = "We need access to your location to show you how many accumulate times.";
11-
NSLocationWhenInUseUsageDescription = "We need access to your location to show you how many accumulate times.";
9+
NSLocationAlwaysAndWhenInUseUsageDescription = "We need access to your location to show you how many accumulate times at position.";
10+
NSLocationAlwaysUsageDescription = "We need access to your location to show you how many accumulate times at position.";
11+
NSLocationWhenInUseUsageDescription = "We need access to your location to show you how many accumulate times at position.";
1212
NSPhotoLibraryUsageDescription = "We need access to your photo library to capture image for sharing";

Sticky/ko.lproj/InfoPlist.strings

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
*/
88

9-
NSLocationAlwaysAndWhenInUseUsageDescription = "내 위치 확인을 위해 권한이 필요합니다.";
10-
NSLocationAlwaysUsageDescription = "내 위치 확인을 위해 권한이 필요합니다.";
11-
NSLocationWhenInUseUsageDescription = "내 위치 확인을 위해 권한이 필요합니다.";
9+
NSLocationAlwaysAndWhenInUseUsageDescription = "위치에 누적 된 시간을 측정하려면 위치 접근 권한이 필요합니다.";
10+
NSLocationAlwaysUsageDescription = "위치에 누적 된 시간을 측정하려면 위치 접근 권한이 필요합니다.";
11+
NSLocationWhenInUseUsageDescription = "위치에 누적 된 시간을 측정하려면 위치 접근 권한이 필요합니다.";
1212
NSPhotoLibraryUsageDescription = "내 화면 캡처를 위해 권한이 필요합니다.";
1313

0 commit comments

Comments
 (0)