Skip to content

Commit

Permalink
Merge pull request #201 from Esri/eli.swift-5-enum-unknown-cases
Browse files Browse the repository at this point in the history
Swift 5 non exhaustive enums
  • Loading branch information
esreli committed Aug 9, 2019
2 parents b05cc0f + abe4ed9 commit dafebe7
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data-collection/data-collection/AppLocation.swift
Expand Up @@ -66,6 +66,8 @@ extension CLAuthorizationStatus: CustomStringConvertible {
return "Not Determined"
case .restricted:
return "Restricted"
@unknown default:
fatalError("Unsupported case \(self).")
}
}
}
Expand Up @@ -27,6 +27,8 @@ extension AGSDrawStatus: CustomStringConvertible {
return "Completed"
case .inProgress:
return "In Progress"
@unknown default:
fatalError("Unsupported case \(self).")
}
}
}
Expand Up @@ -33,6 +33,8 @@ extension AGSJobStatus: CustomStringConvertible {
return "Succeeded"
case .failed:
return "Failed"
@unknown default:
fatalError("Unsupported case \(self).")
}
}
}
Expand Up @@ -44,6 +44,8 @@ extension AGSLicense {
case .invalid:
// Not a valid license. Expiration means nothing.
return "\(self.licenseStatus)"
@unknown default:
fatalError("Unsupported case \(self).")
}
} else {
// No expiry…
Expand Down Expand Up @@ -78,6 +80,8 @@ extension AGSLicenseLevel : CustomStringConvertible {
return "Standard"
case .advanced:
return "Advanced"
@unknown default:
fatalError("Unsupported case \(self).")
}
}
}
Expand All @@ -93,6 +97,8 @@ extension AGSLicenseStatus : CustomStringConvertible {
return "Expired"
case .loginRequired:
return "Login Required"
@unknown default:
fatalError("Unsupported case \(self).")
}
}
}
Expand All @@ -106,6 +112,8 @@ extension AGSLicenseType : CustomStringConvertible {
return "Named User"
case .licenseKey:
return "License Key"
@unknown default:
fatalError("Unsupported case \(self).")
}
}
}
Expand Up @@ -33,6 +33,8 @@ extension AGSLoadStatus: CustomStringConvertible {
return "Not Loaded"
case .unknown:
return "Unknown"
@unknown default:
fatalError("Unsupported case \(self).")
}
}
}
Expand Down
Expand Up @@ -36,6 +36,8 @@ extension Array where Element == AGSPopup {
return try left > right
}
}
@unknown default:
fatalError("Unsupported case \(self).")
}
}
}
Expand Up @@ -28,6 +28,8 @@ extension AGSPopupAttachmentSize {
return CGSize(width: 960, height: 1280)
case .extraLarge:
return CGSize(width: 1126, height: 1500)
@unknown default:
fatalError("Unsupported case \(self).")
}
}

Expand Down Expand Up @@ -60,6 +62,8 @@ extension AGSPopupAttachmentSize {
return "Extra Large \(width)x\(height)"
case .actual:
return "Actual Size (full resolution)"
@unknown default:
fatalError("Unsupported case \(self).")
}
}
}
Expand Up @@ -26,6 +26,8 @@ extension AGSPopupAttachmentType {
return #imageLiteral(resourceName: "AttachmentDocument")
case .other:
return #imageLiteral(resourceName: "AttachmentOther")
@unknown default:
fatalError("Unsupported case \(self).")
}
}
}
Expand Up @@ -47,6 +47,9 @@ extension UIView {
case .vertical:
top.priority = UILayoutPriority(999)
bottom.priority = UILayoutPriority(999)

@unknown default:
fatalError("Unsupported case \(self).")
}
}

Expand Down

0 comments on commit dafebe7

Please sign in to comment.