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: 강제 업데이트 팝업 뷰 UI 구현 (#381) #382

Merged
merged 12 commits into from
Apr 11, 2023
20 changes: 20 additions & 0 deletions NADA-iOS-forRelease.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
77F2C0ED27632AA7007641E3 /* CardHarmony.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 77F2C0EC27632AA7007641E3 /* CardHarmony.storyboard */; };
77F47D93276C79B600414659 /* Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77F47D92276C79B600414659 /* Header.swift */; };
DBBB91E1639641F40C5B4416 /* Pods_NADA_iOS_forRelease.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A2183AE0E469153221624A0 /* Pods_NADA_iOS_forRelease.framework */; };
F805588529C993E7002E8EA3 /* UpdateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F805588429C993E7002E8EA3 /* UpdateViewController.swift */; };
F80975E92990A27400075B93 /* Widgets.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = F838B66A298E5C5300D84340 /* Widgets.intentdefinition */; };
F80975EA2990A27900075B93 /* Widgets.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = F838B66A298E5C5300D84340 /* Widgets.intentdefinition */; };
F811720027383097002742CF /* ChangeGroupRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F81171FF27383097002742CF /* ChangeGroupRequest.swift */; };
Expand Down Expand Up @@ -320,6 +321,7 @@
77F2C0EC27632AA7007641E3 /* CardHarmony.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = CardHarmony.storyboard; sourceTree = "<group>"; };
77F47D92276C79B600414659 /* Header.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Header.swift; sourceTree = "<group>"; };
7F4EE1D042EC783FA8528743 /* Pods-NADA-iOS-forRelease.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NADA-iOS-forRelease.debug.xcconfig"; path = "Target Support Files/Pods-NADA-iOS-forRelease/Pods-NADA-iOS-forRelease.debug.xcconfig"; sourceTree = "<group>"; };
F805588429C993E7002E8EA3 /* UpdateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateViewController.swift; sourceTree = "<group>"; };
F81171FF27383097002742CF /* ChangeGroupRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeGroupRequest.swift; sourceTree = "<group>"; };
F822E7A82709CEB60020452C /* Notification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Notification.swift; sourceTree = "<group>"; };
F8268DB827730B0100BF114B /* FirstCardAlertBottomSheetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstCardAlertBottomSheetViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -761,6 +763,22 @@
path = VC;
sourceTree = "<group>";
};
F805588329C993D0002E8EA3 /* Update */ = {
isa = PBXGroup;
children = (
F805588629C993EF002E8EA3 /* VC */,
);
path = Update;
sourceTree = "<group>";
};
F805588629C993EF002E8EA3 /* VC */ = {
isa = PBXGroup;
children = (
F805588429C993E7002E8EA3 /* UpdateViewController.swift */,
);
path = VC;
sourceTree = "<group>";
};
F82FF8222701FFE300E57F8B /* RequiredFlavor */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1139,6 +1157,7 @@
F8FC43A026C01F040033E151 /* ViewControllers */ = {
isa = PBXGroup;
children = (
F805588329C993D0002E8EA3 /* Update */,
77B4E7492990E4FC006098DC /* Home */,
397B750E2763A5DD004AEB03 /* OpenSource */,
397B75182763B5DA004AEB03 /* TeamNADA */,
Expand Down Expand Up @@ -1608,6 +1627,7 @@
77703157275005AA002CBD19 /* CardResultBottomSheetViewController.swift in Sources */,
F8D74DD8276C7FB60071E5FC /* UIImageView+Extension.swift in Sources */,
39D13565273FDB9C00B1A148 /* User.swift in Sources */,
F805588529C993E7002E8EA3 /* UpdateViewController.swift in Sources */,
77812947275F6EA3004B34F4 /* CardDetailViewController.swift in Sources */,
F822E7A92709CEB60020452C /* Notification.swift in Sources */,
F8C83FC5272FA2940009DF0D /* CardAPI.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "btnMainGoUpdate.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btnMainGoUpdate@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "btnMainGoUpdate@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"scale" : "1x",
"filename" : "icnCheckboxFilled.png",
"idiom" : "universal"
},
{
"scale" : "2x",
"filename" : "icnCheckboxFilled@2x.png",
"idiom" : "universal"
},
{
"scale" : "3x",
"idiom" : "universal",
"filename" : "icnCheckboxFilled@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "icnCheckboxUnfilled.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "icnCheckboxUnfilled@2x.png"
},
{
"scale" : "3x",
"idiom" : "universal",
"filename" : "icnCheckboxUnfilled@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "imgUpdate.png",
"scale" : "1x",
"idiom" : "universal"
},
{
"idiom" : "universal",
"filename" : "imgUpdate@2x.png",
"scale" : "2x"
},
{
"scale" : "3x",
"idiom" : "universal",
"filename" : "imgUpdate@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
//
// UpdateViewController.swift
// NADA-iOS-forRelease
//
// Created by kimhyungyu on 2023/03/21.
//

import UIKit

import FlexLayout
import PinLayout
Comment on lines +10 to +11
Copy link
Member

Choose a reason for hiding this comment

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

이건 처음 보는 스택인데 많이 배워가도록 하겠습니다 신기하네요!!


class UpdateViewController: UIViewController {

// MARK: - Components

private let rootFlexContainer = UIView()
private let updateCardImageView = UIImageView()
private let cancelButton = UIButton()
private let updateContentLabel = UILabel()
private let checkBoxButton = UIButton()
private let checkLabel = UILabel()
private let updateButton = UIButton()

// MARK: - View Life Cycle

override func viewDidLoad() {
super.viewDidLoad()

setUI()
addTargets()
setLayout()
}

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

rootFlexContainer.pin.vCenter().hCenter().height(487).width(327)
Copy link
Member

Choose a reason for hiding this comment

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

약간 스유 같기도 하네요...?

Copy link
Member Author

Choose a reason for hiding this comment

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

맞심더! 체이닝으로 스유의 느낌이나고 실제로 장점중에서도 그렇게 다가온거같아여!

rootFlexContainer.flex.layout()
}
}

// MARK: - Extension

extension UpdateViewController {
private func setUI() {
view.backgroundColor = .black.withAlphaComponent(0.4)

rootFlexContainer.backgroundColor = .background
rootFlexContainer.layer.cornerRadius = 20

updateCardImageView.image = UIImage(named: "imgUpdate")

cancelButton.setImage(UIImage(named: "iconClear"), for: .normal)

updateContentLabel.numberOfLines = 10
updateContentLabel.font = .textRegular04
updateContentLabel.textColor = .secondary
updateContentLabel.lineBreakMode = .byCharWrapping
updateContentLabel.text = """
안녕하세요, 나다입니다.
이번 업데이트에서는 아래와 같은 내용이 개선되었습니다.
안녕하세융
나다에요
-명함을 위젯으로 추가할 수 있어요
-내 주변의 명함을 검색할 수 있어요
ㅇㅇㅇ
앱스토어에서 최신 버전을 확인해 보세요!
이정도면 10줄!
"""

checkBoxButton.setImage(UIImage(named: "icnCheckboxUnfilled"), for: .normal)
checkBoxButton.setImage(UIImage(named: "icnCheckboxFilled"), for: .selected)

checkLabel.font = .textRegular05
checkLabel.textColor = .tertiary
checkLabel.text = "확인했어요!"

updateButton.setImage(UIImage(named: "btnMainGoUpdate"), for: .normal)
}

private func addTargets() {
cancelButton.addTarget(self, action: #selector(touchCancelButton), for: .touchUpInside)
updateButton.addTarget(self, action: #selector(touchUpdateButton), for: .touchUpInside)
checkBoxButton.addTarget(self, action: #selector(touchCheckBox), for: .touchUpInside)
}

// MARK: - Objc Methods

@objc
private func touchCancelButton() {
// TODO: - 비강제 업데이트는 창 닫기. 강제 업데이트는 앱 종료.
}

@objc
private func touchUpdateButton() {
// TODO: - 앱스토어로 연결 혹은 홈으로 연결하는 액션 구현.
}

@objc
private func touchCheckBox(_ sender: UIButton) {
// TODO: - 체크하게 되면 다시 띄어주지 않음
checkBoxButton.isSelected.toggle()
}
}

// MARK: - Layout

extension UpdateViewController {
private func setLayout() {
view.addSubview(rootFlexContainer)

rootFlexContainer.flex.direction(.column).justifyContent(.spaceBetween).define { flex in
flex.addItem().direction(.column).define { flex in
flex.addItem().direction(.column).alignItems(.center).define { flex in
flex.addItem(updateCardImageView).marginTop(20)
flex.addItem(cancelButton).position(.absolute).top(20).right(20)
}
flex.addItem(updateContentLabel).marginTop(16).marginBottom(18).marginHorizontal(16)
}
flex.addItem().direction(.column).define { flex in
flex.addItem().direction(.row).alignItems(.center).marginBottom(20).define { flex in
flex.addItem(checkBoxButton).marginLeft(16).size(16)
flex.addItem(checkLabel).marginLeft(2)
}
flex.addItem(updateButton).marginBottom(16).marginHorizontal(17)
}
}
}
}
36 changes: 19 additions & 17 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ target 'NADA-iOS-forRelease' do
use_frameworks!

# Pods for NADA-iOS-forRelease
pod 'Moya'
pod 'SkeletonView'
pod 'SwiftLint'
pod 'VerticalCardSwiper'
pod 'KakaoSDKCommon'
pod 'KakaoSDKUser'
pod 'KakaoSDKAuth'
pod 'IQKeyboardManagerSwift'
pod 'Kingfisher'
pod 'NVActivityIndicatorView'
pod 'Firebase/DynamicLinks'
pod 'lottie-ios'
pod 'Then'
pod 'SnapKit'
pod 'RxSwift'
pod 'RxCocoa'
pod 'Moya/RxSwift'
pod 'Moya'
pod 'SkeletonView'
pod 'SwiftLint'
pod 'VerticalCardSwiper'
pod 'KakaoSDKCommon'
pod 'KakaoSDKUser'
pod 'KakaoSDKAuth'
pod 'IQKeyboardManagerSwift'
pod 'Kingfisher'
pod 'NVActivityIndicatorView'
pod 'Firebase/DynamicLinks'
pod 'lottie-ios'
pod 'Then'
pod 'SnapKit'
pod 'RxSwift'
pod 'RxCocoa'
pod 'Moya/RxSwift'
pod 'FlexLayout'
pod 'PinLayout'
end
12 changes: 10 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PODS:
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseDynamicLinks (10.6.0):
- FirebaseCore (~> 10.0)
- FlexLayout (1.3.30)
- GoogleUtilities/Environment (7.11.0):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.11.0):
Expand Down Expand Up @@ -42,6 +43,7 @@ PODS:
- NVActivityIndicatorView (5.1.1):
- NVActivityIndicatorView/Base (= 5.1.1)
- NVActivityIndicatorView/Base (5.1.1)
- PinLayout (1.10.4)
- PromisesObjC (2.2.0)
- RxCocoa (6.5.0):
- RxRelay (= 6.5.0)
Expand All @@ -57,6 +59,7 @@ PODS:

DEPENDENCIES:
- Firebase/DynamicLinks
- FlexLayout
- IQKeyboardManagerSwift
- KakaoSDKAuth
- KakaoSDKCommon
Expand All @@ -66,6 +69,7 @@ DEPENDENCIES:
- Moya
- Moya/RxSwift
- NVActivityIndicatorView
- PinLayout
- RxCocoa
- RxSwift
- SkeletonView
Expand All @@ -81,6 +85,7 @@ SPEC REPOS:
- FirebaseCore
- FirebaseCoreInternal
- FirebaseDynamicLinks
- FlexLayout
- GoogleUtilities
- IQKeyboardManagerSwift
- KakaoSDKAuth
Expand All @@ -90,6 +95,7 @@ SPEC REPOS:
- lottie-ios
- Moya
- NVActivityIndicatorView
- PinLayout
- PromisesObjC
- RxCocoa
- RxRelay
Expand All @@ -106,6 +112,7 @@ SPEC CHECKSUMS:
FirebaseCore: fa80ad16a62d52f67274b5b88304c3a318bbf9a4
FirebaseCoreInternal: c7cd505e2136811096b225ac388d6254a2622362
FirebaseDynamicLinks: 99c501143953e925681a37aade96bb2db34b30ca
FlexLayout: 6651ad721f521c29d50bc724788488c84e0bc32a
GoogleUtilities: c2bdc4cf2ce786c4d2e6b3bcfd599a25ca78f06f
IQKeyboardManagerSwift: c7955c0bdbf7b2eb29bb7daaa44e3d90f55a9a85
KakaoSDKAuth: 8fca87815de22062a23297983f327613b087b8bb
Expand All @@ -115,6 +122,7 @@ SPEC CHECKSUMS:
lottie-ios: d0954d3150061f662ed0adf96ef98d7421864c47
Moya: 138f0573e53411fb3dc17016add0b748dfbd78ee
NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667
PinLayout: f8a677ce0cd1cfe96b58435d029b4ceb4ce9c04c
PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
RxCocoa: 94f817b71c07517321eb4f9ad299112ca8af743b
RxRelay: 1de1523e604c72b6c68feadedd1af3b1b4d0ecbd
Expand All @@ -125,6 +133,6 @@ SPEC CHECKSUMS:
Then: 844265ae87834bbe1147d91d5d41a404da2ec27d
VerticalCardSwiper: 68df635b354500f86934ea044ade37a264c044c6

PODFILE CHECKSUM: 5ebc024c28ae32feda47b0ba7819929a4d97ca6c
PODFILE CHECKSUM: bc179a77a6e2b3bd5e2b878e4f4b9eca55d127ce

COCOAPODS: 1.11.3
COCOAPODS: 1.12.0