Ios 如何从侧菜单中显示和取消活动
我从中实现了侧菜单框架 我想在我自己的类中实现SideMenu类中的方法,以便在显示或取消侧菜单时可以更改UIImage 这是来自侧菜单类的方法Ios 如何从侧菜单中显示和取消活动,ios,swift,Ios,Swift,我从中实现了侧菜单框架 我想在我自己的类中实现SideMenu类中的方法,以便在显示或取消侧菜单时可以更改UIImage 这是来自侧菜单类的方法 // MARK: UIViewControllerTransitioningDelegate protocol methods // return the animator when presenting a viewcontroller // rememeber that an animator (or animation controller)
// 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
}
您需要子类化UISideMenuNavigationController以获得ViewDidDisplay和ViewDidEnglishe。检查这个答案