Skip to content

Commit

Permalink
Refactored BXServerDefaults for better subclassabilty in app module
Browse files Browse the repository at this point in the history
  • Loading branch information
peterb180369 committed Dec 6, 2019
1 parent 0d9be9d commit e43c6fd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions BXSwiftUtils/Networking/BXServerDefaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ import Foundation
//----------------------------------------------------------------------------------------------------------------------


public class BXServerDefaults
open class BXServerDefaults
{
/// Shared singlton instance of this class

public static let shared = BXServerDefaults()

/// Custom errors

public enum Error : Swift.Error
Expand All @@ -43,7 +39,7 @@ public class BXServerDefaults
/// - parameter copyToUserDefaults: Set to true if the contents of the plist should be copied to the local NSUserDefaults
/// - parameter completionHandler: An optional completion handler that returns the resulting plist

public func load(from remoteURL:URL, localFallbackURL:URL? = nil, copyToUserDefaults:Bool = true, completionHandler:((Any?,Swift.Error?)->Void)? = nil)
public static func load(from remoteURL:URL, localFallbackURL:URL? = nil, copyToUserDefaults:Bool = true, completionHandler:((Any?,Swift.Error?)->Void)? = nil)
{
// If we were given a localFallbackURL, then first load its contents into the fallbackPlist

Expand Down Expand Up @@ -124,7 +120,7 @@ public class BXServerDefaults

/// Helper function that calls the completionHandler with the fallbackPlist (if available) or an error otherwise

private func execute(_ completionHandler: ((Any?,Swift.Error?)->Void)?, with fallbackPlist: Any?, _ error: Swift.Error?)
private static func execute(_ completionHandler: ((Any?,Swift.Error?)->Void)?, with fallbackPlist: Any?, _ error: Swift.Error?)
{
if fallbackPlist != nil
{
Expand Down

0 comments on commit e43c6fd

Please sign in to comment.