SWRevealViewController, нажимающий FrontVC, не вызывает анимацию и не отвечает на уведомления
Я работаю над SWRevealViewController, в котором у меня есть сценарий, в котором -
Ссылка на демонстрационный код -https://www.dropbox.com/s/02fjub838hv95cr/SWRevealVC.zip?dl=0
1) Я должен представить представление ViewController * (NotificationVC в моей раскадровке) * в моем FrontVC.
** 2) ** В этом представлении childVC есть кнопка * (createNotification) *, которая подключена к другому viewController * (createNotificationVC) * черезпользовательский переход (SWRevealViewControllerSeguePushController), который имеет кнопку назад
** 3) ** Нажав кнопку «Назад», пользователь снова возвращается к frontVC с некоторым сообщением, которое будет передано FrontVC.
Для передачи этого сообщения я использую Шаблон уведомления.
В моем фронте ВК -
override func viewDidLoad()
{
super.viewDidLoad()
self.revealViewController().delegate = self
self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
if self.revealViewController() != nil
{
self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
self.view.addGestureRecognizer(self.revealViewController().tapGestureRecognizer())
}
let NtfctnVC = self.storyboard?.instantiateViewControllerWithIdentifier("NtfctnVC")
addChildViewController(NtfctnVC!)
NtfctnVC!.view.frame = CGRectMake(0, 0,self.customView.frame.width, self.customView.frame.height)
customView.addSubview(NtfctnVC!.view)//add the childVC's view
NtfctnVC! .DidMoveToParentViewController (Я)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "methodOfReceivedNotification:", name:"NotificationIdentifier", object: nil)
}
func methodOfReceivedNotification(notification: NSNotification)
{
//Take Action on Notification
let userInfo = notification.userInfo
print(userInfo!["sentTag"] as? Int)
NSNotificationCenter.defaultCenter().removeObserver(self)
}
В действии кнопки Назад CreateNotificationVC у меня есть -
@IBAction func bck(sender: AnyObject)
{
let frontVC = self.storyboard?.instantiateViewControllerWithIdentifier("frontNVC") //frontNVC is the navigation controller of frontVC
NSNotificationCenter.defaultCenter().postNotificationName("NotificationIdentifier", object: nil, userInfo: ["sentTag":2])
self.revealViewController().pushFrontViewController(frontVC, animated: true)//here the frontVC is presented with no animation.
}
Проблема -
1) Анимация при выполнении пользовательского перехода не отображается. 2) Уведомления не передаются на frontVC.
Пожалуйста, помогите мне с этим, поскольку я перепробовал много вещей и гуглил, но тщетно. Благодарю.
Это показывает мое соединение SWR с передней и задней ВК
Это показывает мое соединение NotificationVC / childVC. * Отметить: * Кнопка ChildVC, подключенная через пользовательский переход к createNotificationVC.