Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] 환경설정 앱 버전 정보 셀 로직 추가, 강제 업데이트 기능 추가 #201 #203 #206

Merged
merged 2 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions Happiggy-bank/Happiggy-bank.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
A456657C27CC66FD007CF70A /* DefaultButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = A817430027C112D00016C921 /* DefaultButton.swift */; };
A456657E27CC77A9007CF70A /* Date+Formatted.swift in Sources */ = {isa = PBXBuildFile; fileRef = A456657D27CC77A9007CF70A /* Date+Formatted.swift */; };
A4569CB8280FB979001E3FD6 /* Presenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4569CB7280FB979001E3FD6 /* Presenter.swift */; };
A4569CBA280FBA23001E3FD6 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4569CB9280FBA23001E3FD6 /* Result.swift */; };
A4569CBA280FBA23001E3FD6 /* CustomResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4569CB9280FBA23001E3FD6 /* CustomResult.swift */; };
A4569CBC2810455B001E3FD6 /* CustomerServiceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4569CBB2810455B001E3FD6 /* CustomerServiceViewController.swift */; };
A4569CBE28105052001E3FD6 /* CustomerServiceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4569CBD28105051001E3FD6 /* CustomerServiceViewModel.swift */; };
A4569CC0281118DE001E3FD6 /* InformationTextViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4569CBF281118DE001E3FD6 /* InformationTextViewController.swift */; };
Expand Down Expand Up @@ -101,6 +101,14 @@
A4CF2C8227C73B42001B01B1 /* UIColor+AssetColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4CF2C8127C73B42001B01B1 /* UIColor+AssetColors.swift */; };
A4CF2C8E27CBA49D001B01B1 /* UIViewController+NotificationCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4CF2C8D27CBA49D001B01B1 /* UIViewController+NotificationCenter.swift */; };
A4CF2C9027CBA66F001B01B1 /* NSNotificaion.Name+CustomNotifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4CF2C8F27CBA66F001B01B1 /* NSNotificaion.Name+CustomNotifications.swift */; };
A4D357DE283A3E01007819E3 /* VersionUpdating.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4D357DD283A3E01007819E3 /* VersionUpdating.swift */; };
A4D357E0283A43C7007819E3 /* UIViewController+VersionUpdating.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4D357DF283A43C7007819E3 /* UIViewController+VersionUpdating.swift */; };
A4D357E2283A4429007819E3 /* URL+Open.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4D357E1283A4429007819E3 /* URL+Open.swift */; };
A4D6EB75282E2E6700553E43 /* VersionChecking.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4D6EB74282E2E6700553E43 /* VersionChecking.swift */; };
A4D6EB77282E307900553E43 /* VersionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4D6EB76282E307900553E43 /* VersionManager.swift */; };
A4D6EB79282E432400553E43 /* OptionalBool.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4D6EB78282E432400553E43 /* OptionalBool.swift */; };
A4D6EB7B2837825500553E43 /* LookUpResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4D6EB7A2837825500553E43 /* LookUpResult.swift */; };
A4D6EB7D2837901F00553E43 /* URL+AppStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4D6EB7C2837901F00553E43 /* URL+AppStore.swift */; };
A4F5714727DA467900E7DF9B /* DateFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4F5714627DA467900E7DF9B /* DateFormat.swift */; };
A4F5714927DA589100E7DF9B /* NoteDatePickerData.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4F5714827DA589100E7DF9B /* NoteDatePickerData.swift */; };
A4F5715227DB715100E7DF9B /* ColorButton.xib in Resources */ = {isa = PBXBuildFile; fileRef = A4F5715127DB715100E7DF9B /* ColorButton.xib */; };
Expand Down Expand Up @@ -158,7 +166,7 @@
A44E901627D5EB130053AC57 /* Happigy-bank.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Happigy-bank.xcdatamodel"; sourceTree = "<group>"; };
A456657D27CC77A9007CF70A /* Date+Formatted.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+Formatted.swift"; sourceTree = "<group>"; };
A4569CB7280FB979001E3FD6 /* Presenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Presenter.swift; sourceTree = "<group>"; };
A4569CB9280FBA23001E3FD6 /* Result.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = "<group>"; };
A4569CB9280FBA23001E3FD6 /* CustomResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomResult.swift; sourceTree = "<group>"; };
A4569CBB2810455B001E3FD6 /* CustomerServiceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomerServiceViewController.swift; sourceTree = "<group>"; };
A4569CBD28105051001E3FD6 /* CustomerServiceViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomerServiceViewModel.swift; sourceTree = "<group>"; };
A4569CBF281118DE001E3FD6 /* InformationTextViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InformationTextViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -234,6 +242,14 @@
A4CF2C8127C73B42001B01B1 /* UIColor+AssetColors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+AssetColors.swift"; sourceTree = "<group>"; };
A4CF2C8D27CBA49D001B01B1 /* UIViewController+NotificationCenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+NotificationCenter.swift"; sourceTree = "<group>"; };
A4CF2C8F27CBA66F001B01B1 /* NSNotificaion.Name+CustomNotifications.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSNotificaion.Name+CustomNotifications.swift"; sourceTree = "<group>"; };
A4D357DD283A3E01007819E3 /* VersionUpdating.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionUpdating.swift; sourceTree = "<group>"; };
A4D357DF283A43C7007819E3 /* UIViewController+VersionUpdating.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+VersionUpdating.swift"; sourceTree = "<group>"; };
A4D357E1283A4429007819E3 /* URL+Open.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+Open.swift"; sourceTree = "<group>"; };
A4D6EB74282E2E6700553E43 /* VersionChecking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionChecking.swift; sourceTree = "<group>"; };
A4D6EB76282E307900553E43 /* VersionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionManager.swift; sourceTree = "<group>"; };
A4D6EB78282E432400553E43 /* OptionalBool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptionalBool.swift; sourceTree = "<group>"; };
A4D6EB7A2837825500553E43 /* LookUpResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LookUpResult.swift; sourceTree = "<group>"; };
A4D6EB7C2837901F00553E43 /* URL+AppStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+AppStore.swift"; sourceTree = "<group>"; };
A4F5714627DA467900E7DF9B /* DateFormat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateFormat.swift; sourceTree = "<group>"; };
A4F5714827DA589100E7DF9B /* NoteDatePickerData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoteDatePickerData.swift; sourceTree = "<group>"; };
A4F5715127DB715100E7DF9B /* ColorButton.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ColorButton.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -339,8 +355,9 @@
A4F5714627DA467900E7DF9B /* DateFormat.swift */,
A4F5715727DC459B00E7DF9B /* NoteColor.swift */,
A46BC1EE2800626A00C2E5B4 /* TabItem.swift */,
A4569CB9280FBA23001E3FD6 /* Result.swift */,
A4569CB9280FBA23001E3FD6 /* CustomResult.swift */,
A49B25EC2812B5A400399630 /* CustomFont.swift */,
A4D6EB78282E432400553E43 /* OptionalBool.swift */,
);
path = Enum;
sourceTree = "<group>";
Expand All @@ -351,6 +368,7 @@
A4F5714827DA589100E7DF9B /* NoteDatePickerData.swift */,
A4F5715327DB8B6400E7DF9B /* NewNote.swift */,
A819CFA027DE034F00DE8E72 /* NewBottle.swift */,
A4D6EB7A2837825500553E43 /* LookUpResult.swift */,
);
path = Model;
sourceTree = "<group>";
Expand All @@ -362,6 +380,8 @@
D2AB663D27FFFCF50003AC8C /* UpdateSender.swift */,
A4569CB7280FB979001E3FD6 /* Presenter.swift */,
A4569CC528111EFA001E3FD6 /* InformationTextViewDataSource.swift */,
A4D6EB74282E2E6700553E43 /* VersionChecking.swift */,
A4D357DD283A3E01007819E3 /* VersionUpdating.swift */,
);
path = Protocol;
sourceTree = "<group>";
Expand Down Expand Up @@ -429,6 +449,7 @@
A425F8B527EDF4FB00A005AB /* TagViewFlowLayout.swift */,
A41DE62327F34ABB002A7669 /* UPCarouselFlowLayout.swift */,
A4569CC728112657001E3FD6 /* LicenseText.swift */,
A4D6EB76282E307900553E43 /* VersionManager.swift */,
);
path = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -498,6 +519,9 @@
A46B10F128142F26004AB185 /* UIViewController+ObserveCustomFontChange.swift */,
A46B10F32814362A004AB185 /* UIView+AllFontUsingSubviews.swift */,
A46B10F52814458C004AB185 /* UILabel+ChangeOnlyFontFamily.swift */,
A4D6EB7C2837901F00553E43 /* URL+AppStore.swift */,
A4D357DF283A43C7007819E3 /* UIViewController+VersionUpdating.swift */,
A4D357E1283A4429007819E3 /* URL+Open.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -692,10 +716,12 @@
D236DB8827FDD66900D7B8F0 /* NewBottleMessageFieldViewController.swift in Sources */,
A4569CCA28113F0F001E3FD6 /* NSMutableAttributedString+Hyperlink.swift in Sources */,
A490AC4E27DD945E00B04CE1 /* NoteListViewController.swift in Sources */,
A4D357E0283A43C7007819E3 /* UIViewController+VersionUpdating.swift in Sources */,
A8BD834727BE337900E0DE41 /* HomeView.swift in Sources */,
A46B10FC28144D76004AB185 /* CustomTabBarController.swift in Sources */,
A4CF2C7C27C71FF5001B01B1 /* CATransition+PopupAnimation.swift in Sources */,
A49B25F42812FFB400399630 /* UILabel+BoldAndColor.swift in Sources */,
A4D6EB7D2837901F00553E43 /* URL+AppStore.swift in Sources */,
A8FC07C827B3ECF00077A758 /* AppDelegate.swift in Sources */,
A459003827E8D107003010A0 /* SettingsViewController.swift in Sources */,
A4C1AFCE27E4F8150096CD3E /* UIView+FadeInOut.swift in Sources */,
Expand All @@ -713,6 +739,7 @@
A4B2860927D9A56A008769EB /* NewNoteTextViewController.swift in Sources */,
A48E183C27E7379100B44477 /* CapsuleButton.swift in Sources */,
A843332127DA026D00A12A54 /* NewBottleDatePickerViewController.swift in Sources */,
A4D6EB75282E2E6700553E43 /* VersionChecking.swift in Sources */,
A8FC07CA27B3ECF00077A758 /* SceneDelegate.swift in Sources */,
A4F5715427DB8B6500E7DF9B /* NewNote.swift in Sources */,
A466A31028018CD800D655F4 /* UIWindowScene+TopMostViewController.swift in Sources */,
Expand All @@ -733,6 +760,7 @@
A46B10F028142DB1004AB185 /* UIFont+Weight.swift in Sources */,
A491018D27D7358B0012DFDD /* Bottle+CoreDataClass.swift in Sources */,
A41DE62E27F5F2C1002A7669 /* UIView+ZoomAnimation.swift in Sources */,
A4D6EB7B2837825500553E43 /* LookUpResult.swift in Sources */,
A439F54527EF0698002851F4 /* SettingsLabelButtonCell.swift in Sources */,
A41A506F27FF2B2E005381EF /* CustomTabBar.swift in Sources */,
A490AC5027DD9D2E00B04CE1 /* NoteListViewModel.swift in Sources */,
Expand All @@ -741,24 +769,28 @@
A4F5714927DA589100E7DF9B /* NoteDatePickerData.swift in Sources */,
D2C48BFF27E9D60A006FC59E /* Gravity.swift in Sources */,
A8EB5E8B27C8B087005704F2 /* UIButton+Extension.swift in Sources */,
A4D357DE283A3E01007819E3 /* VersionUpdating.swift in Sources */,
A843331F27DA013800A12A54 /* NewBottleNameFieldViewController.swift in Sources */,
A459003C27E9C5C9003010A0 /* CGSize+Area.swift in Sources */,
A425F8B627EDF4FB00A005AB /* TagViewFlowLayout.swift in Sources */,
A4C1AFC427E47DC50096CD3E /* String+NSMutableAttributedStringify.swift in Sources */,
A46B10EC2813E73F004AB185 /* UserDefaults+Keys.swift in Sources */,
A4C1AFC027E477180096CD3E /* NSMutableAttributedString+ColorBold.swift in Sources */,
A4D6EB79282E432400553E43 /* OptionalBool.swift in Sources */,
A491018F27D735920012DFDD /* Note+CoreDataClass.swift in Sources */,
A439F53D27EEFCF6002851F4 /* SettingsToggleButtonCell.swift in Sources */,
A46B10EE281429AC004AB185 /* UIFont+OverrideSystemFont.swift in Sources */,
A4F5715827DC459B00E7DF9B /* NoteColor.swift in Sources */,
A46B10FE281450F6004AB185 /* CustomNavigationController.swift in Sources */,
A8BD833327BE104900E0DE41 /* HomeViewController.swift in Sources */,
A499318127BF3A38009FF5A8 /* BottleViewModel.swift in Sources */,
A4D6EB77282E307900553E43 /* VersionManager.swift in Sources */,
A89CBEDB27CBDD99005549F6 /* BottleCell.swift in Sources */,
A44E901727D5EB130053AC57 /* Happiggy-bank.xcdatamodeld in Sources */,
A4C1AFD427E5E6120096CD3E /* UITextView+ParagraphStyle.swift in Sources */,
A46B10F228142F26004AB185 /* UIViewController+ObserveCustomFontChange.swift in Sources */,
A466A31A2802987700D655F4 /* UIAlertAction+ConfirmAndCancel.swift in Sources */,
A4D357E2283A4429007819E3 /* URL+Open.swift in Sources */,
A49B25ED2812B5A400399630 /* CustomFont.swift in Sources */,
A4569CC828112657001E3FD6 /* LicenseText.swift in Sources */,
A49931A527BFD20E009FF5A8 /* UIImage+AssetImages.swift in Sources */,
Expand All @@ -776,7 +808,7 @@
A89CBEDD27CBDEA2005549F6 /* BottleListViewController.swift in Sources */,
A439F53A27EEFC28002851F4 /* SettingsViewCell.swift in Sources */,
A46B10F62814458C004AB185 /* UILabel+ChangeOnlyFontFamily.swift in Sources */,
A4569CBA280FBA23001E3FD6 /* Result.swift in Sources */,
A4569CBA280FBA23001E3FD6 /* CustomResult.swift in Sources */,
A466A30C2801861100D655F4 /* ErrorViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Result.swift
// CustomResult.swift
// Happiggy-bank
//
// Created by sun on 2022/04/20.
Expand All @@ -8,7 +8,7 @@
import Foundation

/// 작업 결과를 나타냄
enum Result {
enum CustomResult {

/// 성공
case success
Expand Down
21 changes: 21 additions & 0 deletions Happiggy-bank/Happiggy-bank/Enum/OptionalBool.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// OptionalBool.swift
// Happiggy-bank
//
// Created by sun on 2022/05/13.
//

import Foundation

/// 옵셔널 불
enum OptionalBool {

/// 참
case `true`

/// 거짓
case `false`

/// 닐
case `nil`
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ extension NSNotification.Name {

/// 유저가 폰트 변경 시 보내는 알림 이름
static let customFontDidChange = NSNotification.Name("custom-font-did-change")

/// 앱스토어 정보를 불러왔을 때 보내는 알림 이름
static let appStoreInfoDidLoad = NSNotification.Name("app-store-info-did-load")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
//
// UIViewController+VersionUpdating.swift
// Happiggy-bank
//
// Created by sun on 2022/05/22.
//

import UIKit

extension UIViewController: VersionUpdating {

// MARK: - Enums

private enum StringLiteral {
/// 알림 제목
static let appStoreOpenErrorAlertTitle = "앱스토어를 열 수 없습니다."
static let appStoreOpenErrorAlertMessage = "앱스토어에서 행복저금통을 직접 업데이트 해 주세요."
}


// MARK: - Properties

/// 강제 업데이트 알림
private var forceUpdateAlert: UIAlertController {
let confirmAction = UIAlertAction.confirmAction(title: "업데이트") { _ in
VersionManager.shared.forceUpdateAlertIsPresented.toggle()
self.openAppStore()
}

return UIAlertController.basic(
alertTitle: "필수 업데이트가 있습니다",
confirmAction: confirmAction
)
}

/// 강제 업데이트 오류 시 앱 종료를 확인하는 알림
private var closeAppAlert: UIAlertController {
let confirmAction = UIAlertAction.confirmAction(title: "앱 종료", style: .default) { _ in
exit(.zero)
}

return UIAlertController.basic(
alertTitle: StringLiteral.appStoreOpenErrorAlertTitle,
alertMessage: StringLiteral.appStoreOpenErrorAlertMessage,
confirmAction: confirmAction
)
}

/// 앱스토어를 열 수 없을 때 나타나는 알림
private var selfUpdateAlert: UIAlertController {
UIAlertController.basic(
alertTitle: StringLiteral.appStoreOpenErrorAlertTitle,
alertMessage: StringLiteral.appStoreOpenErrorAlertMessage,
confirmAction: UIAlertAction.confirmAction()
)
}


// MARK: - Functions

/// 앱스토어를 여는 메서드
func openAppStore() {
guard let urlString = VersionManager.shared.appStoreVersionInfo?.trackViewUrl,
let url = URL(string: urlString),
UIApplication.shared.canOpenURL(url)
else {
let alertController = (VersionManager.shared.needsForcedUpdate) ?
self.closeAppAlert : self.selfUpdateAlert
return self.present(alertController, animated: true)
}

url.open()
}

/// 강제 업데이트가 필요하고, 아직 알림이 띄워지지 않은 경우 알림을 띄우는 메서드
func presentForceUpdateAlertIfNeeded() {
guard !VersionManager.shared.forceUpdateAlertIsPresented
else { return }

VersionManager.shared.forceUpdateAlertIsPresented.toggle()
self.present(self.forceUpdateAlert, animated: true)
}
}
17 changes: 17 additions & 0 deletions Happiggy-bank/Happiggy-bank/Extensions/URL+AppStore.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// URL+AppStore.swift
// Happiggy-bank
//
// Created by sun on 2022/05/20.
//

import Foundation

extension URL {

/// 앱스토어 URL
enum AppStore {
/// 앱스토어 앱 정보 url
static let appInfo = URL(string: StringLiteral.appInfo)
}
}
16 changes: 16 additions & 0 deletions Happiggy-bank/Happiggy-bank/Extensions/URL+Open.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// URL+Open.swift
// Happiggy-bank
//
// Created by sun on 2022/05/22.
//

import UIKit

extension URL {

/// url을 엶
func open(completionHandler: ((Bool) -> Void)? = nil) {
UIApplication.shared.open(self, options: [:], completionHandler: completionHandler)
}
}
27 changes: 27 additions & 0 deletions Happiggy-bank/Happiggy-bank/Model/LookUpResult.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// LookUpResult.swift
// Happiggy-bank
//
// Created by sun on 2022/05/20.
//

import Foundation

/// 앱스토어에서 가져온 앱 정보
struct AppStoreVersionInfo: Decodable {
/// 배포중인 버전
var version: String

/// 앱 릴리즈 노트
var releaseNotes: String

/// 다운로드 url
var trackViewUrl: String
}


/// 앱스토어에서 가져온 앱 정보 배열
struct LookUpResult: Decodable {
/// 결과 배열
var results: [AppStoreVersionInfo]
}
2 changes: 1 addition & 1 deletion Happiggy-bank/Happiggy-bank/Protocol/Presenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ import Foundation
protocol Presenter: AnyObject {

/// 자식 뷰 컨트롤러가 종료되었음을 알리는 메서드
func presentedViewControllerDidDismiss(withResult: Result)
func presentedViewControllerDidDismiss(withResult: CustomResult)
}
29 changes: 29 additions & 0 deletions Happiggy-bank/Happiggy-bank/Protocol/VersionChecking.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// VersionChecking.swift
// Happiggy-bank
//
// Created by sun on 2022/05/13.
//

import Foundation

/// 앱 설치된 버전, 앱스토어 최신 버전 확인 기능
protocol VersionChecking {

// MARK: - Properties

/// 업데이트 필요 여부
var needsUpdate: OptionalBool { get }
Copy link
Contributor

@2unbini 2unbini May 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

업데이트 필요 여부인데 optionalBool로 한 이유가 따로 있을까요? (아래에서 더 이어짐)


/// 강제 업데이트 필요 여부
var needsForcedUpdate: Bool { get }

/// 설치된 버전
var installedVersion: String? { get }

/// 최신 버전
var latestVersion: String? { get }

/// 앱스토어 앱 버전 확인 후 필요한 작업을 수행
func checkVersionOnAppStore(completionHandler: ((Bool) -> Void)?)
}
Loading