ユーザーが定義済みのジオフェンスを出たとき。関数内の他のすべてのコードは期待どおりに起動しますが、ビューは閉じません。助言がありますか?
func locationManager(manager: CLLocationManager, didExitRegion region: CLRegion) {
let defaults = NSUserDefaults.standardUserDefaults()
defaults.setBool(false, forKey: self.userCheckInKey)
ProgressHUD.showError("You are no longer checked-in")
//self.performSegueWithIdentifier("unwindToMainScreen", sender: self)
self.dismissViewControllerAnimated(true, completion: nil)
}
また、私は JSQMessages ライブラリを使用しており、このビューは JSQMessagesView です。
import UIKit
import Foundation
import AVKit
import AVFoundation
class LocalMessagesViewController: JSQMessagesViewController, UIActionSheetDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, CLLocationManagerDelegate
更新された機能:
func locationManager(manager: CLLocationManager, didExitRegion region: CLRegion) {
let defaults = NSUserDefaults.standardUserDefaults()
defaults.setBool(false, forKey: self.userCheckInKey)
dispatch_async(dispatch_get_main_queue()) {
ProgressHUD.showError("You are no longer checked-in")
self.dismissViewControllerAnimated(true, completion: nil)
}
}