Git Product home page Git Product logo

phimage / prephirences Goto Github PK

View Code? Open in Web Editor NEW
569.0 8.0 35.0 1016 KB

Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, configurations and app-state. UserDefaults

License: MIT License

Swift 97.22% Ruby 1.64% Objective-C 1.13%
userdefaults swift preferences plist keychain configuration ios-swift ios property-wrapper

prephirences's People

Contributors

adriantofan avatar e-marchand avatar gitter-badger avatar jyounus avatar phimage avatar riveryan avatar vknabel avatar yichizhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prephirences's Issues

Xcode 7.3 & Swift 2.2

Hey,

Now that both of them are officially released, are you planning to merge the Swift 2.2 branch into master and push a new update to Cocoapods any time soon? Or are there some issues that you still need to sort out first?

Thanks

Unable to store to keychain

Hey there,

This was working fine for me previously, but now that I've started to prepare my project for appstore release (creating separate environment for dev/staging/prod as well as having different app id's for each of them), I'm unable to store strings in the keychain....

I'm not sure what I'm missing. It works fine if I save to lets say user defaults, but for some reason it stopped working saving to the keychain.

Is there anything you can think of that needs to be enabled in order to use the keychain? Am I missing some entitlements (Keychain Sharing is turned off, since I don't want to share items that I store)?

Sorry I know this most likely has nothing to do with your code, but hoping you can help me out. I've tried to Google this and wasted all day today to figure this out but I'm not getting anywhere.

Thanks

Minor typo in readme

I just noticed a typo in the readme and thought I'd point it out as opposed to assuming "someone else will do it."

Under Transformation and Archiving you have substrict where you likely meant subscript.

Example App?

Not an issue ...

Great framework! Any chance you have (or know of) a sample application that use prephirences? it would be great to see how you use this in practice (beyond the snippets in the Read Me).

Thanks!

Logo.png is part of the compiled framework

Hey there,

I've noticed that when I compile my project and check the IPA file (extract it), the Prephirences.framework file has the Logo.png file inside of it.

It's not a big deal, but would be great if it could be excluded. I've included a screenshot. I'm using this with Cocoapods.

EDIT:
I'm assuming the logo isn't needed, which is why I've opened this "issue".

Thanks

Screenshot

Xcode 9 GM/Swift 4 issues

Hey there,

Could you please update this lib for Swift 4? Currently there are build errors.

Thanks

UserDefaults clearAll doesn't work with a custom suite name

In order to share preferences between my app and its extensions, I'm using UserDefaults(suiteName: "someSuiteName") instead UserDefaults.standard.

Because of the custom suite (domain name), the method clearAll from Prephirences doesn't work, as it uses the bundle identifier as the domain name (as implemented here: https://github.com/phimage/Prephirences/blob/5.0.1/Sources/UserDefaults%2BPrephirences.swift#L64).

Could you please provide some support for a custom suiteName?

Compilation error by Xcode7.0 beta6.

Hi,
I integrated prephirences into my project by cocopoads, the code is pod 'Prephirences', :git => 'https://github.com/phimage/Prephirences.git', :branch => '2.0.0'.
Now in Xcode7.0 beta6 i get a compilation error. Type 'Bool' does not comform to protocol 'LogicalOperationsType', in Preference.swift line 256.
I don't know how to fix it, could you please help me?
Thank you!

NSUserDefaults does not have a member named 'subscript'

Don't know if I'm doing something wrong here, but just tried the example and it throws an error.

let userDefaults = NSUserDefaults.standardUserDefaults()

if let myValue = userDefaults["mykey"] as? Bool {..}

NSUserDefaults does not have a member named 'subscript'

If I use objectForKey, it works.

let userDefaults = NSUserDefaults.standardUserDefaults()

if let myValue = userDefaults.objectForKey("mykey") as? Bool {..}

Same situation when trying to modify it. userDefaults["mykey"] = "myvalue" does not work.

Add PreferencesTabViewController to project

Hello I tried to follow your Readme but i currently get this error:

2015-07-26 20:49:18.408 T-Rex[50694:618288] An uncaught exception was raised
2015-07-26 20:49:18.408 T-Rex[50694:618288] Cannot remove an observer <Prephirences.PreferencesTabViewController 0x608000101290> for the key path "preferencesTabViewSize" from <T_Rex.GeneralPreferencesView 0x608000100a20> because it is not registered as an observer.

I did the following setup:

  • Added NSTabViewController in storyboard
  • Set its class to PreferencesTabViewController
  • Set PreferencesTabViewController delegate to the "No Shadow Tab View"
  • Changed Custom Classes of all of the tabs NSViewControllers to my own implementations
  • Own ViewController implementation follows this template:
import Cocoa
import Prephirences

class GeneralPreferencesView : NSViewController, PreferencesTabViewItemControllerType {
    //if content changes, set this variable accordingly in order to update tab size automatically
    var preferencesTabViewSize: NSSize = NSSize(width: 0, height: 300)

}

Not sure what I am doing wrong ?! The error is due to an unset observer to preferencesTabViewSize but I don't know what I am missing ?

Possible issue with keychain and archiving objects

I believe I am having an issue when trying to get archived objects from the keychain.

They always come back as nil.

Take the following code:

        var preferences = UserDefaults.standard
        preferences["color", .archive] = UIColor.red
        let color = preferences["color", .archive]  as? UIColor
        print(color)
        
        var keychainPreferences = KeychainPreferences.sharedInstance
        keychainPreferences["color2", .archive] = UIColor.red
        let color2 = keychainPreferences["color2", .archive]  as? UIColor
        print(color2)

Results in:

Optional(UIExtendedSRGBColorSpace 1 0 0 1)
nil

Ini file parsing and Automatic UI/View building

Hi Eric,

Hope you are doing well !

I was looking at your great repo and was wondering if there is a way to parse a local .ini configuration file (please find below an example) and to load the settings, and build a cascade series of views for each sections and switch parameters from the app. The ciphering features is really cool btw !

Excerpt of the .ini file:

[Homography]
allCornersVisible=false
homographyComputed=true
ignoreWhenAllInliers=false
method="1:LMEDS;RANSAC;RHO"
minAngle=0
minimumInliers=10
opticalFlow=false
opticalFlowEps=0.01
opticalFlowIterations=30
opticalFlowMaxLevel=3
opticalFlowWinSize=16
ransacReprojThr=5
rectBorderWidth=4

[NearestNeighbor]
1Strategy="1:Linear;KDTree;KMeans;Composite;Autotuned;Lsh;BruteForce"
2Distance_type="0:EUCLIDEAN_L2;MANHATTAN_L1;MINKOWSKI;MAX;HIST_INTERSECT;HELLINGER;CHI_SQUARE_CS;KULLBACK_LEIBLER_KL;HAMMING"
3nndrRatioUsed=true
4nndrRatio=0.8
5minDistanceUsed=false
6minDistance=1.6
7ConvertBinToFloat=false
Autotuned_build_weight=0.01
Autotuned_memory_weight=0
Autotuned_sample_fraction=0.10000000000000001
Autotuned_target_precision=0.80000000000000004
BruteForce_gpu=false
Composite_branching=32
Composite_cb_index=0.20000000000000001
Composite_centers_init="0:RANDOM;GONZALES;KMEANSPP"
Composite_iterations=11
Composite_trees=4
KDTree_trees=4
KMeans_branching=32
KMeans_cb_index=0.20000000000000001
KMeans_centers_init="0:RANDOM;GONZALES;KMEANSPP"
KMeans_iterations=11
Lsh_key_size=20
Lsh_multi_probe_level=2
Lsh_table_number=12
search_checks=32
search_eps=0

Thanks in advance. As we are on github, I wrote it in english but I am french too :-)

Cheers,
Luc Michalski

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.