如何从SideMenu获得提交和解雇的活动

时间:2016-11-28 09:57:38

标签: ios swift

我从https://github.com/jonkykong/SideMenu实施了SideMenu框架。

我想在我自己的类中实现SideMenu类的方法,这样当侧面菜单显示或解散时我可以更改我的UIImage。

这是Side Menu类的方法

// MARK: UIViewControllerTransitioningDelegate protocol methods

// return the animator when presenting a viewcontroller
// rememeber that an animator (or animation controller) is any object that aheres to the UIViewControllerAnimatedTransitioning protocol
open func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    self.presenting = true
    SideMenuTransition.presentDirection = presented == SideMenuManager.menuLeftNavigationController ? .left : .right
    return self
}

// return the animator used when dismissing from a viewcontroller
open func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    presenting = false
    return self
}

1 个答案:

答案 0 :(得分:-1)

您需要将UISideMenuNavigationController子类化以获取ViewDidAppear和ViewDidDisappear。请检查此回答How do I insert code in ViewDidAppear and ViewDidDisappear From other class