mutualmobile / MMProgressHUD

An easy-to-use HUD interface with personality.
MIT License
705 stars 131 forks source link

Remove Image from HUD #8

Closed V4i0s closed 11 years ago

V4i0s commented 11 years ago

Hi,

I set the HUD with:

[MMProgressHUD showWithTitle:nil status:@"Blub" image:[UIImage imageNamed:@"blub.png"]];

after this call:

[MMProgressHUD showWithTitle:nil status:@"BlubhasChange" image:nil];

the image on the HUD is not remove and the the HUD is not updated.

How can remove the image?

larsacus commented 11 years ago

The second line of code you show above should remove the image, as it should be equivalent to calling [MMProgressHUD showWithStatus:@"BlubhasChange"];

Based on the code that I'm looking at now, your second line above should crash since we're constructing an array under the covers with whatever you pass in for image:.

The design intent is in the cocoa pods documentation (which is in each header):

@warning All `show` methods are mutually exclusive of one another. Use the updateStatus: method to update the HUD's status while maintaining all previously set presentation attributes such as image, images, cancelBlock, title, or confirmationMessage. For example: calling showWithTitle:status: after calling showWithTitle:status:image: will wipe out the image specified in the latter call.
V4i0s commented 11 years ago

Hi,

no is not crash. But the HUD is not updated.

I have two requests.

On the begin of the first request I want to show a HUD with an Image. When the request is finish and the next request is executed then i want to show a HUD with a spinner. So how can I do this.

I have try the description in the documentation but the HUD is not updated only the status. The image stays.

larsacus commented 11 years ago

So to clarify, you call [MMProgressHUD showWithTitle:nil status:@"Blub" image:[UIImage imageNamed:@"blub.png"]], then you are calling [MMProgressHUD showWithStatus:@"BlubhasChange"] and the image is not going away?

larsacus commented 11 years ago

Reproduced it. It was a pretty basic oversight on my part. I've added a new row in the demo in the branch above that demos this specific feature.

This is how it should have worked all along.

larsacus commented 11 years ago

Marking this as resolved with the latest commits in master.