UIViewController-DataTransition 1.0.6

UIViewController-DataTransition 1.0.6

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2017
SwiftSwift Version 4.0
SPMSupports SPM

Maintained by Alexey Shadura.



  • By
  • Alexey Shadura

UIViewController-DataTransition

In source viewController:

Start transition

self.segue("segueIdentifier").execute()

Start transition with data

self.segue("segueIdentifier").passData("Passed data string").execute()

Start transition with callback

self.segue("segueIdentifier").passData("Passed data string").onComplete{ parameter in
            if let stringParameter = parameter as? String{
                print(stringParameter)
            }
         }.execute()

... without data

self.segue("segueIdentifier").onComplete{ parameter in
            if let stringParameter = parameter as? String{
                print(stringParameter)
            }
         }.execute()

If segue goes to modal viewcontroller with UINavigationControler than data will be passed to first UIViewController

In destination viewController:

Process of checking of incoming data

if let passedData = self.incomingData as? String {
   print("incoming \(passedData)")
}

Passing data to source View Controller

self.complete("Data for source View Controller")
self.complete() //Just for executing callback