ios - How to call a delegate function from within a custom function? -


i'm using uipageviewcontroller , i'm trying call delegate function:

    public func pageviewcontroller(_ pageviewcontroller: uipageviewcontroller, willtransitionto pendingviewcontrollers: [uiviewcontroller]) { } 

from within custom function:

func timer () { //call uipageviewcontroller, willtransitionto here } 

is there way it?

before can call function need set within view controller delegate instance in question, e.g.

let pvc = uipageviewcontroller() pvc.delegate = self // assumes class adopts uipageviewcontroller delegate protocol , adheres 

you can access delegate , in turn call methods on delegate so:

func timer () {    let pvcdelegate = pvc?.delegate    // use pvcdelegate followed function wish call } 

however unusual call delegate methods yourself. uipageviewcontroller instance calling delegate.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -