Skip to content

Commit

Permalink
[Feat] todolist 사용법 팝업로직 추가, 7.12 업데이트
Browse files Browse the repository at this point in the history
  • Loading branch information
minsangKang committed Jan 29, 2023
1 parent cba5b10 commit 9d82f59
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Project_Timer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Project_Timer/Project_Timer.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 2C96RNDN63;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
INFOPLIST_FILE = Project_Timer/Info.plist;
Expand All @@ -1621,7 +1621,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Project_Timer/Project_Timer.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 2C96RNDN63;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
INFOPLIST_FILE = Project_Timer/Info.plist;
Expand Down
1 change: 0 additions & 1 deletion Project_Timer/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
switch status {
case .SUCCESS:
guard let storeVersion = version else { return }
print(String.currentVersion, storeVersion)

if storeVersion.compare(String.currentVersion, options: .numeric) == .orderedDescending {
let message = "Please download the ".localized() + storeVersion + " version of the App Store :)".localized()
Expand Down
19 changes: 19 additions & 0 deletions Project_Timer/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -1505,10 +1505,26 @@
<action selector="selectTodoGroup:" destination="uzd-s8-c8h" eventType="touchUpInside" id="64B-ck-bH2"/>
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lEx-0M-FTa">
<rect key="frame" x="276" y="10" width="30" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="MM8-ol-0Ly"/>
<constraint firstAttribute="width" constant="30" id="ou0-Xt-d0E"/>
</constraints>
<color key="tintColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="questionmark.circle" catalog="system">
<preferredSymbolConfiguration key="preferredSymbolConfiguration" weight="regular"/>
</state>
<connections>
<action selector="showUseageAlert:" destination="uzd-s8-c8h" eventType="touchUpInside" id="zRX-oW-98D"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" name="Background_second"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="Eoi-Fr-q6h" secondAttribute="bottom" constant="15" id="3pv-0J-I6f"/>
<constraint firstItem="new-Sd-1gx" firstAttribute="leading" secondItem="lEx-0M-FTa" secondAttribute="trailing" constant="8" id="5Ec-dX-bGv"/>
<constraint firstItem="Eoi-Fr-q6h" firstAttribute="top" secondItem="mwJ-bE-dkx" secondAttribute="bottom" constant="5" id="8ee-WP-uD5"/>
<constraint firstItem="mwJ-bE-dkx" firstAttribute="top" secondItem="JjE-as-Jcv" secondAttribute="top" constant="10" id="Aa1-rv-gom"/>
<constraint firstItem="new-Sd-1gx" firstAttribute="centerY" secondItem="mwJ-bE-dkx" secondAttribute="centerY" id="BHV-c3-x4w"/>
Expand All @@ -1521,6 +1537,7 @@
<constraint firstItem="BMZ-ev-eLR" firstAttribute="centerX" secondItem="mwJ-bE-dkx" secondAttribute="centerX" id="l1b-ev-TqQ"/>
<constraint firstItem="BMZ-ev-eLR" firstAttribute="top" secondItem="mwJ-bE-dkx" secondAttribute="bottom" constant="-2" id="ldP-G9-e1Z"/>
<constraint firstItem="BMZ-ev-eLR" firstAttribute="width" secondItem="mwJ-bE-dkx" secondAttribute="width" id="vOt-W2-I0x"/>
<constraint firstItem="lEx-0M-FTa" firstAttribute="centerY" secondItem="new-Sd-1gx" secondAttribute="centerY" id="xDx-Bh-AHE"/>
<constraint firstAttribute="trailing" secondItem="new-Sd-1gx" secondAttribute="trailing" constant="10" id="zi5-iE-jVH"/>
</constraints>
</view>
Expand Down Expand Up @@ -1594,6 +1611,7 @@
<outlet property="selectTodoGroupButton" destination="new-Sd-1gx" id="ZOy-v3-m3W"/>
<outlet property="todoGroupButton" destination="mwJ-bE-dkx" id="QfC-4g-OT8"/>
<outlet property="todos" destination="Eoi-Fr-q6h" id="i3g-q7-2PP"/>
<outlet property="useageButton" destination="lEx-0M-FTa" id="dBp-WS-bmE"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="0VK-E1-SeN" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -4814,6 +4832,7 @@
<image name="macbookAndIphone" width="74.792503356933594" height="45.788600921630859"/>
<image name="photo.on.rectangle" catalog="system" width="128" height="98"/>
<image name="plus" catalog="system" width="128" height="113"/>
<image name="questionmark.circle" catalog="system" width="128" height="123"/>
<image name="rainbow" width="33.333332061767578" height="33.333332061767578"/>
<image name="square" catalog="system" width="128" height="114"/>
<image name="square.and.arrow.up" catalog="system" width="115" height="128"/>
Expand Down
2 changes: 2 additions & 0 deletions Project_Timer/Global/UserDefaultsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ struct UserDefaultsManager {
// login
case loginInTestServerV1
case lastUploadedDateV1
// useage
case todolistCheckVer
}

static func set<T>(to: T, forKey: Self.Keys) {
Expand Down
32 changes: 32 additions & 0 deletions Project_Timer/Todolist/TodolistViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ class TodolistViewController: UIViewController {
@IBOutlet weak var editButton: UIButton!
@IBOutlet weak var todoGroupButton: UIButton!
@IBOutlet weak var selectTodoGroupButton: UIButton!
@IBOutlet weak var useageButton: UIButton!

private var color: UIColor?
private var viewModel: TodolistVM?
private var cancellables: Set<AnyCancellable> = []

override func viewDidLoad() {
super.viewDidLoad()
self.checkUseage()
self.configureViewModel()
self.configureTodoGroupButton()
self.configureSelectTodoGroupButton()
Expand Down Expand Up @@ -62,9 +64,39 @@ class TodolistViewController: UIViewController {
self.todos.setEditing(!self.todos.isEditing, animated: true)
self.editButton.setTitle(self.todos.isEditing ? "Done" : "Edit", for: .normal)
}

@IBAction func showUseageAlert(_ sender: Any) {
let alert = UIAlertController(title: "See how to use the Todolist".localized(), message: "The new TodoGroup feature added.".localized(), preferredStyle: .alert)
let cancle = UIAlertAction(title: "Pass", style: .default, handler: { [weak self] _ in
self?.showAlertWithOK(title: "You can see anytime in Setting -> TiTi Functions".localized(), text: "")
UserDefaultsManager.set(to: String.currentVersion, forKey: .todolistCheckVer)
self?.useageButton.isHidden = true
})
let ok = UIAlertAction(title: "Show", style: .destructive, handler: { [weak self] _ in
let url = NSLocale.current.languageCode == "ko"
? "https://deeply-eggplant-5ec.notion.site/Todolist-ff23ffb5e6634955b11e1202b95d17fc"
: "https://deeply-eggplant-5ec.notion.site/Todolist-0b68ee031a414cf8896c8f6b9a9b3ebe"
if let url = URL(string: url) {
UIApplication.shared.open(url, options: [:])
UserDefaultsManager.set(to: String.currentVersion, forKey: .todolistCheckVer)
self?.useageButton.isHidden = true
}
})

alert.addAction(cancle)
alert.addAction(ok)
present(alert,animated: true,completion: nil)
}
}

extension TodolistViewController {
private func checkUseage() {
let todolistCheckVer: String = UserDefaultsManager.get(forKey: .todolistCheckVer) as? String ?? "7.11"
let currentVer = String.currentVersion
if currentVer.compare(todolistCheckVer, options: .numeric) == .orderedDescending {
self.useageButton.isHidden = false
}
}
private func configureViewModel() {
self.viewModel = TodolistVM()
}
Expand Down
6 changes: 6 additions & 0 deletions Project_Timer/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,9 @@
"Create Group" = "Create Group";

"Delete Group" = "Delete Group";

"See how to use the Todolist" = "See how to use the Todolist";

"The new TodoGroup feature added." = "The new TodoGroup feature added.";

"You can see anytime in Setting -> TiTi Functions" = "You can see anytime in Setting -> TiTi Functions";
6 changes: 6 additions & 0 deletions Project_Timer/ko.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,9 @@
"Create Group" = "그룹 추가";

"Delete Group" = "그룹 삭제";

"See how to use the Todolist" = "Todolist 사용법 보기";

"The new TodoGroup feature added." = "새로운 TodoGroup 기능이 추가되었어요";

"You can see anytime in Setting -> TiTi Functions" = "언제든 Setting -> TiTi 기능들 내에서 확인해보세요 :)";

0 comments on commit 9d82f59

Please sign in to comment.