From 3b6c9e5333e0ac5dc1939e7d4b8c5c6b2e0033f0 Mon Sep 17 00:00:00 2001 From: KKaay0708 <110819885+KKaay0708@users.noreply.github.com> Date: Tue, 11 Apr 2023 16:00:59 -0700 Subject: [PATCH 1/3] Update profilePage.swift --- AHS/AHS/UI/profilePage/profilePage.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AHS/AHS/UI/profilePage/profilePage.swift b/AHS/AHS/UI/profilePage/profilePage.swift index a1c3e30..349889e 100644 --- a/AHS/AHS/UI/profilePage/profilePage.swift +++ b/AHS/AHS/UI/profilePage/profilePage.swift @@ -35,13 +35,13 @@ class profilePageViewController : mainPageViewController{ internal var scheduleViewHeight : CGFloat = 0; //static internal let optionsCellTitles = ["Notifications", "ID Card"]; -- with id card - static internal let optionsCellTitles = ["Notifications"]; + static internal let optionsCellTitles = ["Dark mode", "Notifications", "About Us", "Terms & Agreements", "App Version", "Sign out"]; static internal let infoCellTitles = ["About Us", "Terms and Agreements", "App Version"]; //internal let tableViewContentViewControllers = [[notificationSettingsPageViewController(), idCardSettingsPageViewController()], [aboutUsPageViewController(), termsAndConditionsPageViewController()]]; -- with id card - internal let tableViewContentViewControllers = [[notificationSettingsPageViewController()], [aboutUsPageViewController(), termsAndConditionsPageViewController()]]; + internal let tableViewContentViewControllers = [[notificationSettingsPageViewController(), aboutUsPageViewController(), termsAndConditionsPageViewController()]]; - internal var contentTableViewCellTitles : [[String]] = []; // gets populated with optionsCellTitles and infoCellTitles + internal var contentTableViewCellTitles : [String] = []; // gets populated with cellTitles internal var contentTableViewCellValues : [[String?]] = []; // @@ -149,7 +149,7 @@ class profilePageViewController : mainPageViewController{ } private func setupTableViewContent(){ - contentTableViewCellTitles = [profilePageViewController.optionsCellTitles, profilePageViewController.infoCellTitles]; + contentTableViewCellTitles = [profilePageViewController.optionsCellTitles]; contentTableViewCellValues = [Array(repeating: nil, count: profilePageViewController.optionsCellTitles.count), Array(repeating: nil, count: profilePageViewController.infoCellTitles.count)]; contentTableViewCellValues[1][profilePageViewController.infoCellTitles.count - 1] = AppUtility.getAppVersionString(); // set app build number From 8941e6e68ff4b7bbefc5838a3ca3e01dad064ac6 Mon Sep 17 00:00:00 2001 From: KKaay0708 <110819885+KKaay0708@users.noreply.github.com> Date: Tue, 25 Apr 2023 01:15:13 -0700 Subject: [PATCH 2/3] Revert "Update profilePage.swift" This reverts commit 3b6c9e5333e0ac5dc1939e7d4b8c5c6b2e0033f0. --- AHS/AHS/UI/profilePage/profilePage.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AHS/AHS/UI/profilePage/profilePage.swift b/AHS/AHS/UI/profilePage/profilePage.swift index 349889e..a1c3e30 100644 --- a/AHS/AHS/UI/profilePage/profilePage.swift +++ b/AHS/AHS/UI/profilePage/profilePage.swift @@ -35,13 +35,13 @@ class profilePageViewController : mainPageViewController{ internal var scheduleViewHeight : CGFloat = 0; //static internal let optionsCellTitles = ["Notifications", "ID Card"]; -- with id card - static internal let optionsCellTitles = ["Dark mode", "Notifications", "About Us", "Terms & Agreements", "App Version", "Sign out"]; + static internal let optionsCellTitles = ["Notifications"]; static internal let infoCellTitles = ["About Us", "Terms and Agreements", "App Version"]; //internal let tableViewContentViewControllers = [[notificationSettingsPageViewController(), idCardSettingsPageViewController()], [aboutUsPageViewController(), termsAndConditionsPageViewController()]]; -- with id card - internal let tableViewContentViewControllers = [[notificationSettingsPageViewController(), aboutUsPageViewController(), termsAndConditionsPageViewController()]]; + internal let tableViewContentViewControllers = [[notificationSettingsPageViewController()], [aboutUsPageViewController(), termsAndConditionsPageViewController()]]; - internal var contentTableViewCellTitles : [String] = []; // gets populated with cellTitles + internal var contentTableViewCellTitles : [[String]] = []; // gets populated with optionsCellTitles and infoCellTitles internal var contentTableViewCellValues : [[String?]] = []; // @@ -149,7 +149,7 @@ class profilePageViewController : mainPageViewController{ } private func setupTableViewContent(){ - contentTableViewCellTitles = [profilePageViewController.optionsCellTitles]; + contentTableViewCellTitles = [profilePageViewController.optionsCellTitles, profilePageViewController.infoCellTitles]; contentTableViewCellValues = [Array(repeating: nil, count: profilePageViewController.optionsCellTitles.count), Array(repeating: nil, count: profilePageViewController.infoCellTitles.count)]; contentTableViewCellValues[1][profilePageViewController.infoCellTitles.count - 1] = AppUtility.getAppVersionString(); // set app build number From 1ab55574ee361fbf4b36615089bf3d1fd19d4da7 Mon Sep 17 00:00:00 2001 From: KKaay0708 <110819885+KKaay0708@users.noreply.github.com> Date: Mon, 22 May 2023 21:27:02 -0700 Subject: [PATCH 3/3] profile page update --- AHS/AHS/UI/profilePage/profilePage.swift | 8 ++++---- AHS/AHS/UI/profilePage/profilePageActions.swift | 4 ++-- AHS/AHS/UI/profilePage/profilePageTableView.swift | 12 ++---------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/AHS/AHS/UI/profilePage/profilePage.swift b/AHS/AHS/UI/profilePage/profilePage.swift index a1c3e30..6f5d3f0 100644 --- a/AHS/AHS/UI/profilePage/profilePage.swift +++ b/AHS/AHS/UI/profilePage/profilePage.swift @@ -35,11 +35,11 @@ class profilePageViewController : mainPageViewController{ internal var scheduleViewHeight : CGFloat = 0; //static internal let optionsCellTitles = ["Notifications", "ID Card"]; -- with id card - static internal let optionsCellTitles = ["Notifications"]; - static internal let infoCellTitles = ["About Us", "Terms and Agreements", "App Version"]; + static internal let optionsCellTitles = [""]; + static internal let infoCellTitles = ["Dark Mode", "Notifications", "About Us", "Terms and Agreements", "App Version", "Sign out"]; //internal let tableViewContentViewControllers = [[notificationSettingsPageViewController(), idCardSettingsPageViewController()], [aboutUsPageViewController(), termsAndConditionsPageViewController()]]; -- with id card - internal let tableViewContentViewControllers = [[notificationSettingsPageViewController()], [aboutUsPageViewController(), termsAndConditionsPageViewController()]]; + internal let tableViewContentViewControllers = [[], [articlePageViewController.toggleUserInterface, notificationSettingsPageViewController(), aboutUsPageViewController(), termsAndConditionsPageViewController()]]; internal var contentTableViewCellTitles : [[String]] = []; // gets populated with optionsCellTitles and infoCellTitles internal var contentTableViewCellValues : [[String?]] = []; @@ -152,7 +152,7 @@ class profilePageViewController : mainPageViewController{ contentTableViewCellTitles = [profilePageViewController.optionsCellTitles, profilePageViewController.infoCellTitles]; contentTableViewCellValues = [Array(repeating: nil, count: profilePageViewController.optionsCellTitles.count), Array(repeating: nil, count: profilePageViewController.infoCellTitles.count)]; - contentTableViewCellValues[1][profilePageViewController.infoCellTitles.count - 1] = AppUtility.getAppVersionString(); // set app build number + contentTableViewCellValues[1][profilePageViewController.infoCellTitles.count - 2] = AppUtility.getAppVersionString(); // set app build number } internal func renderContent(){ diff --git a/AHS/AHS/UI/profilePage/profilePageActions.swift b/AHS/AHS/UI/profilePage/profilePageActions.swift index f4740f7..1bf6e4a 100644 --- a/AHS/AHS/UI/profilePage/profilePageActions.swift +++ b/AHS/AHS/UI/profilePage/profilePageActions.swift @@ -32,9 +32,9 @@ extension profilePageViewController{ internal func openTableViewPage(_ indexPath: IndexPath){ switch indexPath.section { case 1: - self.openPresentablePage(self.tableViewContentViewControllers[0][indexPath.row]); + self.openPresentablePage(self.tableViewContentViewControllers[0][indexPath.row] as! presentableViewController); case 2: - if indexPath.row < self.tableViewContentViewControllers[1].count{ self.openPresentablePage(self.tableViewContentViewControllers[1][indexPath.row]); + if indexPath.row < self.tableViewContentViewControllers[1].count{ self.openPresentablePage(self.tableViewContentViewControllers[1][indexPath.row] as! presentableViewController); } default: print("invalid indexPath section in profilePage"); diff --git a/AHS/AHS/UI/profilePage/profilePageTableView.swift b/AHS/AHS/UI/profilePage/profilePageTableView.swift index b587003..f442f7e 100644 --- a/AHS/AHS/UI/profilePage/profilePageTableView.swift +++ b/AHS/AHS/UI/profilePage/profilePageTableView.swift @@ -86,11 +86,7 @@ extension profilePageViewController: UITableViewDelegate, UITableViewDataSource var s : String = ""; switch section { case 0: - s += "Schedule"; - case 1: - s += "Options"; - case 2: - s += "Info"; + s += "Settings"; default: s = ""; } @@ -114,11 +110,7 @@ extension profilePageViewController: UITableViewDelegate, UITableViewDataSource cell.selectionStyle = .none; - if (indexPath.section == 0){ - cell.updateWithView(indexPath.section, scheduleView); - renderSchedule(); - } - else{ + if (indexPath.section != 0){ cell.updateWithButton(indexPath.section, title: contentTableViewCellTitles[indexPath.section - 1][indexPath.row], value: contentTableViewCellValues[indexPath.section - 1][indexPath.row]); }