Tuesday 15 June 2010

ios - Get class name of UIViewController in swift -



ios - Get class name of UIViewController in swift -

how class name of uiviewcontroller class in swift

in objective c, can :

self.appdelegate = (shappdelegate *)[[uiapplication sharedapplication] delegate]; uiviewcontroller *last_screen = self.appdelegate.popscreens.lastobject ; if(last_screen.class != self.navigationcontroller.visibleviewcontroller.class){ //....... }

but in swift tried

let appdelegate = uiapplication.sharedapplication().delegate appdelegate allow last_screen = appdelegate.popscreens?.lastobject uiviewcontroller

cant this.

if last_screen.class != self.navigationcontroller.visibleviewcontroller.class{ //.... }

no class method of uiviewcontroller i.e lastly screen

to know class name can phone call this:

var classname = nsstringfromclass(yourclass.classforcoder)

ios objective-c uiviewcontroller swift

No comments:

Post a Comment