-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fast_fertig: nur Problem bei PerformRequest #5
Open
FelixMei
wants to merge
7
commits into
iOS-Dev-Kurs:master
Choose a base branch
from
FelixMei:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+455
−151
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a6f08ee
implemented pokedex
nilsvu 332c1b8
Fast_fertig: nur Problem bei PerformRequest
FelixMei d5d8e94
Fast_fertig: nur Problem bei PerformRequest
FelixMei efaa5b4
in Master
FelixMei 2d3563c
Master_Branch_merge_fixed
FelixMei e312b00
Fast_fertig; Error bei Request trotz Fix?
FelixMei a1e6cb5
Fertig (läuft) ;)
FelixMei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,44 +1,77 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="E10-YL-lxp"> | ||
<<<<<<< HEAD | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="E10-YL-lxp"> | ||
======= | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> | ||
>>>>>>> pokedex | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> | ||
</dependencies> | ||
<scenes> | ||
<!--Tabel View Controller--> | ||
<scene sceneID="BhY-Tf-hbW"> | ||
<objects> | ||
<tableViewController id="I2N-vN-JyT" customClass="SWTabelViewController" customModule="APIClient" customModuleProvider="target" sceneMemberID="viewController"> | ||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="afX-7l-FKq"> | ||
<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" indentationWidth="10" reuseIdentifier="Cell" textLabel="z52-Kc-dvv" detailTextLabel="MmQ-p9-Suq" style="IBUITableViewCellStyleValue1" id="hak-we-ati" customClass="SWPlanetsTableViewCell" customModule="APIClient" customModuleProvider="target"> | ||
<rect key="frame" x="0.0" y="92" width="600" height="44"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hak-we-ati" id="a0A-OM-Lg3"> | ||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="z52-Kc-dvv"> | ||
<rect key="frame" x="15" y="12" width="32" height="20"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="16"/> | ||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="MmQ-p9-Suq"> | ||
<rect key="frame" x="543" y="12" width="42" height="20"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="16"/> | ||
<color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="calibratedRGB"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
</tableViewCellContentView> | ||
<accessibility key="accessibilityConfiguration" identifier="Cell"/> | ||
</tableViewCell> | ||
</prototypes> | ||
<connections> | ||
<outlet property="dataSource" destination="I2N-vN-JyT" id="BPT-IH-Spw"/> | ||
<outlet property="delegate" destination="I2N-vN-JyT" id="RY6-hL-i07"/> | ||
</connections> | ||
</tableView> | ||
<navigationItem key="navigationItem" id="6RB-g8-Nrl"/> | ||
</tableViewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="EPB-U2-OgQ" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="2575" y="388"/> | ||
</scene> | ||
<!--Navigation Controller--> | ||
<scene sceneID="Xrb-yS-kMZ"> | ||
<scene sceneID="1ak-lJ-4VT"> | ||
<objects> | ||
<navigationController id="E10-YL-lxp" sceneMemberID="viewController"> | ||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="amJ-5H-qs5"> | ||
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="q66-ie-KW5" sceneMemberID="viewController"> | ||
<toolbarItems/> | ||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Rf9-m1-zrX"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
</navigationBar> | ||
<nil name="viewControllers"/> | ||
<connections> | ||
<segue destination="rPr-Fp-ALE" kind="relationship" relationship="rootViewController" id="g8j-CJ-uaE"/> | ||
<segue destination="I2N-vN-JyT" kind="relationship" relationship="rootViewController" id="UMs-dC-BNe"/> | ||
</connections> | ||
</navigationController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="hfS-9i-aMM" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="-658" y="301"/> | ||
</scene> | ||
<!--View Controller--> | ||
<scene sceneID="adh-8k-Iuh"> | ||
<objects> | ||
<viewController id="rPr-Fp-ALE" sceneMemberID="viewController"> | ||
<layoutGuides> | ||
<viewControllerLayoutGuide type="top" id="pj8-zF-1z6"/> | ||
<viewControllerLayoutGuide type="bottom" id="kt2-9S-3TK"/> | ||
</layoutGuides> | ||
<view key="view" contentMode="scaleToFill" id="rEB-Za-Zhx"> | ||
<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"/> | ||
</view> | ||
<navigationItem key="navigationItem" id="CZR-l9-xMg"/> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="OaC-W5-AeM" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="two-VQ-G1P" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="65" y="301"/> | ||
<point key="canvasLocation" x="1763" y="388"/> | ||
</scene> | ||
</scenes> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
//SWAPI | ||
// APIClient | ||
|
||
import Foundation | ||
import Moya | ||
import Freddy | ||
|
||
|
||
|
||
/// The abstraction of the [SWAPI](http://swapi.co) REST API. | ||
enum SWAPI: Moya.TargetType { | ||
|
||
|
||
/// MARK: Endpoints | ||
|
||
case planets (NamedResource<SWPlanet>) | ||
case planets_id (NamedResource<SWPlanet>) | ||
case planets_schema (NamedResource<SWPlanet>) | ||
|
||
|
||
// MARK: Network Abstraction | ||
|
||
var baseURL: NSURL { return NSURL(string: "http://swapi.co/api")! } | ||
|
||
var path: String { | ||
switch self { | ||
case .planets(let namedResource): return "/planets/\(namedResource.name)" | ||
case .planets_id(let namedResource): return "/planets_id/\(namedResource)" | ||
case .planets_schema(let namedResource): return "/planets_schema/\(namedResource)" | ||
} | ||
} | ||
|
||
var method: Moya.Method { return .GET } | ||
|
||
var parameters: [String : AnyObject]? { | ||
switch self { | ||
default: return nil | ||
} | ||
} | ||
|
||
// TODO: Provide sample data for testing | ||
var sampleData: NSData { | ||
switch self { | ||
default: return "".dataUsingEncoding(NSUTF8StringEncoding)! | ||
} | ||
} | ||
} | ||
|
||
struct NamedResource<Resource: Freddy.JSONDecodable>: Freddy.JSONDecodable { | ||
|
||
let name: String | ||
|
||
init(name: String) { | ||
self.name = name | ||
} | ||
|
||
init(json: JSON) throws { | ||
self.name = try json.string("name") | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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 @@ | ||
// | ||
// SWView.swift | ||
// APIClient | ||
// | ||
// Created by Felix Meissner on 5/29/16. | ||
// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
class SWPlanetsTableViewCell: UITableViewCell { | ||
|
||
|
||
|
||
} |
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,68 @@ | ||
|
||
// Created by Nils Fischer on 22.05.16. | ||
// Copyright © 2016 iOS Dev Kurs Universität Heidelberg. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import Moya | ||
|
||
|
||
|
||
class SWViewController: UITableViewController, UITextFieldDelegate { | ||
|
||
/// The SWAPI provider that handles requests for server resources | ||
var swAPI: MoyaProvider<SWAPI>! | ||
|
||
|
||
@IBOutlet var Laden: UIButton! | ||
@IBOutlet var Textfeld: UITextField! | ||
|
||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
// Handle the text field’s user input through delegate callbacks. | ||
Textfeld.delegate = self | ||
} | ||
|
||
|
||
// MARK: Actions | ||
|
||
@IBAction func PerformRequest(sender: UIButton) { | ||
swAPI.request(swAPI) {result in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Die swAPI.request(.planets(NamedResource(name: "1"))) {result in // ... |
||
switch result { | ||
case .Success(let response): | ||
do { | ||
try response.filterSuccessfulStatusCodes() | ||
print(response) | ||
let json = try JSON (data: reponse.data) | ||
} catch { | ||
print(error) | ||
} | ||
case .Failure(let error): | ||
print(error) | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
} | ||
} | ||
|
||
extension SWViewController { | ||
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
return 0 | ||
} | ||
|
||
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { | ||
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) | ||
return cell | ||
} | ||
|
||
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { | ||
|
||
} | ||
} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bei dem Merge sind hier offenbar Konflikte aufgetreten, die musst du noch beheben. Einfach die
.storyboard
Datei in einem Texteditor öffnen und bei diesen Konflikt-Markierungen den oberen oder unteren Teil löschen, je nach dem was du behalten willst.Einfacher wär's vielleicht sogar das Repository nochmal zu klonen und deine Dateien dort rein zu ziehen ;)