Open Monigan opened 7 hours ago
Sure, I'm busy working on the jvm apis for now. But if you want to add this feature, you can create a PR for it, and I'll take a look when I can.
Otherwise, I'll get to this after jvm is ready. I appreciate the feedback.
Hello! I think it would be nice if the library provided a setting of optional default values when getting values from storage. This could be useful to avoid having to write some logic in the application and returning null, when the app is waiting for a non-null or non-empty value.
Example:
fun getStringFromKey(key: String, defValue: String?): String?
actual fun getStringFromKey(key: String, defValue: String?): String? { return sharedPreference.getString(key, defValue) }
actual fun getStringFromKey(key: String, defValue: String?): String? { return NSUserDefaults.standardUserDefaults.stringForKey(key) ?: defValue }
If I don't a right, please let me know so we can discuss about this feature.