Holen Sie sich Klasse Namen UIViewController in swift

Wie man Klasse name UIViewController Klasse in swift

In Objective-C, können wir so etwas tun :

self.appDelegate = (shAppDelegate *)[[UIApplication sharedApplication] delegate];
    UIViewController *last_screen = self.appDelegate.popScreens.lastObject ;

    if(last_screen.class != self.navigationController.visibleViewController.class){

    //.......

}

aber in swift habe ich versucht wie in diesem

let appDelegate = UIApplication.sharedApplication().delegate as AppDelegate
    let last_screen = appDelegate.popScreens?.lastObject as UIViewController

können dies nicht tun.

if last_screen.class != self.navigationController.visibleViewController.class{

//....

}

keine Methode der Klasse UIViewController ich.e letzten Bildschirm

InformationsquelleAutor Qadir Hussain | 2014-10-14

Schreibe einen Kommentar