Parse-SDK-iOS-OSX icon indicating copy to clipboard operation
Parse-SDK-iOS-OSX copied to clipboard

isDataAvailableForKey should be public to easier to check data available

Open kennic opened this issue 4 years ago • 2 comments

… so you don't need to fetch all data to get a certain data. Sometimes the data of a user is very long but we just need to get the "username" which is already fetched. This PR also avoid crashing when we try to get data from key which is not fetched. It should returns nil.

So we could check or get data by either ways:

if user.isDataAvailable(forKey: "username") {
 // ok
}

or

if let username = user["username"] {
// username is available
}
else {
// username is unavailable, please fetch it
}

kennic avatar Jan 18 '21 08:01 kennic

Looks good to me in general but why did you include the change in ParseUI into this PR? Is this on purpose?

It's on purpose, it's just a minor fix to silent the "variable not used" warning

kennic avatar Jan 27 '21 16:01 kennic

This issue has been automatically marked as stale because it has not had recent activity. If you believe it should stay open, please let us know! As always, we encourage contributions, check out the Contributing Guide

stale[bot] avatar Jun 11 '21 02:06 stale[bot]

Closing a superseded by #1756

mtrezza avatar Oct 24 '23 13:10 mtrezza