Latest 1.0
License MIT
Platforms ios 8.0
Frameworks Foundation

hndlSegue it is a cocoapod which allows to use blocks in performSegueWithIdentifier. Then you import hndlSegue to you project this pod exten functionality of UIViewController.

You can also:

  • use performSegueWithIdentifier without handler and use prepareForSegue by default
  • send handler to performSegueWithIdentifier. This handler will invoke after default method prepareForSegue.




pod 'hndlSegue', '~> 0.1'

Addition in project

import hndlSegue

You need import hndlSegue pod in all source file where this functionality used


self.performSegueWithIdentifier(segueID, sender: someSender) { segue, sender in
// some code


self.performSegueWithIdentifier("ShowStations", sender: nil) { segue, sender in
let controller = segue.destinationViewController as! StationsListViewController
controller.directionType = "citiesTo"

More info

When you call performSegueWithIdentifier add use handler, this pos save your handler in dictionary. After that method prepareForSegue swizzled on swizledPrepareForSegue method. In swizledPrepareForSegue I call origin prepareForSegue and find your handler in dictionary by segueID. If handler not nil, this handler will invoked.

Latest podspec

    "name": "hndlSegue",
    "version": "1.0",
    "summary": "hndlSegue make work with segues easy",
    "description": "hndlSegue is a simple lib what allow to call performSegueWithIdentifier with block of code(handler for that segue).",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "matyushenko": "[email protected]"
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "v1.0"
    "source_files": "SegueExtension/*.swift",
    "exclude_files": "Exclude",
    "frameworks": "Foundation",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This