Skip to content

Conversation

2020Deception
Copy link

No description provided.

@2020Deception
Copy link
Author

@d9chen this should update the API accordingly for better access with swift.

@SSheldon
Copy link
Member

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!

@SSheldon
Copy link
Member

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;
Copy link
Member

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 😄

Copy link
Author

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.

Copy link
Member

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.

Copy link
Author

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
@2020Deception
Copy link
Author

@SSheldon all set

@2020Deception
Copy link
Author

@SSheldon @d9chen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants