iOS 屏幕弹框

需要弹出哪个View  ,就在哪个View中写个方法,在.h中也定义下方法,需要的时候直接调用方法

-(void)show{
  AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate ;
    UIView *rootView = appDelegate.window.rootViewController.view ;
    if ([rootView viewWithTag:kTag]) {
        return ;
    }
    
    [rootView addSubview:self];  
    self.tag = 123456;
}

  

原文地址:https://www.cnblogs.com/huangzhenwei/p/9856702.html