Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sharedInstance type #5

Closed
wants to merge 1 commit into from
Closed

Update sharedInstance type #5

wants to merge 1 commit into from

Conversation

brandons
Copy link

sharedInstance is type MutableDictionaryPreferences, however the definition does not specify it's mutability.

This particularly causes an issue when using Alamofire-Prephirences because the associated extensions only work with MutablePreferencesType.

@phimage
Copy link
Owner

phimage commented Nov 12, 2015

We can have a not mutable shared instance, you can set it, that's why
I know using not mutable preferences is not the general case
I must think about it (if I merge or not)

maybe I can add (but not clean)

public static var sharedMutableInstance: MutablePreferencesType? {
  get {
     return Prephirences.sharedInstance as? MutablePreferencesType
  }
  set {
       if let pref = newValue {
                Prephirences.sharedInstance = pref
      }
    }
}

Prephirences.sharedMutableInstance?.loadFrom...

to not to have to do each time

(Prephirences.sharedInstance as? MutablePreferencesType)?.loadFrom

@phimage phimage closed this in 50c2cff Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants