Search code examples
iosobjective-cswifttranslate

What is (ViewController *)self.presentingViewController; in swift?


I know this is a very stupid question but I have really no where to ask. I need to translate this line of code:

(ViewController *)self.presentingViewController; 

from Objective-C to swift.


Solution

  • Instead of:

    (ViewController *)self.presentingViewController;
    

    Use:

    self.presentingViewController as ViewController