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
Add nullability annotations to public API #106
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@mcdonamp please merge when you get a moment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two public API changes
GeoFire/API/GeoFire.h
Outdated
@@ -70,7 +72,7 @@ typedef void (^GFCallbackBlock) (CLLocation *location, NSError *error); | |||
* @param location The location as a geographic coordinate | |||
* @param key The key for which this location is saved | |||
*/ | |||
- (void)setLocation:(CLLocation *)location | |||
- (void)setLocation:(nullable CLLocation *)location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want this nullable as nil
is not a valid location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the internal API setLocationValue:forKey:withBlock:
(https://github.com/firebase/geofire-objc/blob/master/GeoFire/Implementation/GeoFire.m#L84) allows location to be nil (when we delete things), but the public API probably shouldn't allow this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yep, I was basing it off the internal API.
GeoFire/API/GeoFire.h
Outdated
@@ -80,9 +82,9 @@ typedef void (^GFCallbackBlock) (CLLocation *location, NSError *error); | |||
* @param key The key for which this location is saved | |||
* @param block The completion block that is called once the location was successfully updated on the server | |||
*/ | |||
- (void)setLocation:(CLLocation *)location | |||
- (void)setLocation:(nullable CLLocation *)location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above, probably not nullable.
@nolanw, @morganchen12 Sorry about the delay. One minor change on the public surface; otherwise, LGTM. Thanks for doing this! |
Not nullable it is! |
LGTM |
@morganchen12, do you have permissions to release, or do you need me to? |
I don't have release permissions, so please make a new release when you have the time. Thanks! |
Published in v2.0.1. |
As mentioned in #105.
Nullability annotations were introduced in Xcode 6.3 (which included iOS 8.3). I'm not sure what the minimum supported Xcode version is in these parts, but if 6.3 is a reasonable minimum then we shouldn't need any
#define NS_ASSUME_NONNULL_BEGIN
etc. to pacify older versions of the dev tools. Let me know if I've guessed wrong here.