-
Notifications
You must be signed in to change notification settings - Fork 48
updates API with Designated and Unavailable initializers #49
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
base: master
Are you sure you want to change the base?
Conversation
@d9chen this should update the API accordingly for better access with swift. |
Hey @2020Deception, thanks for this! We're in the middle of overhauling this library to move from v2 of our public API to the new version, so unfortunately there'll be some changes. I've gotten all the PRs up now (#47, #48, #50, and #51) so hopefully that will be wrapped up within a week or so. When that's settled I'll be able to take a look at this for you! |
Hey @2020Deception, everything has settled down now and the transition to the v3 API is complete :) Feel free to rebase this! |
|
||
@interface YLPBaseObject : NSObject | ||
|
||
+ (instancetype)new NS_UNAVAILABLE; |
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.
Oh I hadn't even thought about +new
... is it necessary to annotate both -init
and +new
? i.e. will Swift still let you call things like YLPBusiness()
if -init
is unavailable but +new
is still available?
I'm learning new things about swift interop all the time 😄
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.
I typically do to avoid unwanted initializers if we want to force users building on top of the API to use a certain initializer. I'm open to leaving it available but for the objective c people it may avoid unwanted confusion.
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.
Yeah that's a fair point, I guess I was thinking mainly that YLPBaseObject
seems a little odd as a class with no functionality.
I'm debating whether it's worth it or if it'd be fine to just copy-paste this + (instancetype)new NS_UNAVAILABLE
line everywhere... the convenience of only having to write it once is pretty nice.
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.
yea its a pet peeve of mine to write the same code all over the place. I can adjust it however you like. The base may come in handy later if other functionality comes up that will be shared. I'll review the API changes and update sometime between tonight and tomorrow. Just let me know about other changes you like, i'll be happy to make them!
# Conflicts: # Classes/Client/YLPClient.h # Classes/Request/YLPGeoBoundingBox.h # Classes/Request/YLPGeoCoordinate.h # Classes/Request/YLPQuery.h # Classes/Response/YLPCoordinateDelta.h # Classes/Response/YLPDeal.h # Classes/Response/YLPDealOption.h # Classes/Response/YLPGiftCertificate.h # Classes/Response/YLPGiftCertificateOption.h # Classes/Response/YLPPhoneSearch.h # Classes/Response/YLPRegion.h # YelpAPI.xcodeproj/project.pbxproj
@SSheldon all set |
No description provided.