Skip to content

Commit

Permalink
✨[FEAT] 시작점 변경 및 프로필 버튼 선택 시 로그인 전환(#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
heerucan committed Nov 12, 2021
1 parent a5bb31a commit 2dd884a
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 87 deletions.
160 changes: 80 additions & 80 deletions Sopt29th-Assignment/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -345,55 +345,55 @@ PODS:
- BoringSSL-GRPC/Implementation (0.0.7):
- BoringSSL-GRPC/Interface (= 0.0.7)
- BoringSSL-GRPC/Interface (0.0.7)
- Firebase/Analytics (8.8.0):
- Firebase/Analytics (8.9.1):
- Firebase/Core
- Firebase/Auth (8.8.0):
- Firebase/Auth (8.9.1):
- Firebase/CoreOnly
- FirebaseAuth (~> 8.8.0)
- Firebase/Core (8.8.0):
- FirebaseAuth (~> 8.9.0)
- Firebase/Core (8.9.1):
- Firebase/CoreOnly
- FirebaseAnalytics (~> 8.8.0)
- Firebase/CoreOnly (8.8.0):
- FirebaseCore (= 8.8.0)
- Firebase/Firestore (8.8.0):
- FirebaseAnalytics (~> 8.9.1)
- Firebase/CoreOnly (8.9.1):
- FirebaseCore (= 8.9.1)
- Firebase/Firestore (8.9.1):
- Firebase/CoreOnly
- FirebaseFirestore (~> 8.8.0)
- Firebase/Messaging (8.8.0):
- FirebaseFirestore (~> 8.9.1)
- Firebase/Messaging (8.9.1):
- Firebase/CoreOnly
- FirebaseMessaging (~> 8.8.0)
- FirebaseAnalytics (8.8.0):
- FirebaseAnalytics/AdIdSupport (= 8.8.0)
- FirebaseMessaging (~> 8.9.0)
- FirebaseAnalytics (8.9.1):
- FirebaseAnalytics/AdIdSupport (= 8.9.1)
- FirebaseCore (~> 8.0)
- FirebaseInstallations (~> 8.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.4)
- GoogleUtilities/MethodSwizzler (~> 7.4)
- GoogleUtilities/Network (~> 7.4)
- "GoogleUtilities/NSData+zlib (~> 7.4)"
- GoogleUtilities/AppDelegateSwizzler (~> 7.6)
- GoogleUtilities/MethodSwizzler (~> 7.6)
- GoogleUtilities/Network (~> 7.6)
- "GoogleUtilities/NSData+zlib (~> 7.6)"
- nanopb (~> 2.30908.0)
- FirebaseAnalytics/AdIdSupport (8.8.0):
- FirebaseAnalytics/AdIdSupport (8.9.1):
- FirebaseCore (~> 8.0)
- FirebaseInstallations (~> 8.0)
- GoogleAppMeasurement (= 8.8.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.4)
- GoogleUtilities/MethodSwizzler (~> 7.4)
- GoogleUtilities/Network (~> 7.4)
- "GoogleUtilities/NSData+zlib (~> 7.4)"
- GoogleAppMeasurement (= 8.9.1)
- GoogleUtilities/AppDelegateSwizzler (~> 7.6)
- GoogleUtilities/MethodSwizzler (~> 7.6)
- GoogleUtilities/Network (~> 7.6)
- "GoogleUtilities/NSData+zlib (~> 7.6)"
- nanopb (~> 2.30908.0)
- FirebaseAuth (8.8.0):
- FirebaseAuth (8.9.0):
- FirebaseCore (~> 8.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.4)
- GoogleUtilities/Environment (~> 7.4)
- GoogleUtilities/AppDelegateSwizzler (~> 7.6)
- GoogleUtilities/Environment (~> 7.6)
- GTMSessionFetcher/Core (~> 1.5)
- FirebaseCore (8.8.0):
- FirebaseCore (8.9.1):
- FirebaseCoreDiagnostics (~> 8.0)
- GoogleUtilities/Environment (~> 7.4)
- GoogleUtilities/Logger (~> 7.4)
- FirebaseCoreDiagnostics (8.8.0):
- GoogleDataTransport (~> 9.0)
- GoogleUtilities/Environment (~> 7.4)
- GoogleUtilities/Logger (~> 7.4)
- GoogleUtilities/Environment (~> 7.6)
- GoogleUtilities/Logger (~> 7.6)
- FirebaseCoreDiagnostics (8.9.0):
- GoogleDataTransport (~> 9.1)
- GoogleUtilities/Environment (~> 7.6)
- GoogleUtilities/Logger (~> 7.6)
- nanopb (~> 2.30908.0)
- FirebaseFirestore (8.8.0):
- FirebaseFirestore (8.9.1):
- abseil/algorithm (= 0.20200225.0)
- abseil/base (= 0.20200225.0)
- abseil/container/flat_hash_map (= 0.20200225.0)
Expand All @@ -406,62 +406,62 @@ PODS:
- "gRPC-C++ (~> 1.28.0)"
- leveldb-library (~> 1.22)
- nanopb (~> 2.30908.0)
- FirebaseInstallations (8.8.0):
- FirebaseInstallations (8.9.0):
- FirebaseCore (~> 8.0)
- GoogleUtilities/Environment (~> 7.4)
- GoogleUtilities/UserDefaults (~> 7.4)
- GoogleUtilities/Environment (~> 7.6)
- GoogleUtilities/UserDefaults (~> 7.6)
- PromisesObjC (< 3.0, >= 1.2)
- FirebaseMessaging (8.8.0):
- FirebaseMessaging (8.9.0):
- FirebaseCore (~> 8.0)
- FirebaseInstallations (~> 8.0)
- GoogleDataTransport (~> 9.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.4)
- GoogleUtilities/Environment (~> 7.4)
- GoogleUtilities/Reachability (~> 7.4)
- GoogleUtilities/UserDefaults (~> 7.4)
- GoogleDataTransport (~> 9.1)
- GoogleUtilities/AppDelegateSwizzler (~> 7.6)
- GoogleUtilities/Environment (~> 7.6)
- GoogleUtilities/Reachability (~> 7.6)
- GoogleUtilities/UserDefaults (~> 7.6)
- nanopb (~> 2.30908.0)
- GoogleAppMeasurement (8.8.0):
- GoogleAppMeasurement/AdIdSupport (= 8.8.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.4)
- GoogleUtilities/MethodSwizzler (~> 7.4)
- GoogleUtilities/Network (~> 7.4)
- "GoogleUtilities/NSData+zlib (~> 7.4)"
- GoogleAppMeasurement (8.9.1):
- GoogleAppMeasurement/AdIdSupport (= 8.9.1)
- GoogleUtilities/AppDelegateSwizzler (~> 7.6)
- GoogleUtilities/MethodSwizzler (~> 7.6)
- GoogleUtilities/Network (~> 7.6)
- "GoogleUtilities/NSData+zlib (~> 7.6)"
- nanopb (~> 2.30908.0)
- GoogleAppMeasurement/AdIdSupport (8.8.0):
- GoogleAppMeasurement/WithoutAdIdSupport (= 8.8.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.4)
- GoogleUtilities/MethodSwizzler (~> 7.4)
- GoogleUtilities/Network (~> 7.4)
- "GoogleUtilities/NSData+zlib (~> 7.4)"
- GoogleAppMeasurement/AdIdSupport (8.9.1):
- GoogleAppMeasurement/WithoutAdIdSupport (= 8.9.1)
- GoogleUtilities/AppDelegateSwizzler (~> 7.6)
- GoogleUtilities/MethodSwizzler (~> 7.6)
- GoogleUtilities/Network (~> 7.6)
- "GoogleUtilities/NSData+zlib (~> 7.6)"
- nanopb (~> 2.30908.0)
- GoogleAppMeasurement/WithoutAdIdSupport (8.8.0):
- GoogleUtilities/AppDelegateSwizzler (~> 7.4)
- GoogleUtilities/MethodSwizzler (~> 7.4)
- GoogleUtilities/Network (~> 7.4)
- "GoogleUtilities/NSData+zlib (~> 7.4)"
- GoogleAppMeasurement/WithoutAdIdSupport (8.9.1):
- GoogleUtilities/AppDelegateSwizzler (~> 7.6)
- GoogleUtilities/MethodSwizzler (~> 7.6)
- GoogleUtilities/Network (~> 7.6)
- "GoogleUtilities/NSData+zlib (~> 7.6)"
- nanopb (~> 2.30908.0)
- GoogleDataTransport (9.1.0):
- GoogleDataTransport (9.1.2):
- GoogleUtilities/Environment (~> 7.2)
- nanopb (~> 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/AppDelegateSwizzler (7.5.2):
- GoogleUtilities/AppDelegateSwizzler (7.6.0):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (7.5.2):
- GoogleUtilities/Environment (7.6.0):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.5.2):
- GoogleUtilities/Logger (7.6.0):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (7.5.2):
- GoogleUtilities/MethodSwizzler (7.6.0):
- GoogleUtilities/Logger
- GoogleUtilities/Network (7.5.2):
- GoogleUtilities/Network (7.6.0):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.5.2)"
- GoogleUtilities/Reachability (7.5.2):
- "GoogleUtilities/NSData+zlib (7.6.0)"
- GoogleUtilities/Reachability (7.6.0):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (7.5.2):
- GoogleUtilities/UserDefaults (7.6.0):
- GoogleUtilities/Logger
- "gRPC-C++ (1.28.2)":
- "gRPC-C++/Implementation (= 1.28.2)"
Expand Down Expand Up @@ -548,17 +548,17 @@ SPEC CHECKSUMS:
abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f
Alamofire: f3b09a368f1582ab751b3fff5460276e0d2cf5c9
BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879
Firebase: 629510f1a9ddb235f3a7c5c8ceb23ba887f0f814
FirebaseAnalytics: 5506ea8b867d8423485a84b4cd612d279f7b0b8a
FirebaseAuth: bcf0adeff88bda5dcb3beeabe5760f1226ab7b2f
FirebaseCore: 98b29e3828f0a53651c363937a7f7d92a19f1ba2
FirebaseCoreDiagnostics: fe77f42da6329d6d83d21fd9d621a6b704413bfc
FirebaseFirestore: 29baf05d5e7e0d5003eb34e5805d92b9858b36d4
FirebaseInstallations: 2563cb18a723ef9c6ef18318a49519b75dce613c
FirebaseMessaging: 419b5c9d84f294a753c6501d8cfb9ced1ce37304
GoogleAppMeasurement: 5ba1164e3c844ba84272555e916d0a6d3d977e91
GoogleDataTransport: 85fd18ff3019bb85d3f2c551d04c481dedf71fc9
GoogleUtilities: 8de2a97a17e15b6b98e38e8770e2d129a57c0040
Firebase: fb5114cd2bf96e2ff7bcb01d0d9a156cf5fd2f07
FirebaseAnalytics: 4ab446ce08a3fe52e8a4303dd997cf26276bf968
FirebaseAuth: 2b78b2a32c07b3ecfa4970bdf1d3632b8304099b
FirebaseCore: c5aab092d9c4b8efea894946166b04c9d9ef0e68
FirebaseCoreDiagnostics: 5daa63f1c1409d981a2d5007daa100b36eac6a34
FirebaseFirestore: 15ae9648476436efed698a909e44c4737498f9b4
FirebaseInstallations: caa7c8e0d3e2345b8829d2fa9ca1b4dfbf2fcc85
FirebaseMessaging: 82c4a48638f53f7b184f3cc9f6cd2cbe533ab316
GoogleAppMeasurement: 837649ad3987936c232f6717c5680216f6243d24
GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940
GoogleUtilities: 684ee790a24f73ebb2d1d966e9711c203f2a4237
"gRPC-C++": 13d8ccef97d5c3c441b7e3c529ef28ebee86fad2
gRPC-Core: 4afa11bfbedf7cdecd04de535a9e046893404ed5
GTMSessionFetcher: 43748f93435c2aa068b1cbe39655aaf600652e91
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
let navigationController = UINavigationController(rootViewController: HomeVC())
let navigationController = UINavigationController(rootViewController: MainTabVC())
navigationController.navigationBar.isHidden = true
window?.rootViewController = navigationController
window?.backgroundColor = .white
window?.makeKeyAndVisible()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import Then

