phimage / Prephirences

Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, configurations and app-state. UserDefaults
MIT License
573 stars 35 forks source link

Ini file parsing and Automatic UI/View building #9

Closed ghost closed 8 years ago

ghost commented 8 years ago

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

phimage commented 8 years ago

Hi, This framework will never parse ini files or other formats by its own You must look for another framework in swift or objective-c, but ini files are not common in ios and mac world (for instance https://github.com/mirek/INI.framework ) (and then maybe one of this framework will produce a dictionary usable with Prephirences or could be mapped to PrepherenceType protocol)

Generate UI could be a cool feature (like SBSettings) but I think a good UI must be designed, using storyboard or xib, because parameters must be ordered, categorized,...