diff --git a/Codingdong-iOS/Codingdong-iOS.xcodeproj/project.pbxproj b/Codingdong-iOS/Codingdong-iOS.xcodeproj/project.pbxproj index 3175b5f..557bd78 100644 --- a/Codingdong-iOS/Codingdong-iOS.xcodeproj/project.pbxproj +++ b/Codingdong-iOS/Codingdong-iOS.xcodeproj/project.pbxproj @@ -74,6 +74,7 @@ A80B88282ADB9A2400091FF5 /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = A80B88272ADB9A2400091FF5 /* RxCocoa */; }; A80B882A2ADB9A2400091FF5 /* RxRelay in Frameworks */ = {isa = PBXBuildFile; productRef = A80B88292ADB9A2400091FF5 /* RxRelay */; }; A80B883C2ADBA3EC00091FF5 /* .swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = A80B883B2ADBA3EC00091FF5 /* .swiftlint.yml */; }; + A81018552B196EFA007E8475 /* tiger.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = A81018542B196EFA007E8475 /* tiger.mp3 */; }; A81637242ADFC5FD0070DAC9 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81637232ADFC5FD0070DAC9 /* Constants.swift */; }; A827FA252B0DB36300E6B7B8 /* CddDBService.swift in Sources */ = {isa = PBXBuildFile; fileRef = A827FA242B0DB36300E6B7B8 /* CddDBService.swift */; }; A828A66B2AFF05DB00B11D71 /* CardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A828A66A2AFF05DB00B11D71 /* CardView.swift */; }; @@ -183,6 +184,7 @@ A80A05322AFFCA9000624BBC /* OnboardingViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingViewModel.swift; sourceTree = ""; }; A80A05342AFFCE9C00624BBC /* MyBookShelfViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyBookShelfViewModel.swift; sourceTree = ""; }; A80B883B2ADBA3EC00091FF5 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = ""; }; + A81018542B196EFA007E8475 /* tiger.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = tiger.mp3; sourceTree = ""; }; A81637232ADFC5FD0070DAC9 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; A827FA242B0DB36300E6B7B8 /* CddDBService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CddDBService.swift; sourceTree = ""; }; A828A66A2AFF05DB00B11D71 /* CardView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CardView.swift; sourceTree = ""; }; @@ -781,6 +783,7 @@ A8F41D2B2AE4FC3900BB0260 /* Sound */ = { isa = PBXGroup; children = ( + A81018542B196EFA007E8475 /* tiger.mp3 */, A8A482062AE5E7EA00FDE35C /* bell.mp3 */, A8F41D2C2AE4FC4200BB0260 /* piano.wav */, ); @@ -920,6 +923,7 @@ 116A953F2ADF72570096760A /* Pretendard-ExtraBold.otf in Resources */, 116A954E2ADF72570096760A /* Pretendard-Light.otf in Resources */, 116A95392ADF72570096760A /* Pretendard-SemiBold.otf in Resources */, + A81018552B196EFA007E8475 /* tiger.mp3 in Resources */, 116A95362ADF72570096760A /* Pretendard-Black.otf in Resources */, 116A95482ADF72570096760A /* Pretendard-Regular.otf in Resources */, A83392A82ADAB35E009BA7E2 /* Assets.xcassets in Resources */, diff --git a/Codingdong-iOS/Codingdong-iOS/Presentation/The Sun and the moon/SM_Concept1/ViewController/TtekkkochiViewController.swift b/Codingdong-iOS/Codingdong-iOS/Presentation/The Sun and the moon/SM_Concept1/ViewController/TtekkkochiViewController.swift index 24de710..9ec6df9 100644 --- a/Codingdong-iOS/Codingdong-iOS/Presentation/The Sun and the moon/SM_Concept1/ViewController/TtekkkochiViewController.swift +++ b/Codingdong-iOS/Codingdong-iOS/Presentation/The Sun and the moon/SM_Concept1/ViewController/TtekkkochiViewController.swift @@ -158,15 +158,16 @@ final class TtekkkochiViewController: UIViewController, ConfigUI { } func binding() { + initializeView() self.bottomView.setup(with: viewModel) self.viewModel.route .receive(on: DispatchQueue.main) .sink(receiveValue: { [weak self] nextView in - for index in (0...4) { answerBlocks[index].isShowing = false } self?.navigationController?.pushViewController(nextView, animated: false) }) .store(in: &cancellable) - + + self.bottomView.$selectedValue .zip(bottomView.$initialValue) .sink { [weak self] value in @@ -174,6 +175,7 @@ final class TtekkkochiViewController: UIViewController, ConfigUI { guard value.1 else { return } guard let self = self else { return } + // 정답일 때 if (index > -1 && index < 5) && (answerBlocks[index].value == value.0) { answerBlocks[index].isShowing = true DispatchQueue.global().async { @@ -213,9 +215,25 @@ final class TtekkkochiViewController: UIViewController, ConfigUI { .store(in: &cancellable) } + func initializeView() { + (0...4).forEach { + answerBlocks[$0].isShowing = false + selectBlocks[$0].isAccessible = true + selectBlocks[$0].isShowing = true + + ttekkkochiCollectionView.reloadData() + bottomView.ttekkkochiCollectionView.reloadData() + } + } + @objc func popThisView() { - (0...4).forEach { answerBlocks[$0].isShowing = false } + + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { + self.ttekkkochiCollectionView.reloadData() + self.bottomView.ttekkkochiCollectionView.reloadData() + } + self.navigationController?.pushViewController(CustomAlert(), animated: false) } } diff --git a/Codingdong-iOS/Codingdong-iOS/Presentation/The Sun and the moon/SM_Concept2/ViewController/WindowHoleViewController.swift b/Codingdong-iOS/Codingdong-iOS/Presentation/The Sun and the moon/SM_Concept2/ViewController/WindowHoleViewController.swift index 0793636..58dd5f1 100644 --- a/Codingdong-iOS/Codingdong-iOS/Presentation/The Sun and the moon/SM_Concept2/ViewController/WindowHoleViewController.swift +++ b/Codingdong-iOS/Codingdong-iOS/Presentation/The Sun and the moon/SM_Concept2/ViewController/WindowHoleViewController.swift @@ -190,16 +190,19 @@ extension WindowHoleViewController { case .hand: tigerHandHoleAnimationView.lottieView.accessibilityLabel = "손톱이 날카로운 호랑이 손" HapticManager.shared?.playSplash() + SoundManager.shared.playSound(sound: .tiger) LottieManager.shared.playAnimation(inView: tigerHandHoleAnimationView.lottieView, completion: nil) LottieManager.shared.removeAnimation(inView: tigerHandHoleAnimationView.lottieView) case .nose: tigerNoseHoleAnimationView.lottieView.accessibilityLabel = "킁킁 거리고 있는 호랑이 코" HapticManager.shared?.playSplash() + SoundManager.shared.playSound(sound: .tiger) LottieManager.shared.playAnimation(inView: tigerNoseHoleAnimationView.lottieView, completion: nil) LottieManager.shared.removeAnimation(inView: tigerNoseHoleAnimationView.lottieView) case .tail: tigerTailHoleAnimationView.lottieView.accessibilityLabel = "살랑살랑 흔들리는 호랑이 꼬리" HapticManager.shared?.playSplash() + SoundManager.shared.playSound(sound: .tiger) LottieManager.shared.playAnimation(inView: tigerTailHoleAnimationView.lottieView, completion: nil) LottieManager.shared.removeAnimation(inView: tigerTailHoleAnimationView.lottieView) } diff --git a/Codingdong-iOS/Codingdong-iOS/Util/Manager/SoundManager.swift b/Codingdong-iOS/Codingdong-iOS/Util/Manager/SoundManager.swift index 6c1c55f..8db7b1e 100644 --- a/Codingdong-iOS/Codingdong-iOS/Util/Manager/SoundManager.swift +++ b/Codingdong-iOS/Codingdong-iOS/Util/Manager/SoundManager.swift @@ -15,6 +15,7 @@ class SoundManager { enum SoundList: String { case piano case bell + case tiger } func playSound(sound: SoundList) { diff --git a/Codingdong-iOS/Codingdong-iOS/Util/Resources/Sound/tiger.mp3 b/Codingdong-iOS/Codingdong-iOS/Util/Resources/Sound/tiger.mp3 new file mode 100644 index 0000000..fa70895 Binary files /dev/null and b/Codingdong-iOS/Codingdong-iOS/Util/Resources/Sound/tiger.mp3 differ