Multiple UIActionSheets on the same delegate

后端 未结 3 490
梦如初夏
梦如初夏 2021-02-10 13:53

I\'m writing a puzzle game. When the user presses the check button, I see if the solution they entered is correct. Depending on the result, I present one of two action sheets fo

3条回答
  •  鱼传尺愫
    2021-02-10 14:18

    Using Tag solve this problem

    levelCompleteActionSheet.tag = 100;

    showErrorsActionSheet.tag = 101;

    - (void) levelCompleteActionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
    
      if(actionSheet.tag == 100){
    
         // levelCompleteActionSheet implement your required function
    
         }
      else if(actionSheet.tag == 101){
    
         // showErrorsActionSheet implement your required function
    
       } 
    }
    

提交回复
热议问题