     case NoUpdateAvailable
     case AppStoreDataRetrievalFailure
     case AppStoreJSONParsingFailure
+    case AppStoreOSVersionNumberFailure
+    case AppStoreOSVersionUnsupported
     case AppStoreVersionNumberFailure
     case AppStoreVersionArrayFailure
     case AppStoreAppIDFailure


                        let jsonData = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.AllowFragments)

                        guard let appData = jsonData as? [String: AnyObject] else {
                            self.postError(.AppStoreJSONParsingFailure, underlyingError: nil)
                            return
                        }

        return components.day
    }

    func isUpdateCompatibleWithDeviceOS(appData: [String: AnyObject]) -> Bool {

        guard let results = appData["results"] as? [[String: AnyObject]],
            requiredOSVersion = results[0]["minimumOsVersion"] as? String else {
                postError(.AppStoreOSVersionNumberFailure, underlyingError: nil)
            return false
        }

        let systemVersion = UIDevice.currentDevice().systemVersion

        if systemVersion.compare(requiredOSVersion, options: .NumericSearch) == .OrderedDescending ||
            systemVersion.compare(requiredOSVersion, options: .NumericSearch) == .OrderedSame {
            return true
        } else {
            postError(.AppStoreOSVersionUnsupported, underlyingError: nil)
            return false
        }

    }

    func isAppStoreVersionNewer() -> Bool {

        var newVersionExists = false

        if let currentInstalledVersion = currentInstalledVersion, currentAppStoreVersion = currentAppStoreVersion
            where (currentInstalledVersion.compare(currentAppStoreVersion, options: .NumericSearch) == .OrderedAscending) {

            newVersionExists = true
        }
