Skip to content

Commit ec83bf2

Browse files
authored
Merge pull request #28 from Handeul42/HotFix
[fix] hide review button & pop up requestPermission in firstView
2 parents 77aa942 + 4431ad2 commit ec83bf2

File tree

4 files changed

+32
-24
lines changed

4 files changed

+32
-24
lines changed

kWordle/Service/requestPermission.swift

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,26 @@
88
import AdSupport
99
import AppTrackingTransparency
1010
func requestPermission() {
11-
ATTrackingManager.requestTrackingAuthorization { status in
12-
switch status {
13-
case .authorized:
14-
// Tracking authorization dialog was shown
15-
// and we are authorized print("Authorized")
16-
// Now that we are authorized we can get the IDFA
17-
print(ASIdentifierManager.shared().advertisingIdentifier)
18-
case .denied:
19-
// Tracking authorization dialog was
20-
// shown and permission is denied
21-
print("Denied")
22-
case .notDetermined:
23-
// Tracking authorization dialog has not been shown
24-
print("Not Determined")
25-
case .restricted:
26-
print("Restricted")
27-
@unknown default:
28-
print("Unknown")
11+
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
12+
ATTrackingManager.requestTrackingAuthorization { status in
13+
switch status {
14+
case .authorized:
15+
// Tracking authorization dialog was shown
16+
// and we are authorized print("Authorized")
17+
// Now that we are authorized we can get the IDFA
18+
print(ASIdentifierManager.shared().advertisingIdentifier)
19+
case .denied:
20+
// Tracking authorization dialog was
21+
// shown and permission is denied
22+
print("Denied")
23+
case .notDetermined:
24+
// Tracking authorization dialog has not been shown
25+
print("Not Determined")
26+
case .restricted:
27+
print("Restricted")
28+
@unknown default:
29+
print("Unknown")
30+
}
2931
}
3032
}
3133
}

kWordle/View/DictView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ struct DictView: View {
4141
Button {
4242
// viewModel.startNewGame()
4343
} label: {
44-
newGameButton()
44+
todayGameButton()
4545
}
46+
.disabled(true)
4647
Spacer()
4748
Button {
4849
viewModel.startNewGame()
@@ -93,7 +94,7 @@ struct DictView: View {
9394
}
9495
}
9596

96-
private func newGameButton() -> some View {
97+
private func todayGameButton() -> some View {
9798
var timer: Timer {
9899
Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { _ in
99100
self.nowDate = Date()

kWordle/View/SettingView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ struct SettingView: View {
119119
soundButton()
120120
howToPlayButton()
121121
statisticButton()
122-
appReviewButton()
122+
// appReviewButton()
123123
sendMailButton()
124124
Spacer()
125125
}

kWordle/ViewModel/MainViewModel.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,14 @@ func randomAnswerGenerator() -> String {
185185
var randomNumber = Int(generator.next())
186186
var randomAnswer = WordDictManager.shared.wordDictFiveJamo[randomNumber % wordDictCount].jamo
187187
var answers = UserDefaults.standard.stringArray(forKey: "todayAnswers") ?? []
188+
var i = 0
188189
while answers.contains(randomAnswer) {
189-
generator = RandomNumberGeneratorWithSeed(seed: randomNumber)
190190
randomNumber = Int(generator.next())
191-
randomAnswer = WordDictManager.shared.wordDictFiveJamo[randomNumber % wordDictCount].jamo
191+
randomAnswer = WordDictManager.shared.wordDictFiveJamo[(randomNumber) % wordDictCount].jamo
192+
i += 1
193+
if i > 1000 {
194+
break
195+
}
192196
}
193197
answers.append(randomAnswer)
194198
print("Answer: " + randomAnswer)
@@ -199,5 +203,6 @@ func randomAnswerGenerator() -> String {
199203
func DateToSeed() -> Int {
200204
let date = Date()
201205
let today = Calendar.current.dateComponents([.year, .month, .day, .hour], from: date)
202-
return today.year! * 10000 + today.month! * 100 + today.day!
206+
let todaySeed = today.year! * 10000 + today.month! * 100 + today.day!
207+
return todaySeed
203208
}

0 commit comments

Comments
 (0)