Skip to content

Commit

Permalink
[Merge] develop pull
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsubinn committed Jan 21, 2022
2 parents f423fd4 + 0ad916e commit b11dbdf
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class CreateAuthVC: UIViewController {
let photoAuthView = PhotoAuthView()
let timerAuthView = TimerAuthView()
let enterButton = UIButton()
var photoOnly: Bool = true /// photoOnly가 true이면 fromStart가 false
/// photoOnly가 true이면 fromStart가 false
var photoOnly: Bool = true
var roomName: String = ""
var roomId: Int?

Expand Down Expand Up @@ -87,14 +88,15 @@ class CreateAuthVC: UIViewController {

@objc
private func touchEnterButton() {
guard let rootVC = UIStoryboard(name: Const.Storyboard.Name.waiting, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.waiting) as? WaitingVC else { return }

let nextVC = UINavigationController(rootViewController: rootVC)

nextVC.modalTransitionStyle = .crossDissolve
nextVC.modalPresentationStyle = .fullScreen
postCreateRoomWithAPI(roomName: roomName, fromStart: !photoOnly) {
guard let rootVC = UIStoryboard(name: Const.Storyboard.Name.waiting, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.waiting) as? WaitingVC else { return }
rootVC.roomName = self.roomName
rootVC.roomId = self.roomId

let nextVC = UINavigationController(rootViewController: rootVC)
nextVC.modalTransitionStyle = .crossDissolve
nextVC.modalPresentationStyle = .fullScreen

self.present(nextVC, animated: true)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ class HabitRoomVC: UIViewController {
extension HabitRoomVC {
private func setUI() {
navigationController?.isNavigationBarHidden = true

tabBarController?.tabBar.isHidden = true
NotificationCenter.default.post(name: .disappearFloatingButton, object: nil)

habitTitleLabel.font = .h3Subtitle
habitTitleLabel.textColor = .sparkWhite
Expand Down
14 changes: 6 additions & 8 deletions Spark-iOS/Spark-iOS/Source/ViewControllers/Login/LoginVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,12 @@ extension LoginVC {
}
}

private func presentToMainTabBar() {
guard let rootVC = UIStoryboard(name: Const.Storyboard.Name.mainTabBar, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.mainTabBar) as? MainTBC else { return }
private func presentToMainTBC() {
guard let mainVC = UIStoryboard(name: Const.Storyboard.Name.mainTabBar, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.mainTabBar) as? MainTBC else { return }
mainVC.modalPresentationStyle = .fullScreen
mainVC.modalTransitionStyle = .crossDissolve

let nextVC = UINavigationController(rootViewController: rootVC)
nextVC.modalPresentationStyle = .fullScreen
nextVC.modalTransitionStyle = .crossDissolve

present(nextVC, animated: true, completion: nil)
present(mainVC, animated: true, completion: nil)
}
}

Expand Down Expand Up @@ -170,7 +168,7 @@ extension LoginVC {
// 회원 정보를 불러왔습니다.
UserDefaults.standard.set(data.accesstoken, forKey: Const.UserDefaultsKey.accessToken)

self.presentToMainTabBar()
self.presentToMainTBC()
}
}
case .requestErr(let message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,11 @@ class ProfileSettingVC: UIViewController {
}

private func presentToMainTBC() {
guard let rootVC = UIStoryboard(name: Const.Storyboard.Name.mainTabBar, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.mainTabBar) as? MainTBC else { return }
guard let mainVC = UIStoryboard(name: Const.Storyboard.Name.mainTabBar, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.mainTabBar) as? MainTBC else { return }
mainVC.modalPresentationStyle = .fullScreen
mainVC.modalTransitionStyle = .crossDissolve

let nextVC = UINavigationController(rootViewController: rootVC)
nextVC.modalPresentationStyle = .fullScreen
nextVC.modalTransitionStyle = .crossDissolve

present(nextVC, animated: true, completion: nil)
present(mainVC, animated: true, completion: nil)
}

// MARK: - @objc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class SplashVC: UIViewController {

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) {
if self.appDelegate?.isLogin == true {
self.presentToMain()
self.presentToMainTBC()
} else {

// FIXME: - 온보딩 만들면 적용하기
Expand Down Expand Up @@ -101,10 +101,8 @@ extension SplashVC {
}
}

private func presentToMain() {
guard let rootVC = UIStoryboard(name: Const.Storyboard.Name.mainTabBar, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.mainTabBar) as? MainTBC else { return }

let mainVC = UINavigationController(rootViewController: rootVC)
private func presentToMainTBC() {
guard let mainVC = UIStoryboard(name: Const.Storyboard.Name.mainTabBar, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.mainTabBar) as? MainTBC else { return }
mainVC.modalPresentationStyle = .fullScreen
mainVC.modalTransitionStyle = .crossDissolve

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ extension StorageMoreVC {
view.backgroundColor = .sparkBlack
navigationController?.isNavigationBarHidden = false
navigationController?.initWithBackButtonTitle(title: titleText ?? "", tintColor: .sparkWhite, backgroundColor: .sparkBlack)

tabBarController?.tabBar.isHidden = true
}

private func setLayout() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class FeedVC: UIViewController {

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.isNavigationBarHidden = true

NotificationCenter.default.post(name: .disappearFloatingButton, object: nil)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ class HomeVC: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

tabBarController?.tabBar.isHidden = false

navigationController?.isNavigationBarHidden = false
navigationController?.initWithRightTwoCustomButtons(navigationItem: self.navigationItem,
tintColor: .sparkBlack,
backgroundColor: .sparkWhite,
firstButtonSelector: #selector(presentToProfileVC),
secondButtonSelector: #selector(presentToAertVC))

NotificationCenter.default.post(name: .appearFloatingButton, object: nil)

Expand Down
18 changes: 3 additions & 15 deletions Spark-iOS/Spark-iOS/Source/ViewControllers/TabBar/MainTBC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ class MainTBC: UITabBarController {
setNotification()

}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

navigationController?.isNavigationBarHidden = false
navigationController?.initWithRightTwoCustomButtons(navigationItem: self.navigationItem,
tintColor: .sparkBlack,
backgroundColor: .sparkWhite,
firstButtonSelector: #selector(presentToProfileVC),
secondButtonSelector: #selector(presentToAertVC))
}
}

// MARK: - Methods
Expand All @@ -52,11 +41,10 @@ extension MainTBC {

UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.font: UIFont.caption], for: .normal)

// FIXME: - 준호 보관함 테스트해보고 쓰지 않는다면 지우자
// let homeNVC = UINavigationController(rootViewController: homeVC)
// let storageNVC = UINavigationController(rootViewController: storageVC)
let homeNVC = UINavigationController(rootViewController: homeVC)
let storageNVC = UINavigationController(rootViewController: storageVC)

setViewControllers([feedVC, homeVC, storageVC], animated: false)
setViewControllers([feedVC, homeNVC, storageNVC], animated: false)

tabBar.tintColor = .sparkDarkPinkred
tabBar.itemPositioning = .centered
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ class StorageVC: UIViewController {

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

navigationController?.isNavigationBarHidden = true
NotificationCenter.default.post(name: .disappearFloatingButton, object: nil)
tabBarController?.tabBar.isHidden = false
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ class WaitingVC: UIViewController {
}

func setUI() {
tabBarController?.tabBar.isHidden = true
// 플로팅버튼 내리기
NotificationCenter.default.post(name: .disappearFloatingButton, object: nil)

profileImageView.backgroundColor = .sparkLightGray
firstDivideView.backgroundColor = .sparkDarkGray.withAlphaComponent(0.5)
secondDivideView.backgroundColor = .sparkDarkGray.withAlphaComponent(0.5)
Expand Down

0 comments on commit b11dbdf

Please sign in to comment.