Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
Release 2.5.1 Final
Browse files Browse the repository at this point in the history
1. Restore Close button in AppearanceVC, and put "Finish Setting" option's functionality on it.
2. Disable swipe to dismiss in  AppearanceVC.
  • Loading branch information
ming900518 committed Jul 19, 2020
1 parent b41847c commit e0a7e0d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 27 deletions.
4 changes: 2 additions & 2 deletions KanColleCommand.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
INFOPLIST_FILE = KanColleCommand/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = "1.0 (TW.CHT-R2.5.1Beta3)";
MARKETING_VERSION = "1.0 (TW.CHT-Release2.5.1)";
PRODUCT_BUNDLE_IDENTIFIER = tw.cctech.ikancollecmd;
PRODUCT_NAME = iKanColleCmd;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1009,7 +1009,7 @@
INFOPLIST_FILE = KanColleCommand/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = "1.0 (TW.CHT-R2.5.1Beta3)";
MARKETING_VERSION = "1.0 (TW.CHT-Release2.5.1)";
PRODUCT_BUNDLE_IDENTIFIER = tw.cctech.ikancollecmd;
PRODUCT_NAME = iKanColleCmd;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Binary file not shown.
53 changes: 28 additions & 25 deletions KanColleCommand/Page/AppearanceVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ class AppearanceVC: UIViewController, UIImagePickerControllerDelegate , UIPicker
maker.height.equalTo(1)
maker.bottom.equalTo(toolbar.snp.bottom)
}

let closeBtn = UIButton(type: .system)
closeBtn.setTitle("關閉", for: .normal)
closeBtn.addTarget(self, action: #selector(close), for: .touchUpInside)

titleBar.addSubview(closeBtn)
closeBtn.snp.makeConstraints { maker in
maker.centerY.equalTo(titleBar.snp.centerY)
maker.right.equalTo(titleBar.snp.right).offset(-16)
}

if #available(iOS 13.0, *) {
appearanceTable = UITableView(frame: CGRect.zero, style: .insetGrouped)
Expand All @@ -81,6 +91,9 @@ class AppearanceVC: UIViewController, UIImagePickerControllerDelegate , UIPicker
} else {
appearanceTable.backgroundColor = UIColor.clear
}
if #available(iOS 13.0, *) {
self.isModalInPresentation = true
}
self.view.addSubview(appearanceTable)
appearanceTable.snp.makeConstraints { maker in
maker.width.equalTo(self.view.snp.width)
Expand All @@ -89,9 +102,17 @@ class AppearanceVC: UIViewController, UIImagePickerControllerDelegate , UIPicker
}
}
@objc func close() {
dismiss(animated: true)
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.landscape = true
let exit = UIAlertController(title: "如有變更設定,請重新開啟本App以確保功能正常", message: nil, preferredStyle: .alert)
exit.addAction(UIAlertAction(title: "離開本App", style: .destructive) { action in
self.exitApp()
})
exit.addAction(UIAlertAction(title: "關閉設定", style: .default) { action in
self.dismiss(animated: true)
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.landscape = true
})
exit.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil))
self.present(exit, animated: true)
}

func exitApp() {
Expand All @@ -114,12 +135,13 @@ extension AppearanceVC: UITableViewDelegate {
dialog.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil))
dialog.addAction(UIAlertAction(title: "預設", style: .default) { action in
Setting.saveUseTheme(value: 0)
self.appearanceTable.reloadData()
})
dialog.addAction(UIAlertAction(title: "黑玻璃透明", style: .default) { action in
Setting.saveUseTheme(value: 1)
self.appearanceTable.reloadData()
})
self.present(dialog, animated: true)
self.appearanceTable.reloadData()
}
} else if (indexPath.section == 2) {
if (indexPath.row == 0) {
Expand Down Expand Up @@ -149,18 +171,6 @@ extension AppearanceVC: UITableViewDelegate {
selector.addAction(UIAlertAction(title: "取消", style: .cancel))
self.present(selector, animated: true)
}
} else if (indexPath.section == 3) {
if (indexPath.row == 0) {
let exit = UIAlertController(title: "如有變更設定,請重新開啟本App", message: nil, preferredStyle: .alert)
exit.addAction(UIAlertAction(title: "離開本App", style: .destructive) { action in
self.exitApp()
})
exit.addAction(UIAlertAction(title: "關閉設定", style: .default) { action in
self.close()
})
exit.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil))
self.present(exit, animated: true)
}
}
tableView.deselectRow(at: indexPath, animated: true)
}
Expand All @@ -172,7 +182,7 @@ extension AppearanceVC: UITableViewDelegate {

extension AppearanceVC: UITableViewDataSource {
public func numberOfSections(in tableView: UITableView) -> Int {
return 4
return 3
}

public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
Expand Down Expand Up @@ -216,14 +226,7 @@ extension AppearanceVC: UITableViewDataSource {
cell.accessoryType = .disclosureIndicator
return cell
}
} else if (indexPath.section == 3) {
if (indexPath.row == 0) {
let cell = UITableViewCell(style: .value1, reuseIdentifier: cellIdentifier)
cell.textLabel?.text = "完成設定"
cell.textLabel?.textColor = UIColor.systemBlue
return cell
}
}
}
tableView.deselectRow(at: indexPath, animated: true)
return UITableViewCell(style: .default, reuseIdentifier: cellIdentifier)
}
Expand Down

0 comments on commit e0a7e0d

Please sign in to comment.