Skip to content

Commit

Permalink
[Admin] git-flow 전략 수립
Browse files Browse the repository at this point in the history
  • Loading branch information
jayn2u committed Sep 26, 2024
2 parents c283195 + 8ceb5e0 commit 5c07ea4
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
} else {
self?.window?.rootViewController = navigationController
self?.window?.makeKeyAndVisible()
self?.checkAndUpdateIfNeeded()
}
}
}

// 업데이트가 필요한지 확인 후 업데이트 알럿을 띄우는 메소드
func checkAndUpdateIfNeeded() {
/// 업데이트가 필요한지 확인 후 업데이트 알럿을 띄우는 메소드
private func checkAndUpdateIfNeeded() {
DispatchQueue.global(qos: .background).async {
let marketingVersion = AppStoreCheck().latestVersion()

Expand All @@ -69,16 +68,15 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
}
}

// 알럿을 띄우는 메소드
func showUpdateAlert(version: String) {
/// 알럿을 띄우는 메소드
private func showUpdateAlert(version: String) {
let alert = UIAlertController(
title: "업데이트 알림",
message: "더 나은 서비스를 위해 EAT-SSU를 업데이트해주세요!",
preferredStyle: .alert
)

let updateAction = UIAlertAction(title: "업데이트", style: .default) { _ in

// 업데이트 버튼을 누르면 해당 앱스토어로 이동한다.
AppStoreCheck().openAppStore()
}
Expand Down
40 changes: 19 additions & 21 deletions EATSSU_MVC/EATSSU_MVC/Sources/Utility/Base/BaseUIView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ import UIKit
/// - Important: configureUI()와 setLayout() 메소드를 오버라이딩 해야 합니다.
/// 오버라이딩 하지 않으면 런타임 에러가 발생합니다.
class BaseUIView: UIView {

override init(frame: CGRect) {
super.init(frame: frame)

configureUI()
setLayout()
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override init(frame: CGRect) {
super.init(frame: frame)

configureUI()
setLayout()
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

/// 서브뷰를 추가하는 코드를 오버라이딩하여 작성해주세요.
///
/// # Example
Expand All @@ -42,10 +41,10 @@ class BaseUIView: UIView {
/// ```
///
/// - 위의 형식과 같이 서브뷰로 사용할 UIView 클래스를 추가해주시면 됩니다.
func configureUI() {
fatalError("configureUI() must be overridden")
}
func configureUI() {
// FIXME: 컴파일 타임에서 오버라이딩 의무화 여부를 확인하는 방법으로 재설계
}

/// 추가한 서브뷰의 레이아웃을 조정하는 코드를 오버라이딩하여 작성해주세요.
///
/// # Example
Expand All @@ -59,8 +58,7 @@ class BaseUIView: UIView {
/// ```
///
/// - 위의 형식과 같이 추가한 서브뷰의 레이아웃을 조정하는 메소드를 작성해주세요.
func setLayout() {
fatalError("setLayout() must be overridden")
}
func setLayout() {
// FIXME: 컴파일 타임에서 오버라이딩 의무화 여부를 확인하는 방법으로 재설계
}
}

66 changes: 30 additions & 36 deletions EATSSU_MVC/EATSSU_MVC/Sources/Utility/Base/BaseViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,47 +23,44 @@ import SnapKit
/// - Important: configureUI와 setLayout 메소드는 필수로 오버라이딩 해야 합니다.
/// 오버라이딩 하지 않으면 런타임 에러가 발생합니다.
class BaseViewController: UIViewController {
// MARK: - Properties

// MARK: - Properties
private(set) lazy var className: String = type(of: self).description().components(separatedBy: ".").last ?? ""

lazy private(set) var className: String = {
return type(of: self).description().components(separatedBy: ".").last ?? ""
}()
// MARK: - Initialize

// MARK: - Initialize

override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nil, bundle: nil)
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nil, bundle: nil)
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// TODO: deinit 메소드의 목적이 무엇인지 알아보기
deinit {
print("DEINIT: \(className)")
}
deinit {
print("DEINIT: \(className)")
}

override func viewDidLoad() {
super.viewDidLoad()
override func viewDidLoad() {
super.viewDidLoad()

configureUI()
setLayout()
setButtonEvent()
configureUI()
setLayout()
setButtonEvent()
setCustomNavigationBar()
view.backgroundColor = .systemBackground
}
view.backgroundColor = .systemBackground
}

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

if !NetworkMonitor.shared.isConnected {
print("네트워크 오류")
self.showAlertController(title: "오류", message: "네트워크를 확인해주세요", style: .destructive)
}
}
if !NetworkMonitor.shared.isConnected {
print("네트워크 오류")
showAlertController(title: "오류", message: "네트워크를 확인해주세요", style: .destructive)
}
}

// MARK: - Functions

Expand All @@ -79,7 +76,7 @@ class BaseViewController: UIViewController {
/// }
/// ```
func configureUI() {
fatalError("configureUI() must be overridden")
// FIXME: 컴파일 타임에서 오버라이딩 의무화 여부를 확인하는 방법으로 재설계
}

/// 연결된 UIView 클래스의 레이아웃을 UIViewController의 View 프로퍼티를 기준으로 레이아웃을 조정합니다.
Expand All @@ -96,7 +93,7 @@ class BaseViewController: UIViewController {
/// }
/// ```
func setLayout() {
fatalError("setLayout() must be overridden")
// FIXME: 컴파일 타임에서 오버라이딩 의무화 여부를 확인하는 방법으로 재설계
}

// TODO: setButtonEvent를 setButtonAction으로 변경했으면 합니다.
Expand All @@ -116,7 +113,6 @@ class BaseViewController: UIViewController {
/// # 네비게이션 백버튼 속성
/// - `gray500`으로 백버튼 색상을 설정합니다.
func setCustomNavigationBar() {

// 네비게이션 바 타이틀 속성
navigationController?.navigationBar.titleTextAttributes = [
.foregroundColor: EATSSUAsset.Color.GrayScale.gray700.color,
Expand All @@ -127,7 +123,5 @@ class BaseViewController: UIViewController {
let backButton = UIBarButtonItem()
backButton.tintColor = EATSSUAsset.Color.GrayScale.gray500.color
navigationController?.navigationBar.topItem?.backBarButtonItem = backButton
}
}
}


0 comments on commit 5c07ea4

Please sign in to comment.