I have found [this example app](https://github.com/psy2k/NMPopUpView), which works great. Now I copied the files `PopUpViewController_iPad.xib` and `PopUpViewControllerSwift.swift` to my project to use it. But on my project is crashes when I tap the 'close' button. The green exception line shows me the `AppDelegate` class declaration line (the error is EXC\_BAD\_ACCESS). The command line area shows me only the `lldb` command and no error message. I know I can query the `lldb` for information, but I don't know how to work with `lldb`.

The error:

![enter image description here](https://i.stack.imgur.com/2WtmU.png)

The stack trace:

![enter image description here](https://i.stack.imgur.com/dqsBA.png)

Since I run it for iPad air, I put in my projects main view controller the following three lines (which I copied from the example app)

```
popViewController = PopUpViewControllerSwift(nibName: "PopUpViewController_iPad", bundle: nil)
popViewController.title = "This is a popup view"
popViewController.showInView(self.view, withImage: UIImage(named: "typpzDemo"), withMessage: "You just triggered a great popup window", animated: true)

```

I thought it may be simply sending the `touchUpInside` message the the parent view which showed this popup, so I just implemented there another `closePopup` method with a simple `println("1")`, but nothing changed.

I also tried adding to `PopUpViewControllerSwift.swift` the line `self.closeButton.becomeFirstResponder()` inside the `viewDidAppear` method (of course with a defined outlet). But the bug remained the same.

I have checked that the identity inspector of "File's owner" and the Class is set correctly to PopUpViewControllerSwift, the module is None (just like in the example). I checked all outlets and stuff, but could not find any difference.

Anyone knows whats up?