Skip to content

Commit

Permalink
Merge pull request #1319 from wakmusic/1317-modify-splash-logo
Browse files Browse the repository at this point in the history
🔀 :: (#1317) 할로윈 스플래시 추가
  • Loading branch information
KangTaeHoon authored Oct 24, 2024
2 parents b70ecd0 + aeee48c commit 4008c69
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/airbnb/lottie-ios.git",
"state" : {
"revision" : "769b88d83a42ca8d5572b020c96f47e3690b3796",
"version" : "4.4.3"
"revision" : "fe4c6fe3a0aa66cdeb51d549623c82ca9704b9a5",
"version" : "4.5.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let package = Package(
.package(url: "https://github.com/devxoul/Then", from: "3.0.0"),
.package(url: "https://github.com/SnapKit/SnapKit.git", from: "5.7.1"),
.package(url: "https://github.com/ashleymills/Reachability.swift", from: "5.2.1"),
.package(url: "https://github.com/airbnb/lottie-ios.git", from: "4.4.3"),
.package(url: "https://github.com/airbnb/lottie-ios.git", from: "4.5.0"),
.package(url: "https://github.com/uber/needle.git", from: "0.24.0"),
.package(url: "https://github.com/uias/Tabman.git", from: "3.2.0"),
.package(url: "https://github.com/RxSwiftCommunity/RxDataSources.git", from: "5.0.2"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ public struct AppCheckEntity: Equatable {
title: String,
description: String,
version: String,
specialLogo: Bool
isSpecialLogo: Bool
) {
self.flag = flag
self.title = title
self.description = description
self.version = version
self.specialLogo = specialLogo
self.isSpecialLogo = isSpecialLogo
}

public let flag: AppCheckFlagType
public let title, description, version: String
public let specialLogo: Bool
public let isSpecialLogo: Bool
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public extension FetchAppCheckResponseDTO {
title: title ?? "",
description: description ?? "",
version: version ?? "",
specialLogo: specialLogo ?? false
isSpecialLogo: specialLogo ?? false
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private extension IntroViewController {
.subscribe(onNext: { owner, result in
switch result {
case let .success(entity):
owner.lottiePlay(specialLogo: entity.specialLogo)
owner.lottiePlay(isSpecialLogo: entity.isSpecialLogo)

var textPopupVc: UIViewController
let updateTitle: String = "왁타버스 뮤직이 업데이트 되었습니다."
Expand Down Expand Up @@ -154,7 +154,7 @@ private extension IntroViewController {
)

case let .failure(error):
owner.lottiePlay(specialLogo: false)
owner.lottiePlay(isSpecialLogo: false)
owner.showBottomSheet(
content: owner.textPopupFactory.makeView(
text: error.asWMError.errorDescription ?? "",
Expand Down Expand Up @@ -222,9 +222,25 @@ private extension IntroViewController {
self.navigationController?.pushViewController(viewController, animated: false)
}

func lottiePlay(specialLogo: Bool) {
func lottiePlay(isSpecialLogo: Bool) {
var logoType: SplashLogoType

if isSpecialLogo {
switch Calendar.current.component(.month, from: Date()) {
case 10:
logoType = .halloween
case 12:
logoType = .xmas
default:
logoType = .usual
}
} else {
logoType = .usual
}
self.view.backgroundColor = logoType == .halloween ? colorFromRGB(0x191A1C) : .white

let animationView = LottieAnimationView(
name: specialLogo ? "Splash_Logo_Special" : "Splash_Logo_Main",
name: logoType.rawValue,
bundle: DesignSystemResources.bundle
)
animationView.frame = self.logoContentView.bounds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public final class IntroViewModel: ViewModelType {
title: "",
description: wmError.errorDescription ?? "",
version: "",
specialLogo: false
isSpecialLogo: false
)
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// SplashLogoType.swift
// RootFeature
//
// Created by KTH on 10/22/24.
// Copyright © 2024 yongbeomkwak. All rights reserved.
//

import Foundation

enum SplashLogoType: String {
case usual = "Splash_Logo_Main"
case halloween = "Splash_Logo_Halloween"
case xmas = "Splash_Logo_Xmas"
}

Large diffs are not rendered by default.

0 comments on commit 4008c69

Please sign in to comment.