Skip to content
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
33 changes: 33 additions & 0 deletions TalkinToTheNet/TalkinToTheNet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
objects = {

/* Begin PBXBuildFile section */
0B5DCC161BB35BDF006754DB /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B5DCC151BB35BDF006754DB /* MapKit.framework */; };
0B5DCC191BB35C08006754DB /* MapViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B5DCC181BB35C08006754DB /* MapViewController.m */; settings = {ASSET_TAGS = (); }; };
0B5DCC1C1BB35DDB006754DB /* APIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B5DCC1B1BB35DDB006754DB /* APIManager.m */; settings = {ASSET_TAGS = (); }; };
0B5DCC4D1BB62A41006754DB /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B5DCC4C1BB62A41006754DB /* CoreLocation.framework */; };
0B5DCC501BB62EAB006754DB /* CustomFSTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B5DCC4F1BB62EAB006754DB /* CustomFSTableViewCell.m */; settings = {ASSET_TAGS = (); }; };
0B5DCC531BB6375B006754DB /* Foursquare.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B5DCC521BB6375B006754DB /* Foursquare.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 +22,16 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
0B5DCC151BB35BDF006754DB /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; };
0B5DCC171BB35C08006754DB /* MapViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapViewController.h; sourceTree = "<group>"; };
0B5DCC181BB35C08006754DB /* MapViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapViewController.m; sourceTree = "<group>"; };
0B5DCC1A1BB35DDB006754DB /* APIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIManager.h; sourceTree = "<group>"; };
0B5DCC1B1BB35DDB006754DB /* APIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APIManager.m; sourceTree = "<group>"; };
0B5DCC4C1BB62A41006754DB /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
0B5DCC4E1BB62EAB006754DB /* CustomFSTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomFSTableViewCell.h; sourceTree = "<group>"; };
0B5DCC4F1BB62EAB006754DB /* CustomFSTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomFSTableViewCell.m; sourceTree = "<group>"; };
0B5DCC511BB6375B006754DB /* Foursquare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Foursquare.h; sourceTree = "<group>"; };
0B5DCC521BB6375B006754DB /* Foursquare.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Foursquare.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 +49,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0B5DCC4D1BB62A41006754DB /* CoreLocation.framework in Frameworks */,
0B5DCC161BB35BDF006754DB /* MapKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -42,6 +60,8 @@
8D7DCD3D1BAF859400A92AD2 = {
isa = PBXGroup;
children = (
0B5DCC4C1BB62A41006754DB /* CoreLocation.framework */,
0B5DCC151BB35BDF006754DB /* MapKit.framework */,
8D7DCD481BAF859400A92AD2 /* TalkinToTheNet */,
8D7DCD471BAF859400A92AD2 /* Products */,
);
Expand All @@ -60,8 +80,16 @@
children = (
8D7DCD4C1BAF859400A92AD2 /* AppDelegate.h */,
8D7DCD4D1BAF859400A92AD2 /* AppDelegate.m */,
0B5DCC1A1BB35DDB006754DB /* APIManager.h */,
0B5DCC1B1BB35DDB006754DB /* APIManager.m */,
0B5DCC511BB6375B006754DB /* Foursquare.h */,
0B5DCC521BB6375B006754DB /* Foursquare.m */,
8D7DCD4F1BAF859400A92AD2 /* ViewController.h */,
8D7DCD501BAF859400A92AD2 /* ViewController.m */,
0B5DCC171BB35C08006754DB /* MapViewController.h */,
0B5DCC181BB35C08006754DB /* MapViewController.m */,
0B5DCC4E1BB62EAB006754DB /* CustomFSTableViewCell.h */,
0B5DCC4F1BB62EAB006754DB /* CustomFSTableViewCell.m */,
8D7DCD521BAF859400A92AD2 /* Main.storyboard */,
8D7DCD551BAF859400A92AD2 /* Assets.xcassets */,
8D7DCD571BAF859400A92AD2 /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -152,6 +180,10 @@
8D7DCD511BAF859400A92AD2 /* ViewController.m in Sources */,
8D7DCD4E1BAF859400A92AD2 /* AppDelegate.m in Sources */,
8D7DCD4B1BAF859400A92AD2 /* main.m in Sources */,
0B5DCC191BB35C08006754DB /* MapViewController.m in Sources */,
0B5DCC1C1BB35DDB006754DB /* APIManager.m in Sources */,
0B5DCC501BB62EAB006754DB /* CustomFSTableViewCell.m in Sources */,
0B5DCC531BB6375B006754DB /* Foursquare.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -300,6 +332,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
// LearnAPIS
//
// Created by Artur Lan on 9/20/15.
// Copyright © 2015 Artur Lan. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface APIManager : NSObject

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

@end
33 changes: 33 additions & 0 deletions TalkinToTheNet/TalkinToTheNet/APIManager.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// APIManager.m
// LearnAPIS
//
// Created by Artur Lan on 9/20/15.
// Copyright © 2015 Artur Lan. 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
Loading