Skip to content

Commit

Permalink
Merge pull request #47 from Zolon-DOL/2023-Changes
Browse files Browse the repository at this point in the history
2023 changes
  • Loading branch information
pbhatt17 authored Jul 14, 2023
2 parents db7b6bb + c184616 commit 5aaa80f
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 182 deletions.
43 changes: 23 additions & 20 deletions Child Labor/EnforceTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class EnforceTableViewController: UITableViewController {
setEnforcement(self.laborUnannouncedPremittedLabel, text: enforcements["Labor_Unannounced_Inspections_Premitted"].element?.text)
setEnforcement(self.laborUnannouncedConductedLabel, text: enforcements["Labor_Unannounced_Inspections_Conducted"].element?.text)
setEnforcement(self.laborEmployeeTrainingLabel, text: enforcements["Labor_New_Employee_Training"].element?.text)
setEnforcement(self.laborLawTrainingLabel, text: enforcements["Labor_New_Law_Training"].element?.text)
// setEnforcement(self.laborLawTrainingLabel, text: enforcements["Labor_New_Law_Training"].element?.text)
// setEnforcement(self.laborRefresherCoursesLabel, text: enforcements["Labor_Refresher_Courses"].element?.text)
setEnforcement(self.laborComplaintMechanismLabel, text: enforcements["Labor_Complaint_Mechanism"].element?.text)
setEnforcement(self.laborReferralMechanismLabel, text: enforcements["Labor_Referral_Mechanism"].element?.text)
Expand Down Expand Up @@ -163,37 +163,37 @@ class EnforceTableViewController: UITableViewController {

override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 9
return 8
}

override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
if state == 0 {
switch section {
case 0:
return 4
return 5
// case 1:
// return 0//1
case 1:
return 1
case 2:
return 1
case 3:
return 3
case 3:
return 2
case 4:
return 2
case 5:
return 2
case 6:
return 2
default:
return 0
}
}
else {
switch section {
case 6:
return 1
case 7:
return 2
case 8:
return 6
return 5
default:
return 0
}
Expand All @@ -206,55 +206,58 @@ class EnforceTableViewController: UITableViewController {
}

override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if (state == 0 && section <= 6) {
if (state == 0 && section <= 5) {
if section == 0 {
return 0
}
return UITableViewAutomaticDimension;
}

if (state == 1 && section >= 7) {
if (state == 1 && section >= 6) {
return UITableViewAutomaticDimension;
}

return CGFloat.leastNormalMagnitude
}

override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if (state == 0 && section <= 6) {
return UITableViewAutomaticDimension;
if (state == 0 && section <= 5) {
return UITableViewAutomaticDimension;

}



if (state == 1 && section > 6) {
if (state == 1 && section > 5) {
return UITableViewAutomaticDimension;
}

return CGFloat.leastNormalMagnitude
}

override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
if (state == 0 && section <= 6) {
if (state == 0 && section <= 5) {
return super.tableView(tableView, titleForHeaderInSection: section)
}

if (state == 1 && section > 6) {
if (state == 1 && section > 5) {
return super.tableView(tableView, titleForHeaderInSection: section)
}

return nil
}

override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
if (state == 0 && section <= 6) {
if (state == 0 && section <= 5) {
if (section == 6 && self.hasLaborFooter) {
// return "*The government does not publish this information";
return " ";
}
return super.tableView(tableView, titleForFooterInSection: section)
}

if (state == 1 && section > 6) {
if (section == 8 && self.hasCriminalFooter) {
if (state == 1 && section > 5) {
if (section == 7 && self.hasCriminalFooter) {
// return "*The government does not publish this information";
return " ";
}
Expand Down
Loading

0 comments on commit 5aaa80f

Please sign in to comment.