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
25 changes: 25 additions & 0 deletions unit-2-assessment/unit-2-assessment.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
objects = {

/* Begin PBXBuildFile section */
518239311BD2A52C00F44326 /* APIMomager.m in Sources */ = {isa = PBXBuildFile; fileRef = 518239301BD2A52C00F44326 /* APIMomager.m */; settings = {ASSET_TAGS = (); }; };
518239341BD2A5F200F44326 /* APIResults.m in Sources */ = {isa = PBXBuildFile; fileRef = 518239331BD2A5F200F44326 /* APIResults.m */; settings = {ASSET_TAGS = (); }; };
518239371BD2AB8B00F44326 /* SearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 518239361BD2AB8B00F44326 /* SearchViewController.m */; settings = {ASSET_TAGS = (); }; };
5182393A1BD2B11700F44326 /* ForecastTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 518239391BD2B11700F44326 /* ForecastTableViewController.m */; settings = {ASSET_TAGS = (); }; };
8D6765A61BD289BC00B30411 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D6765A51BD289BC00B30411 /* main.m */; };
8D6765A91BD289BC00B30411 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D6765A81BD289BC00B30411 /* AppDelegate.m */; };
8D6765AC1BD289BC00B30411 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D6765AB1BD289BC00B30411 /* ViewController.m */; };
Expand All @@ -17,6 +21,14 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
5182392F1BD2A52C00F44326 /* APIMomager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIMomager.h; sourceTree = "<group>"; };
518239301BD2A52C00F44326 /* APIMomager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APIMomager.m; sourceTree = "<group>"; };
518239321BD2A5F200F44326 /* APIResults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIResults.h; sourceTree = "<group>"; };
518239331BD2A5F200F44326 /* APIResults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APIResults.m; sourceTree = "<group>"; };
518239351BD2AB8B00F44326 /* SearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchViewController.h; sourceTree = "<group>"; };
518239361BD2AB8B00F44326 /* SearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchViewController.m; sourceTree = "<group>"; };
518239381BD2B11700F44326 /* ForecastTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForecastTableViewController.h; sourceTree = "<group>"; };
518239391BD2B11700F44326 /* ForecastTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ForecastTableViewController.m; sourceTree = "<group>"; };
8D6765A11BD289BC00B30411 /* unit-2-assessment.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "unit-2-assessment.app"; sourceTree = BUILT_PRODUCTS_DIR; };
8D6765A51BD289BC00B30411 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8D6765A71BD289BC00B30411 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -64,6 +76,14 @@
8D6765A81BD289BC00B30411 /* AppDelegate.m */,
8D6765AA1BD289BC00B30411 /* ViewController.h */,
8D6765AB1BD289BC00B30411 /* ViewController.m */,
5182392F1BD2A52C00F44326 /* APIMomager.h */,
518239301BD2A52C00F44326 /* APIMomager.m */,
518239321BD2A5F200F44326 /* APIResults.h */,
518239331BD2A5F200F44326 /* APIResults.m */,
518239351BD2AB8B00F44326 /* SearchViewController.h */,
518239361BD2AB8B00F44326 /* SearchViewController.m */,
518239381BD2B11700F44326 /* ForecastTableViewController.h */,
518239391BD2B11700F44326 /* ForecastTableViewController.m */,
8D6765AD1BD289BC00B30411 /* Main.storyboard */,
8D6765B31BD289BC00B30411 /* Assets.xcassets */,
8D6765B51BD289BC00B30411 /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -152,10 +172,14 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
518239311BD2A52C00F44326 /* APIMomager.m in Sources */,
518239341BD2A5F200F44326 /* APIResults.m in Sources */,
8D6765B21BD289BC00B30411 /* unit_2_assessment.xcdatamodeld in Sources */,
8D6765AC1BD289BC00B30411 /* ViewController.m in Sources */,
8D6765A91BD289BC00B30411 /* AppDelegate.m in Sources */,
8D6765A61BD289BC00B30411 /* main.m in Sources */,
5182393A1BD2B11700F44326 /* ForecastTableViewController.m in Sources */,
518239371BD2AB8B00F44326 /* SearchViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -302,6 +326,7 @@
8D6765BD1BD289BC00B30411 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

Expand Down
17 changes: 17 additions & 0 deletions unit-2-assessment/unit-2-assessment/APIMomager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// APIMomager.h
// unit-2-assessment
//
// Created by Natalia Estrella on 10/17/15.
// Copyright © 2015 Michael Kavouras. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface APIMomager : NSObject

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


@end
31 changes: 31 additions & 0 deletions unit-2-assessment/unit-2-assessment/APIMomager.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// APIMomager.m
// unit-2-assessment
//
// Created by Natalia Estrella on 10/17/15.
// Copyright © 2015 Michael Kavouras. All rights reserved.
//

#import "APIMomager.h"

@implementation APIMomager

//creating a method
+ (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
20 changes: 20 additions & 0 deletions unit-2-assessment/unit-2-assessment/APIResults.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// APIResults.h
// unit-2-assessment
//
// Created by Natalia Estrella on 10/17/15.
// Copyright © 2015 Michael Kavouras. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface APIResults : NSObject

@property (nonatomic) NSString *temperatureMin;
@property (nonatomic) NSString *temperatureMax;
@property (nonatomic) NSString *summary;
@property (nonatomic) NSString *icon;

@property (nonatomic) NSString *temp;

@end
13 changes: 13 additions & 0 deletions unit-2-assessment/unit-2-assessment/APIResults.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// APIResults.m
// unit-2-assessment
//
// Created by Natalia Estrella on 10/17/15.
// Copyright © 2015 Michael Kavouras. All rights reserved.
//

#import "APIResults.h"

@implementation APIResults

@end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand Down
118 changes: 115 additions & 3 deletions unit-2-assessment/unit-2-assessment/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,26 +1,138 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" 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="E3I-40-Whf">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
</dependencies>
<scenes>
<!--View Controller-->
<!--Search View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="SearchViewController" 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>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Lat" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="SJk-FM-Jiy">
<rect key="frame" x="279" y="285" width="42" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Lng" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ryc-oi-yY2">
<rect key="frame" x="277" y="325" width="46" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xD9-D4-zje">
<rect key="frame" x="5" y="25" width="48" height="30"/>
<state key="normal" title="Cancel"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ifq-3g-Hme">
<rect key="frame" x="561" y="25" width="34" height="30"/>
<state key="normal" title="Save"/>
<connections>
<segue destination="zKr-hq-Paa" kind="show" id="Ufl-Kp-VbP"/>
</connections>
</button>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="ryc-oi-yY2" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="E6c-0N-xOK"/>
<constraint firstAttribute="trailing" secondItem="ifq-3g-Hme" secondAttribute="trailing" constant="5" id="EqX-vc-1sl"/>
<constraint firstItem="xD9-D4-zje" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="5" id="R7M-dz-A5X"/>
<constraint firstItem="ryc-oi-yY2" firstAttribute="top" secondItem="SJk-FM-Jiy" secondAttribute="bottom" constant="10" id="SYn-a2-b34"/>
<constraint firstItem="ifq-3g-Hme" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="5" id="Z67-2z-oc2"/>
<constraint firstItem="xD9-D4-zje" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="5" id="fJx-oj-Frf"/>
<constraint firstItem="SJk-FM-Jiy" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="snx-42-XnD"/>
<constraint firstItem="SJk-FM-Jiy" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="t5E-Gw-7zF"/>
</constraints>
</view>
<connections>
<outlet property="latitude" destination="SJk-FM-Jiy" id="rsc-pX-fL4"/>
<outlet property="longitude" destination="ryc-oi-yY2" id="3Al-dk-HAC"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-133" y="306"/>
</scene>
<!--Root View Controller-->
<scene sceneID="eRo-lb-su2">
<objects>
<tableViewController storyboardIdentifier="FTBController" id="E3I-40-Whf" customClass="ForecastTableViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="0As-Ll-KrU">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="CellIdentifier" id="PTi-og-WZ3">
<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="PTi-og-WZ3" id="wmw-9o-gCt">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
<connections>
<segue destination="c0e-7n-hom" kind="showDetail" id="do8-aO-Wfb"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="4uz-aQ-o7Q">
<rect key="frame" x="0.0" y="72" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="4uz-aQ-o7Q" id="jy3-8Z-IhX">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="zz2-xr-wVv">
<rect key="frame" x="0.0" y="116" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zz2-xr-wVv" id="ZfB-Gc-Feh">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="E3I-40-Whf" id="91d-AF-yLC"/>
<outlet property="delegate" destination="E3I-40-Whf" id="QFZ-3p-hsr"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Root View Controller" id="j3K-kb-hX2"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="qmT-Ap-wUS" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1540" y="306"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="As5-e6-H0F">
<objects>
<navigationController id="c0e-7n-hom" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Eoe-fJ-iua">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="sYV-Cj-20l" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2273" y="312"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="jh8-pf-Cvq">
<objects>
<navigationController id="zKr-hq-Paa" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="gub-Xq-VeL">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="YJI-pT-2E2" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="720" y="305"/>
</scene>
</scenes>
</document>
13 changes: 13 additions & 0 deletions unit-2-assessment/unit-2-assessment/ForecastTableViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ForecastTableViewController.h
// unit-2-assessment
//
// Created by Natalia Estrella on 10/17/15.
// Copyright © 2015 Michael Kavouras. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ForecastTableViewController : UITableViewController

@end
Loading