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

Problem mit dem Cancel-Button #5

Open
wants to merge 1 commit 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
6 changes: 5 additions & 1 deletion Seasonizer/CanvasViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ class CanvasViewController: UIViewController, UINavigationControllerDelegate, UI


// TODO: Implement `prepareForSegue(_:sender:)` to pass `allAccessories` on to `AccessoryListViewController`.


/*
HINT: The `AccessoryListViewController` should be embedded in a `UINavigationController`:

Expand All @@ -130,7 +132,9 @@ class CanvasViewController: UIViewController, UINavigationControllerDelegate, UI


// TODO: Implement an `@IBAction func unwindToCanvas(segue: UIStoryboardSegue)` Unwing Segue that the `AccessoryListViewController` can exit to.

@IBAction func unwindToCanvas(segue: UIStoryboardSegue){
dismissViewControllerAnimated(true, completion: nil)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genau, wie @ChrisBtt sagt wird durch so eine Unwind Segue einfach der Punkt in der View Controller Hierarchie definiert, zu der die Segue zurückkehrt. Das passiert dann automatisch. Du musst nur eine Verbindung zur Exit Schaltfläche ziehen und der Segue dann einen identifier geben:
bildschirmfoto 2016-05-21 um 13 37 35

Dann kannst du in unwindToCanvas und prepareForSegue je nach identifier entscheiden, was zu tun ist.

// TODO: For the "selectedAccessory" segue, obtain the selected accessory and add it to the canvas.
/*
HINTS:
Expand Down
2 changes: 1 addition & 1 deletion Seasonizer/Launch Screen.storyboard
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" 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="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
Expand Down
82 changes: 78 additions & 4 deletions Seasonizer/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="A6u-BR-TcU">
<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="A6u-BR-TcU">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
Expand All @@ -15,14 +15,88 @@
<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>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dXA-ha-4of">
<rect key="frame" x="0.0" y="64" width="600" height="492"/>
</imageView>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dHc-8W-Iac">
<rect key="frame" x="0.0" y="64" width="600" height="492"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<toolbarItems/>
<navigationItem key="navigationItem" title="Seasonizer" id="6dS-Kq-rKs"/>
<toolbarItems>
<barButtonItem style="plain" systemItem="trash" id="DZM-45-x9e"/>
<barButtonItem style="plain" systemItem="flexibleSpace" id="8Xh-NE-dKj"/>
<barButtonItem systemItem="camera" id="Vmx-UL-69U">
<connections>
<action selector="cameraButtonPressed:" destination="BYZ-38-t0r" id="9Se-qI-b9f"/>
</connections>
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="Yt2-3D-GGX"/>
<barButtonItem title="Acessories.." id="zCk-Rp-x4w">
<connections>
<segue destination="wTT-Uc-3sI" kind="show" id="43P-fg-pNX"/>
</connections>
</barButtonItem>
</toolbarItems>
<navigationItem key="navigationItem" title="Seasonizer" id="6dS-Kq-rKs">
<barButtonItem key="rightBarButtonItem" systemItem="action" id="4u9-2n-AOr"/>
</navigationItem>
<connections>
<outlet property="photoImageView" destination="dXA-ha-4of" id="qGU-9D-QHf"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1010" y="136"/>
<point key="canvasLocation" x="1043" y="129"/>
</scene>
<!--Accesories-->
<scene sceneID="3wN-gq-1RA">
<objects>
<tableViewController id="7rx-PC-MJ0" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="GmK-Eu-HfK">
<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" id="XVf-5t-E3T">
<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="XVf-5t-E3T" id="ELY-Rh-kkt">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<connections>
<outlet property="delegate" destination="7rx-PC-MJ0" id="Eya-Oa-jf1"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Accesories" id="lDc-Z3-Flk">
<barButtonItem key="rightBarButtonItem" systemItem="cancel" id="TjH-YQ-5qw"/>
</navigationItem>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Bni-wt-6JY" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2479" y="101"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="md3-98-57c">
<objects>
<navigationController id="wTT-Uc-3sI" sceneMemberID="viewController">
<navigationItem key="navigationItem" id="Izd-Gc-3Ma"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="YTX-lH-nbD">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="7rx-PC-MJ0" kind="relationship" relationship="rootViewController" id="KfA-pV-h3B"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="WWp-qX-q1m" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1832" y="129"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="WSz-3O-Obv">
Expand Down