forked from codepath/ios_yelp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
239 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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,16 @@ | ||
// | ||
// BusinessCell.h | ||
// Yelp | ||
// | ||
// Created by Prasanth Guruprasad on 11/1/15. | ||
// Copyright © 2015 codepath. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "YelpBusiness.h" | ||
|
||
@interface BusinessCell : UITableViewCell | ||
|
||
@property (strong, nonatomic) YelpBusiness *business; | ||
|
||
@end |
This file contains 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,49 @@ | ||
// | ||
// BusinessCell.m | ||
// Yelp | ||
// | ||
// Created by Prasanth Guruprasad on 11/1/15. | ||
// Copyright © 2015 codepath. All rights reserved. | ||
// | ||
|
||
#import "BusinessCell.h" | ||
#import "YelpBusiness.h" | ||
#import "UIImageView+AFNetworking.h" | ||
|
||
@interface BusinessCell () | ||
@property (weak, nonatomic) IBOutlet UIImageView *thumbImageView; | ||
@property (weak, nonatomic) IBOutlet UILabel *nameLabel; | ||
@property (weak, nonatomic) IBOutlet UILabel *distanceLabel; | ||
@property (weak, nonatomic) IBOutlet UILabel *ratingsLabel; | ||
@property (weak, nonatomic) IBOutlet UIImageView *ratingsImageView; | ||
@property (weak, nonatomic) IBOutlet UILabel *addressLabel; | ||
@property (weak, nonatomic) IBOutlet UILabel *categoriesLabel; | ||
|
||
@end | ||
|
||
@implementation BusinessCell | ||
|
||
- (void)awakeFromNib { | ||
// Initialization code | ||
} | ||
|
||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | ||
[super setSelected:selected animated:animated]; | ||
|
||
// Configure the view for the selected state | ||
} | ||
|
||
- (void)setBusiness:(YelpBusiness *)business { | ||
_business = business; | ||
|
||
[self.thumbImageView setImageWithURL: self.business.imageUrl]; | ||
self.nameLabel.text = self.business.name; | ||
[self.ratingsImageView setImageWithURL: self.business.ratingImageUrl]; | ||
self.distanceLabel.text = self.business.distance; | ||
|
||
self.ratingsLabel.text = [NSString stringWithFormat:@"%@ Reviews", [self.business.reviewCount stringValue]]; | ||
self.addressLabel.text = self.business.address; | ||
self.categoriesLabel.text = self.business.categories; | ||
} | ||
|
||
@end |
This file contains 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,112 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9059" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/> | ||
</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="87" id="KGk-i7-Jjw" customClass="BusinessCell"> | ||
<rect key="frame" x="0.0" y="0.0" width="353" height="87"/> | ||
<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="353" height="86.5"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="dqV-Nm-nHJ"> | ||
<rect key="frame" x="8" y="8" width="70" height="70"/> | ||
<animations/> | ||
<constraints> | ||
<constraint firstAttribute="width" constant="70" id="3On-gE-rSf"/> | ||
<constraint firstAttribute="height" constant="70" id="Bzg-f1-N1s"/> | ||
</constraints> | ||
</imageView> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="1. Grand Pu Bah" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iio-4s-A1F"> | ||
<rect key="frame" x="86" y="8" width="95" height="14.5"/> | ||
<animations/> | ||
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/> | ||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="469 Reviews" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MnB-Kq-9Uo"> | ||
<rect key="frame" x="178" y="30" width="62" height="12"/> | ||
<animations/> | ||
<fontDescription key="fontDescription" type="system" pointSize="10"/> | ||
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Thai, Seafood, Salad" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="261-JV-y3Q"> | ||
<rect key="frame" x="86" y="66" width="99.5" height="12"/> | ||
<animations/> | ||
<fontDescription key="fontDescription" type="system" pointSize="10"/> | ||
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="88 Division St, Mission Bay" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uGp-Rb-2Tn"> | ||
<rect key="frame" x="86" y="51" width="139.5" height="12"/> | ||
<animations/> | ||
<fontDescription key="fontDescription" type="boldSystem" pointSize="10"/> | ||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="tVm-Da-ZwH"> | ||
<rect key="frame" x="86" y="27" width="84" height="17"/> | ||
<animations/> | ||
<constraints> | ||
<constraint firstAttribute="width" constant="84" id="3os-M4-34d"/> | ||
<constraint firstAttribute="height" constant="17" id="VYT-mO-CnR"/> | ||
</constraints> | ||
</imageView> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0.07 mi" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZHy-Vk-wXz"> | ||
<rect key="frame" x="309" y="10" width="35.5" height="12"/> | ||
<animations/> | ||
<fontDescription key="fontDescription" type="system" pointSize="10"/> | ||
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="$$" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UfM-gC-dk6"> | ||
<rect key="frame" x="331" y="30" width="13.5" height="12"/> | ||
<animations/> | ||
<fontDescription key="fontDescription" type="system" pointSize="10"/> | ||
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
<animations/> | ||
<constraints> | ||
<constraint firstItem="MnB-Kq-9Uo" firstAttribute="centerY" secondItem="tVm-Da-ZwH" secondAttribute="centerY" id="6sI-sz-LOe"/> | ||
<constraint firstItem="uGp-Rb-2Tn" firstAttribute="leading" secondItem="dqV-Nm-nHJ" secondAttribute="trailing" constant="8" id="7YI-qu-0gQ"/> | ||
<constraint firstItem="261-JV-y3Q" firstAttribute="top" secondItem="uGp-Rb-2Tn" secondAttribute="bottom" constant="3" id="9JN-Al-8N9"/> | ||
<constraint firstItem="261-JV-y3Q" firstAttribute="leading" secondItem="dqV-Nm-nHJ" secondAttribute="trailing" constant="8" id="9Po-rG-fRJ"/> | ||
<constraint firstItem="UfM-gC-dk6" firstAttribute="top" secondItem="ZHy-Vk-wXz" secondAttribute="bottom" constant="8" id="A4Y-cK-sxw"/> | ||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="dqV-Nm-nHJ" secondAttribute="bottom" constant="8" id="Agw-UD-Sdo"/> | ||
<constraint firstItem="dqV-Nm-nHJ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="8" id="CE1-Jq-a7y"/> | ||
<constraint firstItem="ZHy-Vk-wXz" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="iio-4s-A1F" secondAttribute="trailing" constant="8" id="E0i-Mk-8YK"/> | ||
<constraint firstItem="iio-4s-A1F" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="8" id="K9p-7F-ruC"/> | ||
<constraint firstAttribute="trailing" secondItem="ZHy-Vk-wXz" secondAttribute="trailing" constant="8.5" id="LB6-wX-ARu"/> | ||
<constraint firstItem="dqV-Nm-nHJ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="8" id="azO-Uc-udg"/> | ||
<constraint firstItem="uGp-Rb-2Tn" firstAttribute="top" secondItem="tVm-Da-ZwH" secondAttribute="bottom" constant="7" id="cPz-jr-7z4"/> | ||
<constraint firstItem="tVm-Da-ZwH" firstAttribute="leading" secondItem="dqV-Nm-nHJ" secondAttribute="trailing" constant="8" id="kuN-b7-aGd"/> | ||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="261-JV-y3Q" secondAttribute="bottom" constant="8" id="lCc-Nf-mul"/> | ||
<constraint firstItem="iio-4s-A1F" firstAttribute="leading" secondItem="dqV-Nm-nHJ" secondAttribute="trailing" constant="8" id="rdN-iM-Aih"/> | ||
<constraint firstAttribute="trailing" secondItem="UfM-gC-dk6" secondAttribute="trailing" constant="8.5" id="ro1-zh-U4e"/> | ||
<constraint firstItem="tVm-Da-ZwH" firstAttribute="top" secondItem="iio-4s-A1F" secondAttribute="bottom" constant="4.5" id="s3b-8E-QWu"/> | ||
<constraint firstItem="ZHy-Vk-wXz" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="10" id="vNu-GI-EgH"/> | ||
<constraint firstItem="MnB-Kq-9Uo" firstAttribute="leading" secondItem="tVm-Da-ZwH" secondAttribute="trailing" constant="8" id="xYB-AH-Siv"/> | ||
</constraints> | ||
</tableViewCellContentView> | ||
<animations/> | ||
<connections> | ||
<outlet property="addressLabel" destination="uGp-Rb-2Tn" id="8YG-hP-Ort"/> | ||
<outlet property="categoriesLabel" destination="261-JV-y3Q" id="PUx-5b-8DK"/> | ||
<outlet property="distanceLabel" destination="ZHy-Vk-wXz" id="JqG-ey-Xbm"/> | ||
<outlet property="nameLabel" destination="iio-4s-A1F" id="Z9h-JD-BC7"/> | ||
<outlet property="ratingsImageView" destination="tVm-Da-ZwH" id="9hX-JS-BbD"/> | ||
<outlet property="ratingsLabel" destination="MnB-Kq-9Uo" id="apH-RC-vYs"/> | ||
<outlet property="thumbImageView" destination="dqV-Nm-nHJ" id="2Pu-3K-iGm"/> | ||
</connections> | ||
<point key="canvasLocation" x="276.5" y="264.5"/> | ||
</tableViewCell> | ||
</objects> | ||
</document> |
This file contains 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 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
Oops, something went wrong.