Question: I want to check when my position is changing if my location is near the Mark. I have marks with unique position. If i near for example 10m from mark i want to display alert. How i can do that?

[![a busy cat](https://i.stack.imgur.com/P1iRk.jpg)](https://i.stack.imgur.com/P1iRk.jpg)

Answer: 
You have to call the `present` inside the **completion** handler of the `dismiss`.

```
func readerDidCancel(_ reader: QRCodeReaderViewController) {

    weak var presentingViewController = self.presentingViewController

    self.dismiss(animated: true, completion: {
        presentingViewController?.present(ClockInOrOutViewController(), animated: true, completion: nil)
    })
}

```

If this does not work, it means your presenting view controller has also been removed somehow. (dismissed/popped?)
You can't present view controller while other view controller is dismissing and also present on dismissing view controller.
You can do something like this:

```
func readerDidCancel(_ reader: QRCodeReaderViewController) {
   let presenting = self.presentingViewController
   dismiss(animated: true, completion: {
      presenting?.present(ClockInOrOutViewController(), animated: true, completion: nil)
   }) 
}

```