Title: perform segue after admob ad is dismissed
Tags: ios;swift;admob;segue
Question: any idea on how to perform this segue. Once users sign up and they are authenticated they will be shown an interstitial ad. however once the ad is done or dismissed. the segue to the next view controller should be performed. I not exactly sure what im missing in my code: 

```@IBAction func signUpBtn_TouchUpInside(_ sender: Any) {
    view.endEditing(true)
    ProgressHUD.show("Waiting...", interaction: false)
    if let profileImg = self.selectedImage, let imageData = UIImageJPEGRepresentation(profileImg, 0.1) {
        AuthService.signUp(username: usernameTextField.text!, email: emailTextField.text!, password: passwordTextField.text!, imageData: imageData, onSuccess: {
            ProgressHUD.showSuccess("Success")
            if self.interstitial.isReady {
                self.interstitial.present(fromRootViewController: self)
            } else {
                print("Ad wasn't ready")
                self.performSegue(withIdentifier: "signUpToTabbarVC", sender: nil)
            }
            self.performSegue(withIdentifier: "signUpToTabbarVC", sender: nil)
        }, onError: { (errorString) in
            ProgressHUD.showError(errorString!)
        })
    } else {
        ProgressHUD.showError("Profile Image can't be empty")
    }
}
```

and help or feedback is always greatly appreciated 

Comment: what is the error ?


Here is another answer: You should conform your ```ViewController``` to ```interstitial``` ```delegate``` and perform the ```segue``` when ```interstitial``` is dismissed

```extension ViewController: GADInterstitialDelegate {

    func interstitialDidDismissScreen(_ ad: GADInterstitial) {
        self.performSegue(withIdentifier: "signUpToTabbarVC", sender: nil)
    }
}
```

And update ```signUpBtn_TouchUpInside``` method as below,

```@IBAction func signUpBtn_TouchUpInside(_ sender: Any) {
    view.endEditing(true)
    ProgressHUD.show("Waiting...", interaction: false)
    if let profileImg = self.selectedImage, let imageData = UIImageJPEGRepresentation(profileImg, 0.1) {
        AuthService.signUp(username: usernameTextField.text!, email: emailTextField.text!, password: passwordTextField.text!, imageData: imageData, onSuccess: {
            self.handleSignupSuccess()
        }, onError: { (errorString) in
            ProgressHUD.showError(errorString!)
        })
    } else {
        ProgressHUD.showError("Profile Image can't be empty")
    }
}

private func handleSignupSuccess() {
   ProgressHUD.showSuccess("Success")
   if self.interstitial.isReady {   
       self.interstitial.delegate = self          
       self.interstitial.present(fromRootViewController: self)
   } else {
      print("Ad wasn't ready"
      self.performSegue(withIdentifier: "signUpToTabbarVC", sender: nil)
   }
}
```


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2018:00:07/01/18', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ios><swift><admob><segue>', 'Title': 'perform segue after admob ad is dismissed', 'ViewCount': 139, 'id': 51122452, 'user_AboutMe': '', 'user_AccountId': 13228399.0, 'user_DisplayName': 'CoryDesignedIt', 'user_Reputation': 1.0, 'user_Views': 16.0, 'user_id': 9552858.0}}