Tag:Get current viewcontroller

  • Method for IOS to obtain the current viewcontroller

    Time:2021-10-19

    This article introduces IOS to obtain the current viewcontroller and share it with you. The details are as follows By simply judging [uiviewcontroller class], it is wrong to determine that it is the desired controller: if ([nextResponder isKindOfClass:[UIViewController class]]) { result = nextResponder; }else { result = window.rootViewController; } Because: iskindofclass: determines whether an object […]