Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
InstaRobot committed Dec 2, 2021
1 parent 5f77670 commit 6daa8ee
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
1 change: 1 addition & 0 deletions UpdateChecker/Source/Checker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import Foundation

let k_CheckDateInited = "k_CheckDateInited"

public typealias ResultsHandler = (Result<UpdateResults, KnownError>) -> Void

public struct Checker {
Expand Down
5 changes: 2 additions & 3 deletions UpdateChecker/Source/Managers/APIManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public struct APIManager {
private struct Constants {
/// Constant for the `bundleId` parameter in the iTunes Lookup API request.
static let bundleID = "bundleId"
/// Constant for the `country` parameter in the iTunes Lookup API request.
static let country = "country"
/// Constant for the `entity` parameter in the iTunes Lookup API reqeust.
static let entity = "entity"
}
Expand Down Expand Up @@ -82,7 +80,8 @@ extension APIManager {
DispatchQueue.main.async {
handler?(.success(apiModel))
}
} catch {
}
catch {
handler?(.failure(.appStoreJSONParsingFailure(underlyingError: error)))
}
}
Expand Down
12 changes: 7 additions & 5 deletions UpdateChecker/Source/Models/Model.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ public struct Model {
/// - minimumOSVersion: The minimum version of iOS that the current version of the app requires.
/// - releaseNotes: The releases notes from the latest version of the app.
/// - version: The latest version of the app.
init(appID: Int,
currentVersionReleaseDate: String,
minimumOSVersion: String,
releaseNotes: String?,
version: String) {
init(
appID: Int,
currentVersionReleaseDate: String,
minimumOSVersion: String,
releaseNotes: String?,
version: String
) {
self.appID = appID
self.currentVersionReleaseDate = currentVersionReleaseDate
self.minimumOSVersion = minimumOSVersion
Expand Down
17 changes: 2 additions & 15 deletions UpdateChecker/Source/Siren.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,15 @@

import UIKit

/// The Siren Class.
public final class Siren: NSObject {
/// Return results or errors obtained from performing a version check with Siren.
public typealias ResultsHandler = (Result<UpdateResults, KnownError>) -> Void
static let shared = Siren()

/// The Siren singleton. The main point of entry to the Siren library.
public static let shared = Siren()

/// The manager that controls the App Store API that is
/// used to fetch the latest version of the app.
///
/// Defaults to the US App Store.
public lazy var apiManager: APIManager = .default

/// The current installed version of your app.
lazy var apiManager: APIManager = .default
lazy var currentInstalledVersion: String? = Bundle.version()

/// The App Store's unique identifier for an app.
private var appID: Int?
private var configuration: UpdateConfiguration!

/// The completion handler used to return the results or errors returned by Siren.
private var resultsHandler: ResultsHandler?
}

Expand Down

0 comments on commit 6daa8ee

Please sign in to comment.