How to get the previous viewcontroller that pushed my current view

后端 未结 10 463
礼貌的吻别
礼貌的吻别 2020-12-28 14:08

The home page of my app has UIButtons, btnIncome and btnExpense. Pressing on this buttons pushes IncomeVC and Expen

10条回答
  •  清酒与你
    2020-12-28 14:33

    UIViewController *previousViewController = [[[self navigationController]viewControllers] objectAtIndex:([viewControllers indexOfObject:self]-1)];
    

    Where self will be current view controller.

提交回复
热议问题