Skip to content

Commit

Permalink
[Merge] #169 - 로딩뷰 QA 이슈 수정
Browse files Browse the repository at this point in the history
Fix [#168] 로딩뷰 QA 이슈 수정
  • Loading branch information
boogios authored Mar 22, 2024
2 parents 8b704d2 + 5a07640 commit 76f1e7a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
1 change: 0 additions & 1 deletion DontBe-iOS/DontBe-iOS/Global/Literals/StringLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ enum StringLiterals {

enum Loading {
static let loadingMessageTitle = "알고 계셨나요?"
static let loadingMessage1 = "온라인 상에서도 비속어를\n사용하지 않은 사람들이\n실제 행복지수가 더 높다고 해요."
static let loadingMessage2 = "Don’t be는 그저 온화한 커뮤니티가 아닌\n온화하면서도 재밌을 수 있는 커뮤니티를 지향해요."
static let loadingMessage3 = "Don’t be의 온화함을 해치는 글이 보인다면\n직접 투명도 기능을 눌러보세요!"
static let loadingMessage4 = "Don’t be 팀은 온화한 커뮤니티를 만들기 위해\n저희부터 온화한 팀이 되고자 노력하고 있어요."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import Lottie
final class DontBeLoadingView: UIView {

private var loadingText: String = ""
private var loadingTexts = [StringLiterals.Loading.loadingMessage1,
StringLiterals.Loading.loadingMessage2,
private var loadingTexts = [StringLiterals.Loading.loadingMessage2,
StringLiterals.Loading.loadingMessage3,
StringLiterals.Loading.loadingMessage4,
StringLiterals.Loading.loadingMessage5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,27 @@ final class DontBeTabBarController: UITabBarController {
extension DontBeTabBarController: UITabBarControllerDelegate {

func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
if selectedIndex == 1 {
self.selectedIndex = 0
}

if selectedIndex == 2 {
self.tabBar.items?[2].image = ImageLiterals.TabBar.icnNotificationRead
}

if beforeIndex == 2 && self.selectedIndex == 0 {
showLoadingView()
if beforeIndex == 2 {
if self.selectedIndex == 0 {
showLoadingView()
print("여기는 \(self.selectedIndex)")
}
}

if beforeIndex == 3 {
if self.selectedIndex == 0 {
showLoadingView()
print("여기는 \(self.selectedIndex)")
}
}

if beforeIndex == 3 && self.selectedIndex == 0 {
showLoadingView()
if selectedIndex == 1 {
self.selectedIndex = 0
hideLoadingView()
}

if let selectedViewController = tabBarController.selectedViewController {
Expand Down Expand Up @@ -215,8 +222,14 @@ extension DontBeTabBarController {
loadingView.show()

DispatchQueue.main.asyncAfter(deadline: .now() + 1.4) {
loadingView.hide {
}
loadingView.hide()
}
}

private func hideLoadingView() {
let loadingView = DontBeLoadingView()
DispatchQueue.main.async {
loadingView.hide()
}
}
}

0 comments on commit 76f1e7a

Please sign in to comment.