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

Problem mit dem Cancel-Button #5

wants to merge 1 commit into from

Conversation

philippreiser
Copy link

Hi, ich kann keine Verbindung zwischen dem Cancel Button und dem
CanvasViewControler herstellen. Danke

Hi, ich kann keine Verbindung zwischen dem Cancel Button und dem
CanvasViewControler herstellen. Danke
@ChrisBtt
Copy link

ChrisBtt commented May 19, 2016

Hey Philipp ich helfe dir mal n bisschen
Erstmal musst du der unwindToCanvas Funktion eine switch Abfrage hinzufügen, die die Exit Segue auf deren identifier untersucht. Eine extra dismissViewControllerAnimated Funktion ist nicht nötig, das passiert automatisch, wenn die Funktion ein Exit Segue ist.


@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants