Skip to content
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

hw submit #13

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions TalkinToTheNet/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
platform :ios, '8.4'
pod 'FourSquareKit'
17 changes: 17 additions & 0 deletions TalkinToTheNet/TalkinToTheNet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
69E41EF71BB0F5F600D7324C /* APIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 69E41EF61BB0F5F600D7324C /* APIManager.m */; settings = {ASSET_TAGS = (); }; };
69E420171BB10B3D00D7324C /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69E420161BB10B3D00D7324C /* CoreLocation.framework */; };
69E4201A1BB1BC1F00D7324C /* C4QRestaurant.m in Sources */ = {isa = PBXBuildFile; fileRef = 69E420191BB1BC1F00D7324C /* C4QRestaurant.m */; settings = {ASSET_TAGS = (); }; };
8D7DCD4B1BAF859400A92AD2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D7DCD4A1BAF859400A92AD2 /* main.m */; };
8D7DCD4E1BAF859400A92AD2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D7DCD4D1BAF859400A92AD2 /* AppDelegate.m */; };
8D7DCD511BAF859400A92AD2 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D7DCD501BAF859400A92AD2 /* ViewController.m */; };
Expand All @@ -16,6 +19,11 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
69E41EF51BB0F5F600D7324C /* APIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIManager.h; sourceTree = "<group>"; };
69E41EF61BB0F5F600D7324C /* APIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APIManager.m; sourceTree = "<group>"; };
69E420161BB10B3D00D7324C /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
69E420181BB1BC1F00D7324C /* C4QRestaurant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = C4QRestaurant.h; sourceTree = "<group>"; };
69E420191BB1BC1F00D7324C /* C4QRestaurant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = C4QRestaurant.m; sourceTree = "<group>"; };
8D7DCD461BAF859400A92AD2 /* TalkinToTheNet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TalkinToTheNet.app; sourceTree = BUILT_PRODUCTS_DIR; };
8D7DCD4A1BAF859400A92AD2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8D7DCD4C1BAF859400A92AD2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
Expand All @@ -33,6 +41,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
69E420171BB10B3D00D7324C /* CoreLocation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -42,6 +51,7 @@
8D7DCD3D1BAF859400A92AD2 = {
isa = PBXGroup;
children = (
69E420161BB10B3D00D7324C /* CoreLocation.framework */,
8D7DCD481BAF859400A92AD2 /* TalkinToTheNet */,
8D7DCD471BAF859400A92AD2 /* Products */,
);
Expand All @@ -60,6 +70,10 @@
children = (
8D7DCD4C1BAF859400A92AD2 /* AppDelegate.h */,
8D7DCD4D1BAF859400A92AD2 /* AppDelegate.m */,
69E420181BB1BC1F00D7324C /* C4QRestaurant.h */,
69E420191BB1BC1F00D7324C /* C4QRestaurant.m */,
69E41EF51BB0F5F600D7324C /* APIManager.h */,
69E41EF61BB0F5F600D7324C /* APIManager.m */,
8D7DCD4F1BAF859400A92AD2 /* ViewController.h */,
8D7DCD501BAF859400A92AD2 /* ViewController.m */,
8D7DCD521BAF859400A92AD2 /* Main.storyboard */,
Expand Down Expand Up @@ -149,6 +163,8 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
69E41EF71BB0F5F600D7324C /* APIManager.m in Sources */,
69E4201A1BB1BC1F00D7324C /* C4QRestaurant.m in Sources */,
8D7DCD511BAF859400A92AD2 /* ViewController.m in Sources */,
8D7DCD4E1BAF859400A92AD2 /* AppDelegate.m in Sources */,
8D7DCD4B1BAF859400A92AD2 /* main.m in Sources */,
Expand Down Expand Up @@ -300,6 +316,7 @@
8D7DCD5F1BAF859400A92AD2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
16 changes: 16 additions & 0 deletions TalkinToTheNet/TalkinToTheNet/APIManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// APIManager.h
// LearnAPI
//
// Created by Z on 9/20/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface APIManager : NSObject

+ (void)GETRequestWithURL:(NSURL *)URL
completionHandler:(void(^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;

@end
31 changes: 31 additions & 0 deletions TalkinToTheNet/TalkinToTheNet/APIManager.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// APIManager.m
// LearnAPI
//
// Created by Z on 9/20/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

#import "APIManager.h"

@implementation APIManager

//class methods
//no instance of an object
//no state
+ (void)GETRequestWithURL:(NSURL *)URL
completionHandler:(void(^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler {

NSURLSession *session = [NSURLSession sharedSession];

NSURLSessionDataTask *task = [session dataTaskWithURL:URL completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {

dispatch_async(dispatch_get_main_queue(), ^{
completionHandler(data, response, error);
});
}];

[task resume];
}

@end
78 changes: 75 additions & 3 deletions TalkinToTheNet/TalkinToTheNet/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,22 +1,94 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="egU-tF-nDP">
<rect key="frame" x="20" y="20" width="42" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<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="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OFP-FP-VsM">
<rect key="frame" x="101" y="20" width="42" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Fnv-69-TNa">
<rect key="frame" x="183" y="20" width="300" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="300" id="jum-WH-OYP"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" enablesReturnKeyAutomatically="YES"/>
</textField>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="rVE-6T-lpB">
<rect key="frame" x="0.0" y="58" width="600" height="542"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="RestaurantCellIdentifier" id="8ZE-mZ-GbP">
<rect key="frame" x="0.0" y="28" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="8ZE-mZ-GbP" id="jXD-DL-AUt">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="egU-tF-nDP" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="3ED-aO-3az"/>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="rVE-6T-lpB" secondAttribute="bottom" id="9gA-Pc-gsO"/>
<constraint firstItem="Fnv-69-TNa" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" id="BeO-fM-eM1"/>
<constraint firstItem="egU-tF-nDP" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="GBJ-1l-WBX"/>
<constraint firstAttribute="trailing" secondItem="rVE-6T-lpB" secondAttribute="trailing" id="JhH-kK-0eu"/>
<constraint firstItem="OFP-FP-VsM" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="Y0U-zC-1V6"/>
<constraint firstItem="OFP-FP-VsM" firstAttribute="top" secondItem="egU-tF-nDP" secondAttribute="bottom" constant="56.5" id="bGj-bC-OX6"/>
<constraint firstItem="Fnv-69-TNa" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="enU-6m-5yi"/>
<constraint firstItem="egU-tF-nDP" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" id="l85-Bj-jty"/>
<constraint firstItem="OFP-FP-VsM" firstAttribute="leading" secondItem="egU-tF-nDP" secondAttribute="trailing" constant="39" id="mcg-cz-l9T"/>
<constraint firstItem="rVE-6T-lpB" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="u4F-nT-iyc"/>
<constraint firstItem="Fnv-69-TNa" firstAttribute="leading" secondItem="OFP-FP-VsM" secondAttribute="trailing" constant="40" id="vma-0r-7Vu"/>
<constraint firstItem="egU-tF-nDP" firstAttribute="centerY" secondItem="OFP-FP-VsM" secondAttribute="centerY" id="yRK-KI-4b6"/>
<constraint firstItem="Fnv-69-TNa" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="yZB-jf-LuE"/>
<constraint firstItem="egU-tF-nDP" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="20" id="zej-0u-7Av"/>
<constraint firstItem="rVE-6T-lpB" firstAttribute="top" secondItem="Fnv-69-TNa" secondAttribute="bottom" constant="8" id="zrc-ra-Hki"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="GBJ-1l-WBX"/>
<exclude reference="zej-0u-7Av"/>
<exclude reference="Y0U-zC-1V6"/>
<exclude reference="bGj-bC-OX6"/>
<exclude reference="enU-6m-5yi"/>
<exclude reference="yZB-jf-LuE"/>
</mask>
</variation>
</view>
<connections>
<outlet property="latLabel" destination="egU-tF-nDP" id="Ns4-cU-eQK"/>
<outlet property="longLabel" destination="OFP-FP-VsM" id="mnw-q7-lMk"/>
<outlet property="searchTextField" destination="Fnv-69-TNa" id="pPq-MO-t7b"/>
<outlet property="tableView" destination="rVE-6T-lpB" id="Fzu-p3-glC"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
Expand Down
25 changes: 25 additions & 0 deletions TalkinToTheNet/TalkinToTheNet/C4QRestaurant.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// C4QRestaurant.h
// TalkinToTheNet
//
// Created by Z on 9/22/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface C4QRestaurant : NSObject

@property NSString *name;
@property NSString *phoneNumber;

@property NSString *address;
@property NSString *buildingNumber;
@property NSString *street;
@property NSString *zipcode;

@property NSInteger *ratCount;
@property NSInteger *roachCount;
@property NSInteger *flyCount;

@end
13 changes: 13 additions & 0 deletions TalkinToTheNet/TalkinToTheNet/C4QRestaurant.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// C4QRestaurant.m
// TalkinToTheNet
//
// Created by Z on 9/22/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

#import "C4QRestaurant.h"

@implementation C4QRestaurant

@end
2 changes: 2 additions & 0 deletions TalkinToTheNet/TalkinToTheNet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location is required to find out where you are</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand Down
Loading