Skip to content
Grigorii Lutkov edited this page Apr 19, 2021 · 1 revision

To handle actions you can use delegate, closures or notifications:

Delegate

// LGSideMenuDelegate.swift

func willShowLeftView(sideMenuController: LGSideMenuController)
func didShowLeftView(sideMenuController: LGSideMenuController)

func willHideLeftView(sideMenuController: LGSideMenuController)
func didHideLeftView(sideMenuController: LGSideMenuController)

func willShowRightView(sideMenuController: LGSideMenuController)
func didShowRightView(sideMenuController: LGSideMenuController)

func willHideRightView(sideMenuController: LGSideMenuController)
func didHideRightView(sideMenuController: LGSideMenuController)

func showAnimationsForLeftView(sideMenuController: LGSideMenuController, duration: TimeInterval)
func hideAnimationsForLeftView(sideMenuController: LGSideMenuController, duration: TimeInterval)

func showAnimationsForRightView(sideMenuController: LGSideMenuController, duration: TimeInterval)
func hideAnimationsForRightView(sideMenuController: LGSideMenuController, duration: TimeInterval)

Closures

var willShowLeftView: (sideMenuController: LGSideMenuController) -> Void
var didShowLeftView: (sideMenuController: LGSideMenuController) -> Void

var willHideLeftView: (sideMenuController: LGSideMenuController) -> Void
var didHideLeftView: (sideMenuController: LGSideMenuController) -> Void

var willShowRightView: (sideMenuController: LGSideMenuController) -> Void
var didShowRightView: (sideMenuController: LGSideMenuController) -> Void

var willHideRightView: (sideMenuController: LGSideMenuController) -> Void
var didHideRightView: (sideMenuController: LGSideMenuController) -> Void

var showAnimationsForLeftView: (sideMenuController: LGSideMenuController, duration: TimeInterval) -> Void
var hideAnimationsForLeftView: (sideMenuController: LGSideMenuController, duration: TimeInterval) -> Void

var showAnimationsForRightView: (sideMenuController: LGSideMenuController, duration: TimeInterval) -> Void
var hideAnimationsForRightView: (sideMenuController: LGSideMenuController, duration: TimeInterval) -> Void

Notifications

let LGSideMenuController.Notification.willShowLeftView
let LGSideMenuController.Notification.didShowLeftView

let LGSideMenuController.Notification.willHideLeftView
let LGSideMenuController.Notification.didHideLeftView

let LGSideMenuController.Notification.willShowRightView
let LGSideMenuController.Notification.didShowRightView

let LGSideMenuController.Notification.willHideRightView
let LGSideMenuController.Notification.didHideRightView

let LGSideMenuController.Notification.showAnimationsForLeftView
let LGSideMenuController.Notification.hideAnimationsForLeftView

let LGSideMenuController.Notification.showAnimationsForRightView
let LGSideMenuController.Notification.hideAnimationsForRightView
Clone this wiki locally