SessionFilterControllerAdditions

public protocol SessionFilterControllerAdditions

The controller you return from your SessionFilter viewController() function can optionally conform to this protocol if you want it to have access to helper functions that enable dismissing it or provide it contextual information such as which image, video or video segment is currently being edited.

Your controller simply needs to conform to this protocol and nothing else. You do not need to implement these functions, only call them.

For example:

SessionFilterExampleController: UIViewController, SessionFilterControllerAdditions {

    @IBAction func buttonPressed() {
        // Call the done function to dismiss the controller
        self.done(animated: true)
    }
}
  • Call this to dismiss your custom UIViewController and revert any changes made to the SessionFilter during the time the UIViewController was visible. This call will be forwarded up the controller chain until a controller takes responsibility for dismissing your controller.

    You do not need to implement this method, only call it.

    Declaration

    Swift

    func cancel(animated: Bool, completion: (() -> Void)?)
  • Call this to dismiss your custom UIViewController and save any changes made to the SessionFilter during the time the UIViewController was visible. This call will be forwarded up the controller chain until a controller takes responsibility for dismissing your controller.

    You do not need to implement this method, only call it.

    Declaration

    Swift

    func done(animated: Bool, completion: (() -> Void)?)
  • If the controller was presented while an image was being edited this will be set.

    Declaration

    Swift

    var image: SessionImage? { get set }
  • If the controller was presented while a video (but not an individual segment) was being edited this will be set.

    Declaration

    Swift

    var video: SessionVideo? { get set }
  • If the controller was presented while an individual segment was being edited this will be set.

    Declaration

    Swift

    var segment: SessionVideoSegment? { get set }