class HomeVC: UIViewController {
class HomeVC: UIViewController, ProfileButtonDelegate {

// MARK: - Properties

Expand Down Expand Up @@ -43,7 +43,6 @@ class HomeVC: UIViewController {

private func configUI() {
view.backgroundColor = .systemBackground
navigationController?.navigationBar.isHidden = true
}

private func setupAutoLayout() {
Expand All @@ -54,6 +53,12 @@ class HomeVC: UIViewController {
make.leading.bottom.trailing.equalToSuperview()
}
}

func clickProfileButton() {
let vc = LoginVC()
vc.modalPresentationStyle = .overFullScreen
self.present(vc, animated: true, completion: nil)
}
}

// MARK: - UITableViewDelegate
Expand All @@ -67,7 +72,9 @@ extension HomeVC: UITableViewDelegate {
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
switch section {
case 0:
return HomeTopView()
let view = HomeTopView()
view.delegate = self
return view
default:
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ import Then
HomeVC의 가장 상단 로고와 메뉴가 있는 Navi View에 해당합니다
*/

// MARK: - Protocol

protocol ProfileButtonDelegate: HomeVC {
func clickProfileButton()
}

class HomeTopView: UIView {

// MARK: - Properties

public weak var delegate: ProfileButtonDelegate?

private let logoImageView = UIImageView().then {
$0.image = Const.Image.youtube
}
Expand All @@ -41,16 +49,17 @@ class HomeTopView: UIView {
$0.setImage(Const.Image.search, for: .normal)
}

private let profileButton = UIButton().then {
private lazy var profileButton = UIButton().then {
$0.setImage(Const.Image.Profile, for: .normal)
$0.addTarget(self, action: #selector(touchupProfileButton(_:)), for: .touchUpInside)
}

// MARK: - Init

override init(frame: CGRect) {
super.init(frame: frame)
configUI()
setupAutoLayout()
backgroundColor = .white
}

required init?(coder: NSCoder) {
Expand All @@ -59,7 +68,11 @@ class HomeTopView: UIView {

// MARK: - Custom Method

func setupAutoLayout() {
private func configUI() {
backgroundColor = .white
}

private func setupAutoLayout() {
addSubviews([logoImageView, buttonStackView, profileButton])
buttonStackView.addArrangedSubviews([sharingButton, notificationButton, searchButton])

Expand All @@ -79,4 +92,10 @@ class HomeTopView: UIView {
make.width.height.equalTo(24)
}
}

// MARK: - @objc

@objc func touchupProfileButton(_ sender: UIButton) {
delegate?.clickProfileButton()
}
}

0 comments on commit 2dd884a

Please sign in to comment.