Latest 1.0
Homepage https://github.com/madmaxmv/hndlSegue
License MIT
Platforms ios 8.0
Frameworks Foundation
Authors

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.

Version

0.2

Installation

pod 'hndlSegue', '~> 0.1'

Addition in project

import hndlSegue

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

Using

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

Example

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": "https://github.com/madmaxmv/hndlSegue",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "matyushenko": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/madmaxmv/hndlSegue.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