Skip to content
Open

HW #9

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
Binary file added TalkinToTheNet/.DS_Store
Binary file not shown.
31 changes: 31 additions & 0 deletions TalkinToTheNet/TalkinToTheNet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
8D7DCD541BAF859400A92AD2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8D7DCD521BAF859400A92AD2 /* Main.storyboard */; };
8D7DCD561BAF859400A92AD2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8D7DCD551BAF859400A92AD2 /* Assets.xcassets */; };
8D7DCD591BAF859400A92AD2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8D7DCD571BAF859400A92AD2 /* LaunchScreen.storyboard */; };
D40A63D71BBF518700DC0788 /* WeatherViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D40A63D61BBF518700DC0788 /* WeatherViewController.m */; settings = {ASSET_TAGS = (); }; };
D40A63DA1BBF51CC00DC0788 /* WeatherSearchResult.m in Sources */ = {isa = PBXBuildFile; fileRef = D40A63D91BBF51CC00DC0788 /* WeatherSearchResult.m */; settings = {ASSET_TAGS = (); }; };
D42E0DFA1BB5A2BB00135642 /* APIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D42E0DF91BB5A2BB00135642 /* APIManager.m */; settings = {ASSET_TAGS = (); }; };
D42E0DFD1BB5FED700135642 /* FourSquareResult.m in Sources */ = {isa = PBXBuildFile; fileRef = D42E0DFC1BB5FED700135642 /* FourSquareResult.m */; settings = {ASSET_TAGS = (); }; };
D42E0E001BB610BD00135642 /* FourSquareTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D42E0DFF1BB610BD00135642 /* FourSquareTableViewCell.m */; settings = {ASSET_TAGS = (); }; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -26,6 +31,16 @@
8D7DCD551BAF859400A92AD2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8D7DCD581BAF859400A92AD2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
8D7DCD5A1BAF859400A92AD2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D40A63D51BBF518700DC0788 /* WeatherViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeatherViewController.h; sourceTree = "<group>"; };
D40A63D61BBF518700DC0788 /* WeatherViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeatherViewController.m; sourceTree = "<group>"; };
D40A63D81BBF51CC00DC0788 /* WeatherSearchResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeatherSearchResult.h; sourceTree = "<group>"; };
D40A63D91BBF51CC00DC0788 /* WeatherSearchResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeatherSearchResult.m; sourceTree = "<group>"; };
D42E0DF81BB5A2BB00135642 /* APIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIManager.h; sourceTree = "<group>"; };
D42E0DF91BB5A2BB00135642 /* APIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APIManager.m; sourceTree = "<group>"; };
D42E0DFB1BB5FED600135642 /* FourSquareResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FourSquareResult.h; sourceTree = "<group>"; };
D42E0DFC1BB5FED700135642 /* FourSquareResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FourSquareResult.m; sourceTree = "<group>"; };
D42E0DFE1BB610BD00135642 /* FourSquareTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FourSquareTableViewCell.h; sourceTree = "<group>"; };
D42E0DFF1BB610BD00135642 /* FourSquareTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FourSquareTableViewCell.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -60,8 +75,18 @@
children = (
8D7DCD4C1BAF859400A92AD2 /* AppDelegate.h */,
8D7DCD4D1BAF859400A92AD2 /* AppDelegate.m */,
D42E0DF81BB5A2BB00135642 /* APIManager.h */,
D42E0DF91BB5A2BB00135642 /* APIManager.m */,
8D7DCD4F1BAF859400A92AD2 /* ViewController.h */,
8D7DCD501BAF859400A92AD2 /* ViewController.m */,
D42E0DFB1BB5FED600135642 /* FourSquareResult.h */,
D42E0DFC1BB5FED700135642 /* FourSquareResult.m */,
D42E0DFE1BB610BD00135642 /* FourSquareTableViewCell.h */,
D42E0DFF1BB610BD00135642 /* FourSquareTableViewCell.m */,
D40A63D81BBF51CC00DC0788 /* WeatherSearchResult.h */,
D40A63D91BBF51CC00DC0788 /* WeatherSearchResult.m */,
D40A63D51BBF518700DC0788 /* WeatherViewController.h */,
D40A63D61BBF518700DC0788 /* WeatherViewController.m */,
8D7DCD521BAF859400A92AD2 /* Main.storyboard */,
8D7DCD551BAF859400A92AD2 /* Assets.xcassets */,
8D7DCD571BAF859400A92AD2 /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -149,7 +174,12 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D42E0E001BB610BD00135642 /* FourSquareTableViewCell.m in Sources */,
D42E0DFA1BB5A2BB00135642 /* APIManager.m in Sources */,
D40A63D71BBF518700DC0788 /* WeatherViewController.m in Sources */,
8D7DCD511BAF859400A92AD2 /* ViewController.m in Sources */,
D42E0DFD1BB5FED700135642 /* FourSquareResult.m in Sources */,
D40A63DA1BBF51CC00DC0788 /* WeatherSearchResult.m in Sources */,
8D7DCD4E1BAF859400A92AD2 /* AppDelegate.m in Sources */,
8D7DCD4B1BAF859400A92AD2 /* main.m in Sources */,
);
Expand Down Expand Up @@ -300,6 +330,7 @@
8D7DCD5F1BAF859400A92AD2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
Binary file added TalkinToTheNet/TalkinToTheNet/.DS_Store
Binary file not shown.
15 changes: 15 additions & 0 deletions TalkinToTheNet/TalkinToTheNet/APIManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// APIManager.h
// APIDemoApp
//
// Created by Jason Wang on 9/20/15.
// Copyright © 2015 Jason Wang. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface APIManager : NSObject

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

@end
29 changes: 29 additions & 0 deletions TalkinToTheNet/TalkinToTheNet/APIManager.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// APIManager.m
// APIDemoApp
//
// Created by Jason Wang on 9/20/15.
// Copyright © 2015 Jason Wang. All rights reserved.
//

#import "APIManager.h"

@implementation APIManager

+ (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
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand Down
Loading