Skip to content

Commit

Permalink
Merge pull request #146 from JYPjoy/feat/#showcase
Browse files Browse the repository at this point in the history
[FEAT] 버그 fix & 음원 추가
  • Loading branch information
JYPjoy authored Dec 1, 2023
2 parents cc6cbf3 + 63bc64d commit 3d85b21
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Codingdong-iOS/Codingdong-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -183,6 +184,7 @@
A80A05322AFFCA9000624BBC /* OnboardingViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingViewModel.swift; sourceTree = "<group>"; };
A80A05342AFFCE9C00624BBC /* MyBookShelfViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyBookShelfViewModel.swift; sourceTree = "<group>"; };
A80B883B2ADBA3EC00091FF5 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = "<group>"; };
A81018542B196EFA007E8475 /* tiger.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = tiger.mp3; sourceTree = "<group>"; };
A81637232ADFC5FD0070DAC9 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
A827FA242B0DB36300E6B7B8 /* CddDBService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CddDBService.swift; sourceTree = "<group>"; };
A828A66A2AFF05DB00B11D71 /* CardView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CardView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -781,6 +783,7 @@
A8F41D2B2AE4FC3900BB0260 /* Sound */ = {
isa = PBXGroup;
children = (
A81018542B196EFA007E8475 /* tiger.mp3 */,
A8A482062AE5E7EA00FDE35C /* bell.mp3 */,
A8F41D2C2AE4FC4200BB0260 /* piano.wav */,
);
Expand Down Expand Up @@ -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 */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,24 @@ 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
guard let index = self?.blockIndex else { return }
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 {
Expand Down Expand Up @@ -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)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class SoundManager {
enum SoundList: String {
case piano
case bell
case tiger
}

func playSound(sound: SoundList) {
Expand Down
Binary file not shown.

0 comments on commit 3d85b21

Please sign in to comment.