开发者

Pop up Alert or Message to user

I want to pop up alert from one view controller to any of the controller classes. I dont know where and in which view user will be.

开发者_运维知识库

if in back end some process is going on, want to inform user to wait for some time.

Any help?


If you want to show a message to user an alert message you should use UIAlertView or UIActionSheet class (Link to the answer in what cases to use each one of them).

UIActivityIndicatorView allows you to display a spinning wheel while some action runs in background, but note that to make it work main thread should not be blocked - your action must be performed in separate thread.

Edit: (I am not sure that this is the best solution). If you just want to show a message to user and do not need user interaction meanwhile you can do the following:

  1. Disable user interaction on your view
  2. Show some overlay view over your view (you can include UIActivityIndicatorView and UILabel with message to it). You can also make it with semitransparent background to get the similar behaviour to UIAlertView.
  3. Dismiss the overlay view and reenable user interaction when you are over.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