-
Notifications
You must be signed in to change notification settings - Fork 88
Code Ready for review #3
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
Open
bhartiagrawal
wants to merge
4
commits into
codepath:master
Choose a base branch
from
bhartiagrawal:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,83 +1,17 @@ | ||
| ### Basic Yelp client | ||
| Overview: Build a Yelp search app. | ||
|
|
||
| This is a headless example of how to implement an OAuth 1.0a Yelp API client. The Yelp API provides an application token that allows applications to make unauthenticated requests to their search API. | ||
| Time taken: 15 hrs. | ||
|
|
||
| ### Next steps | ||
| User stories done: | ||
|
|
||
| - Check out `MainViewController.m` to see how to use the `YelpClient`. | ||
| - Augment the search method in the `YelpClient` with whatever search parameters you want to support. | ||
| Search results page | ||
| - Custom cells should have the proper Auto Layout constraints | ||
| - Search bar should be in the navigation bar (doesn't have to expand to show location like the real Yelp app does). | ||
|
|
||
| ### Sample request | ||
| Filter page. Unfortunately, not all the filters are supported in the Yelp API. | ||
| - The filters you should actually have are: category, sort (best match, distance, highest rated), radius (meters), deals (on/off). | ||
| - The filters table should be organized into sections as in the mock. | ||
| - Categories should show a subset of the full list with a "See All" row to expand. - I show all. | ||
| - adding a line here for comment | ||
|
|
||
| ``` | ||
| self.client = [[YelpClient alloc] initWithConsumerKey:kYelpConsumerKey consumerSecret:kYelpConsumerSecret accessToken:kYelpToken accessSecret:kYelpTokenSecret]; | ||
|
|
||
| [self.client searchWithTerm:@"Thai" success:^(AFHTTPRequestOperation *operation, id response) { | ||
| NSLog(@"response: %@", response); | ||
| } failure:^(AFHTTPRequestOperation *operation, NSError *error) { | ||
| NSLog(@"error: %@", [error description]); | ||
| }]; | ||
| ``` | ||
|
|
||
| ### Sample response | ||
|
|
||
| ``` | ||
| businesses = ( | ||
| { | ||
| categories = ( | ||
| ( | ||
| Thai, | ||
| thai | ||
| ) | ||
| ); | ||
| "display_phone" = "+1-415-931-6917"; | ||
| id = "lers-ros-thai-san-francisco"; | ||
| "image_url" = "http://s3-media2.ak.yelpcdn.com/bphoto/IStxUNVdfuPR2ddDAIPk_A/ms.jpg"; | ||
| "is_claimed" = 1; | ||
| "is_closed" = 0; | ||
| location = { | ||
| address = ( | ||
| "730 Larkin St" | ||
| ); | ||
| city = "San Francisco"; | ||
| "country_code" = US; | ||
| "cross_streets" = "Olive St & Ellis St"; | ||
| "display_address" = ( | ||
| "730 Larkin St", | ||
| "(b/t Olive St & Ellis St)", | ||
| Tenderloin, | ||
| "San Francisco, CA 94109" | ||
| ); | ||
| neighborhoods = ( | ||
| Tenderloin | ||
| ); | ||
| "postal_code" = 94109; | ||
| "state_code" = CA; | ||
| }; | ||
| "menu_date_updated" = 1387658025; | ||
| "menu_provider" = "single_platform"; | ||
| "mobile_url" = "http://m.yelp.com/biz/lers-ros-thai-san-francisco"; | ||
| name = "Lers Ros Thai"; | ||
| phone = 4159316917; | ||
| rating = 4; | ||
| "rating_img_url" = "http://s3-media4.ak.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png"; | ||
| "rating_img_url_large" = "http://s3-media2.ak.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png"; | ||
| "rating_img_url_small" = "http://s3-media4.ak.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png"; | ||
| "review_count" = 1154; | ||
| "snippet_image_url" = "http://s3-media4.ak.yelpcdn.com/photo/D40HpcJt-O6Ll654S_--6w/ms.jpg"; | ||
| "snippet_text" = "Fantastic pad-see-ew. Super rich, flavorful sauce and plenty of ginormous prawns, especially for a $12 price tag in San Francisco. I went through a pretty..."; | ||
| url = "http://www.yelp.com/biz/lers-ros-thai-san-francisco"; | ||
| } | ||
| ); | ||
| region = { | ||
| center = { | ||
| latitude = "37.7703124"; | ||
| longitude = "-122.43647245575"; | ||
| }; | ||
| span = { | ||
| "latitude_delta" = "0.06424638000000016"; | ||
| "longitude_delta" = "0.07145348265001417"; | ||
| }; | ||
| }; | ||
| total = 760; | ||
| ``` | ||
|  | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // | ||
| // DetailView.h | ||
| // Yelp | ||
| // | ||
| // Created by Bharti Agrawal on 6/21/14. | ||
| // Copyright (c) 2014 codepath. All rights reserved. | ||
| // | ||
|
|
||
| #import <UIKit/UIKit.h> | ||
|
|
||
| @interface DetailView : UITableViewCell | ||
| @property (weak, nonatomic) IBOutlet UILabel *nameLabel; | ||
|
|
||
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // | ||
| // DetailView.m | ||
| // Yelp | ||
| // | ||
| // Created by Bharti Agrawal on 6/21/14. | ||
| // Copyright (c) 2014 codepath. All rights reserved. | ||
| // | ||
|
|
||
| #import "DetailView.h" | ||
|
|
||
| @implementation DetailView | ||
|
|
||
| - (void)awakeFromNib | ||
| { | ||
| // Initialization code | ||
| } | ||
|
|
||
| - (void)setSelected:(BOOL)selected animated:(BOOL)animated | ||
| { | ||
| [super setSelected:selected animated:animated]; | ||
|
|
||
| // Configure the view for the selected state | ||
| } | ||
|
|
||
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13D65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES"> | ||
| <dependencies> | ||
| <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> | ||
| </dependencies> | ||
| <objects> | ||
| <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
| <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
| <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="90" id="KGk-i7-Jjw" customClass="DetailView"> | ||
| <rect key="frame" x="0.0" y="0.0" width="337" height="90"/> | ||
| <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> | ||
| <rect key="frame" x="0.0" y="0.0" width="337" height="89"/> | ||
| <autoresizingMask key="autoresizingMask"/> | ||
| <subviews> | ||
| <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v47-pL-A43"> | ||
| <rect key="frame" x="187" y="11" width="42" height="21"/> | ||
| <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| <fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
| <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | ||
| <nil key="highlightedColor"/> | ||
| </label> | ||
| </subviews> | ||
| </tableViewCellContentView> | ||
| <connections> | ||
| <outlet property="nameLabel" destination="v47-pL-A43" id="flm-gh-SIo"/> | ||
| </connections> | ||
| </tableViewCell> | ||
| </objects> | ||
| </document> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // | ||
| // FilterViewController.h | ||
| // Yelp | ||
| // | ||
| // Created by Bharti Agrawal on 6/22/14. | ||
| // Copyright (c) 2014 codepath. All rights reserved. | ||
| // | ||
|
|
||
| #import <UIKit/UIKit.h> | ||
|
|
||
| @interface FilterViewController : UIViewController <UITableViewDataSource> | ||
|
|
||
|
|
||
| @end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
adding a comment here.