Skip to content

Commit

Permalink
Merge pull request #33 from Zolon-DOL/SWT2023-6_data_Visualizations_r…
Browse files Browse the repository at this point in the history
…emove_good_by_region_ios

Applied logic as per has multiple teritory.
  • Loading branch information
pbhatt17 authored May 11, 2023
2 parents 7ed3cf4 + 0e6ec0f commit deaa668
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions charts/AssesmentLevelParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,25 @@ class AssesmentLevelParser {

for country in goodsXML[kCountries][kCountry].all {
if let countryRegion = country["Region"].element?.text, !countryRegion.isEmpty {

if var enforcements = country["Enforcements"]["Labor_Inspectors_Intl_Standards"].element?.text, !enforcements.isEmpty {

if var enforcement = country["Enforcements"]["Labor_Inspectors_Intl_Standards"]["Territory"]["Enforcement"].element?.text {
enforcements = enforcement
var enforcementss = ""
if var enforcement = country["Enforcements"]["Labor_Inspectors_Intl_Standards"]["Territory"]["Enforcement"].element?.text {
enforcementss = enforcement
} else {
if var enforcements = country["Enforcements"]["Labor_Inspectors_Intl_Standards"].element?.text, !enforcements.isEmpty {
enforcementss = enforcements
}

}
if enforcementss.count > 0 {
if var currentSector = self.goodsSectors[countryRegion] as? Dictionary<String, Any> {
if var advancementInfo = currentSector[enforcements] as? Int {
if var advancementInfo = currentSector[enforcementss] as? Int {
advancementInfo += 1
currentSector[enforcements] = advancementInfo
currentSector[enforcementss] = advancementInfo
} else {
currentSector[enforcements] = 1
currentSector[enforcementss] = 1
}
self.goodsSectors[countryRegion] = currentSector
} else {
self.goodsSectors[countryRegion] = [enforcements : 1]
self.goodsSectors[countryRegion] = [enforcementss : 1]
}
}
}
Expand Down

0 comments on commit deaa668

Please sign in to comment.