matej / mbprogresshud Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jdg/mbprogresshud
MBProgressHUD, an iOS activity indicator view
Home Page: http://www.bukovinski.com
License: MIT License
This project forked from jdg/mbprogresshud
MBProgressHUD, an iOS activity indicator view
Home Page: http://www.bukovinski.com
License: MIT License
I have implement MBProgressHUD in my app.
user select a tableViewCell and meanWhile a heavy Task will invoke to process text and prepare the detailsView. here I want to show an ActivityIndicator. but activity indicator won't appear until detailsViewController is going to push to the view!
I'm confused why it behave likes this!
you can download sample app from here (67 KB)
http://www.mediafire.com/download/decvu7uig9r6v1a/pageBasedApp.zip
(DataViewController *)viewControllerAtIndex:(NSUInteger)index storyboard:(UIStoryboard *)storyboard
{
[MBProgressHUD showHUDAddedTo:topView animated:YES];
sema = dispatch_semaphore_create(0);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
//here we do the heavy job
[self processText];
});
//I have used semaphore to let the data be prepared. if data is not ready startinViewcontroller will be nill and app will carsh
NSLog(@"waiting for semaphore");
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
NSLog(@"semaphore recieved");
[MBProgressHUD hideHUDForView:topView animated:YES];
.
.
.
.
}
Submit new issue
Status API Training Shop Blog About © 2013 GitHub, Inc. Terms Privacy Security Contact
Would a pull request for a simple to use tap to cancel addition be accepted? I've done this in a project I'm working on, and I think I could pretty easily implement this on the main class or as a category.
Would you be open to a pull request for this?
I know that you have offered users a way to set this up in #41 and #46. I'm basically using this method, but this would make it easier for others in the future.
I'm seeing irregular crashing from trying to set the frame to values that are NaN around line 350 in MBProgressHUD.m. The indFrame's height is a NaN value and causes a crash. The issues occurs when I'm using the MBProgressHUD to do repeated actions.
How to reproduce: Repeatedly press a button that does background work with MBProgessHUD's showWillExecuting method.
// Set the label position and dimensions
CGRect lFrame = CGRectMake(floor((frame.size.width - lWidth) / 2) + xOffset,
floor(indFrame.origin.y + indFrame.size.height + PADDING),
lWidth, lHeight);
ALog(@"lFrame: %@", NSStringFromCGRect(lFrame));
label.frame = lFrame; <=== CRASH HERE
My code to create a MBProgressHUD is here:
- (void)evolveButtonPressed:(id)sender {
[self cleanupActivityPopup]; // Cleanup any old MBProgresHUD before creating a new one
activityPopup = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
// Add to screen
[self.navigationController.view addSubview:activityPopup];
activityPopup.delegate = self;
activityPopup.labelText = @"Evolving";
[activityPopup showWhileExecuting:@selector(evolveInBackground) onTarget:self withObject:nil animated:YES];
}
- (void)evolveInBackground {
// Do evolution in background
// Update GUI on main thread
[self performSelectorOnMainThread:@selector(updateEvolveOnMainThread) withObject:nil waitUntilDone:NO];
}
- (void)updateEvolveOnMainThread {
// Reset buttons
[self reload];
}
- (void)hudWasHidden {
// Remove HUD from screen when the HUD was hidded
[self cleanupActivityPopup];
}
- (void)cleanupActivityPopup {
ALog();
if(activityPopup) {
[activityPopup removeFromSuperview];
activityPopup.delegate = nil;
[activityPopup release];
activityPopup = nil;
}
}
Stack trace:
2011-06-03 10:09:49.917 Artwork Evolution[2138:707] -[MBProgressHUD layoutSubviews] [Line 304] indFrame: {{0, 0}, {nan, nan}}
2011-06-03 10:09:49.919 Artwork Evolution[2138:707] -[MBProgressHUD layoutSubviews] [Line 354] lFrame: {{300, nan}, {167, 20}}
2011-06-03 10:09:49.923 Artwork Evolution[2138:707] void uncaughtExceptionHandler(NSException ) [Line 345]
2011-06-03 10:09:49.964 Artwork Evolution[2138:707] ** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [383.5 nan]'
*** Call stack at first throw:
(
0 CoreFoundation 0x3216064f exceptionPreprocess + 114
1 libobjc.A.dylib 0x31b64c5d objc_exception_throw + 24
2 CoreFoundation 0x32160491 +[NSException raise:format:arguments:] + 68
3 CoreFoundation 0x321604cb +[NSException raise:format:] + 34
4 QuartzCore 0x36f5a61d _ZL18CALayerSetPositionP7CALayerRKN2CA4Vec2IdEEb + 140
5 QuartzCore 0x36f5a58b -[CALayer setPosition:] + 38
6 QuartzCore 0x36f5a4d7 -[CALayer setFrame:] + 390
7 UIKit 0x36a91455 -[UIView(Geometry) setFrame:] + 188
8 UIKit 0x36a920fb -[UILabel setFrame:] + 210
9 Artwork Evolution 0x0001d671 -[MBProgressHUD layoutSubviews] + 1120
10 UIKit 0x36a915fb -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 26
11 CoreFoundation 0x320cdf03 -[NSObject(NSObject) performSelector:withObject:] + 22
12 QuartzCore 0x36f5bbb5 -[CALayer layoutSublayers] + 120
13 QuartzCore 0x36f5b96d CALayerLayoutIfNeeded + 184
14 QuartzCore 0x36f611c5 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 212
15 QuartzCore 0x36f60fd7 _ZN2CA11Transaction6commitEv + 190
16 QuartzCore 0x36f5a055 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 56
17 CoreFoundation 0x32137a35 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 16
18 CoreFoundation 0x32139465 __CFRunLoopDoObservers + 412
19 CoreFoundation 0x3213a75b __CFRunLoopRun + 854
20 CoreFoundation 0x320caec3 CFRunLoopRunSpecific + 230
21 CoreFoundation 0x320cadcb CFRunLoopRunInMode + 58
22 GraphicsServices 0x33fe541f GSEventRunModal + 114
23 GraphicsServices 0x33fe54cb GSEventRun + 62
24 UIKit 0x36abad69 -[UIApplication _run] + 404
25 UIKit 0x36ab8807 UIApplicationMain + 670
26 Artwork Evolution 0x00002313 main + 74
27 Artwork Evolution 0x000022c4 start + 40
)
terminate called after throwing an instance of 'NSException'
Memory leak discovered on MBProgressHUD.m.
Call to function 'CGGradientCreateWithColorComponents' returns a Core Foundation object with a +1 retain count (owning reference)
Object allocated on line 587 and stored into 'gradient' is not referenced later in this execution path and has a retain count of +1 (object leaked)
There are 2 methods that are now deprecated due to iOS 7 UIKit changes.
CGSize labelSize = [label.text sizeWithFont:label.font];
and
CGSize detailsLabelSize = [detailsLabel.text sizeWithFont:detailsLabel.font
constrainedToSize:maxSize lineBreakMode:detailsLabel.lineBreakMode];
I can see in the code on github has a cornerRadius @Property, but when I install with pod 'MBProgressHUD'
I seem to get an older version which does not have this property.
I've used this control on my app, but i got a strange situation. When user tap the cell, the app access a web service and then, navigate to another view controller (push). When user tap on back button, sometimes, instead of go back to previous viewcontroller animated, the screen blinks and go back.
So, i removed the MBProgressHUD and this nos occurs again.
What i'm doing wrong?
Readme still shows labelText and hide: / show: instead of the updated methods.
Hi,
How can I show progress view without locking full screen ?
Here is an extension I use to flash a quick error message:
extension MBProgressHUD {
/// Briefly display an error message with a popover display
static func flashError(error: NSError) {
self.flashText(error.localizedDescription)
}
static func flashText(text: String) {
let window = UIApplication.sharedApplication().keyWindow!
MBProgressHUD.hideAllHUDsForView(window, animated: false)
let hud = MBProgressHUD(view: window)
hud.mode = .CustomView
hud.removeFromSuperViewOnHide = true
let view: UITextView = UITextView(frame: CGRectMake(0, 0, 200, 200))
view.text = text
view.font = hud.labelFont
view.textColor = UIColor.whiteColor()
view.backgroundColor = UIColor.clearColor()
view.sizeToFit()
hud.customView = view
hud.show(true)
hud.hide(true, afterDelay: 1.2)
}
}
Perhaps something like this can be added upstream
There is an issue with adding the MBProgressHUD to views (especially when doing it with scrollviews). When added to a UIScrollView in landscape mode, the HUD does not block input for the whole scroll view content size. By not doing so, other actions can be triggered and apps can be crashed. :)
To reproduce:
Here is what I get with NSZombieEnabled:
HudDemo[95461:5f07] *** -[MBProgressHUD setProgress:]: message sent to deallocated instance 0x5d17cd0
Hi,
weird issue here.
If I set labelText in a method specified as a protocol the label does not update.
Any idea?
I've made a little patch that allows different styles in determinate mode. The patch adds a new property and enumeration:
@Property (assign) MBDeterminateStyle determinateStyle;
The original/default style is MBDeterminateStyleRound, while the new style that I added is MBDeterminateStyleBar and uses a UIProgressBar behind the scenes.
The patch also updates the demo application so that you can see how this looks.
device rotation animation looks strange with dim background
When attaching the HUD to UIWindow, rotation doesn't work. This was fixed a while back but it looks like it's broken again.
I have a tab view controller app that switches between two tableviews. If I do this quickly I can get the HUD to crash as I have the HUD's showing up on both UITableviewcontrollers..
2010-08-02 22:44:43.116 Film Fest[962:8703] *** -[MBProgressHUD release]: message sent to deallocated instance 0x85490b0
any way so that the nav bar funtion can still be clickable
When creating a HUD from a UIWindow object, if the device is in a landscape orientation, the view properly rotates, but its dimensions are not properly adjusted. If you rotate the device once the HUD is displayed, it will fill the screen. But if you're in landscape and just create it without rotating, it won't.
To really see it, add this line to -showOnWindow:
in the demo project:
HUD.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.6];
Then launch the app, switch to landscape mode, and tap "On Window". You should see something like this:
Which I think you'll agree isn't quite right. I can even interact with the view below on either side. :-(
The Zoom animation mode allows click-throughs before the HUD is completely hidden.
This is due to the fact that a transform is applied in order to scale the HUD. This transform scales the the HUD's invisible background and thereby allows touches to be received by views that are not covered anymore.
The best solution would probably be to separate the actual HUD from the invisible background (a new view) and do animations just on the HUD. This should also produce a better autoresizing behavior.
There is no built in way to modify text colour. It's always forced to be white. Yet you can set the background colour. If you want a white/lightly coloured alert, you're out of luck.
Should be relatively easy fix to add in.
Be able to pass in either a RGB or a UIColor would be nifty.
Set dimBackground=Yes and rotate device: background will not get rotated (ProgressView does). Error also in the Demo-App.
I got around calling [self setTransformForCurrentOrientation:YES]; in the DeviceDidChageNotification for every case (remove if..) in MBProgressHUD.m and commented out the if/else part "if (UIInterfaceOrientationIsLandscape(orientation)) {..." in the setTransformForCurrentOrientation method.
But to be honest, I'm not really sure what I've done with this...
Could you please take a look?
Thanks for your work!
Regards
Gerd
appearance = [UIActivityIndicatorView appearanceWhenContainedIn:[MBProgressHUD class], nil];
// For iOS 9+
appearance = [UIActivityIndicatorView appearanceWhenContainedInInstancesOfClasses:@[[MBProgressHUD class]]];
this code get the iphoneos version gte 900000, is 90300 so is go for ios 9+ .
then app crash .
why min required version is 90000
Hi, i want to use your library in my project, but i need a way to allow a cancel button to stop an action (for example during a long loading). Then, i noticed that if I use the hud to show only a text as a Toast in Android, I can't touch any view behind the hud and i have to wait until it hides.
It will be nice to have the possibility of changing the color of the spinner
It would we nice if the label and the details label would support multiline text so that more text can fit in those.
I set the margin is invalid,Now the style of the not good before.
On line 243 in MBProgressHUD.m Apple's Static Analyzer wants this:
if (self = [super initWithFrame:frame])
to be
if ((self = [super initWithFrame:frame]))
It's kind of lame I know, but since I have warnings set to errors and run the static analyzer every time I build, I saw it right away.
Apple recently said:
We have discovered one or more issues with your recent delivery. To process your delivery, the following issues must be corrected:
Non-public API usage:
The app references non-public selectors: hide:, setLabelText:, show:
Anyone else run into this? Does it make any sense to rename these methods to avoid Apple's warning?
After the code rewrite the 4.2/4.3 compatibility is broken. I have git pulled the copy today, I get 70 errors:
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:65: error: inconsistent instance variable specification
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD initWithFrame:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:179: error: 'rotationTransform' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:179: error: (Each undeclared identifier is reported only once
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:179: error: for each function it appears in.)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD dealloc]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:208: error: 'label' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:209: error: 'detailsLabel' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD show:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:223: error: 'useAnimation' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD hide:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:237: error: 'useAnimation' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD handleGraceTimer:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:266: error: 'useAnimation' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD handleMinShowTimer:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:271: error: 'useAnimation' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD showUsingAnimation:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:279: error: 'rotationTransform' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD hideUsingAnimation:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:307: error: 'rotationTransform' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD done]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:324: error: 'isFinished' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD showWhileExecuting:onTarget:withObject:animated:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:337: error: 'methodForExecution' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:338: error: 'targetForExecution' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:339: error: 'objectForExecution' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD launchExecution]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:348: error: stray '@' in program
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:348: error: 'autoreleasepool' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:348: error: expected ';' before '{' token
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD cleanUp]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:364: error: 'targetForExecution' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:365: error: 'objectForExecution' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:367: error: 'useAnimation' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD setupLabels]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:373: error: 'label' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:383: error: 'detailsLabel' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD layoutSubviews]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:446: error: 'label' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:456: error: 'detailsLabel' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD updateUIForKeypath:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:587: error: 'label' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:591: error: 'detailsLabel' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD setTransformForCurrentOrientation:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:646: error: 'rotationTransform' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: At top level:
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:663: error: inconsistent instance variable specification
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView progress]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:668: error: '_progress' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:669: warning: control reaches end of non-void function
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView setProgress:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:672: error: '_progress' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView isAnnular]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:677: error: '_annular' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:678: warning: control reaches end of non-void function
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView setAnnular:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:681: error: '_annular' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView initWithFrame:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:696: error: '_progress' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:697: error: '_annular' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView drawRect:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:710: error: '_annular' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:65: error: inconsistent instance variable specification
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD initWithFrame:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:179: error: 'rotationTransform' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:179: error: (Each undeclared identifier is reported only once
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:179: error: for each function it appears in.)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD dealloc]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:208: error: 'label' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:209: error: 'detailsLabel' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD show:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:223: error: 'useAnimation' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD hide:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:237: error: 'useAnimation' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD handleGraceTimer:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:266: error: 'useAnimation' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD handleMinShowTimer:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:271: error: 'useAnimation' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD showUsingAnimation:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:279: error: 'rotationTransform' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD hideUsingAnimation:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:307: error: 'rotationTransform' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD done]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:324: error: 'isFinished' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD showWhileExecuting:onTarget:withObject:animated:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:337: error: 'methodForExecution' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:338: error: 'targetForExecution' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:339: error: 'objectForExecution' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD launchExecution]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:348: error: stray '@' in program
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:348: error: 'autoreleasepool' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:348: error: expected ';' before '{' token
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD cleanUp]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:364: error: 'targetForExecution' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:365: error: 'objectForExecution' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:367: error: 'useAnimation' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD setupLabels]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:373: error: 'label' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:383: error: 'detailsLabel' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD layoutSubviews]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:446: error: 'label' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:456: error: 'detailsLabel' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD updateUIForKeypath:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:587: error: 'label' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:591: error: 'detailsLabel' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBProgressHUD setTransformForCurrentOrientation:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:646: error: 'rotationTransform' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: At top level:
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:663: error: inconsistent instance variable specification
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView progress]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:668: error: '_progress' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:669: warning: control reaches end of non-void function
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView setProgress:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:672: error: '_progress' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView isAnnular]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:677: error: '_annular' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:678: warning: control reaches end of non-void function
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView setAnnular:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:681: error: '_annular' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView initWithFrame:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:696: error: '_progress' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:697: error: '_annular' undeclared (first use in this function)
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m: In function '-[MBRoundProgressView drawRect:]':
/Users/xalapan/Documents/apps/yair/Classes/MBProgressHUD.m:710: error: '_annular' undeclared (first use in this function)
I mostly use GCD for UI updates.
dispatch_async(dispatch_get_main_queue(), ^{
// UI updates
});
But, your library checks using [NSThread isMainThread]
. As GCD queues are not threads, my app often crashes. So I need to use selectors instead of calling blocks. Can we make this library GCD compatible?
Can't open or compile xib files with Xcode Version 4.6.3.
".../MBProgressHUD/Demo/en.lproj/MainWindow.xib: The document "MainWindow.xib" could not be opened. Could not read archive. Please use a newer version of Xcode. Consider changing the document's Development Target to preserve compatibility."
Hi,
How to set the position of hudview to the bottom, tried with yOffset but not working. (Swift)
hudView.yOffset = Float(self.view.center.y) + Float(100)
I was watching a WWDC 2012 keynote and searched the web and Applee's documentation. Confer: http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html
I'm not sure about it, to be honest. My proposal would be to change
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue
completionBlock:(MBProgressHUDCompletionBlock)completion {
self.taskInProgress = YES;
self.completionBlock = completion;
dispatch_async(queue, ^(void) {
block();
dispatch_async(dispatch_get_main_queue(), ^(void) {
[self cleanUp];
});
});
[self show:animated];
}
... into:
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue
completionBlock:(MBProgressHUDCompletionBlock)completion {
self.taskInProgress = YES;
self.completionBlock = completion;
MBProgressHUD *__weak weakSelf = self;
// MBProgressHUD *__unsafe_unretained weakSelf = self; // for iOS 4 target
dispatch_async(queue, ^(void) {
block();
dispatch_async(dispatch_get_main_queue(), ^(void) {
[weakSelf cleanUp];
});
});
[self show:animated];
}
What do you think?
UIView animation isn't thread safe.When I use it on iPhone 4.3 simulator,my program crashed.But on iPhone 6 simulator, it's ok. I added dispatch_async(dispatch_get_main_queue(), ^{}) in this method, then it's ok on iPhone 4.3 simulator. My english is poor.
I've always been confused which one of these to use.
I do have a task that sometimes takes a lot of time while other times being done very fast. When the task (being executed by MBProgressHUD's launchExecution method) is finished, the targetForExecution object gets released in 'cleanUp'. Sometimes however, this causes serious problems as only afterwards (when the animation is finished), 'done' and thus 'performSelector' on the delegate is called. At this time, the delegate is of course (see above) released already...
When adding a MBProgressHUD on top of views, inputs are not prevented.
I use UIButtons and I can still tap them while the HUD is displayed.
:(
Are the following lines in - (void)deviceOrientationDidChange:(NSNotification *)notification necessary?
// Stay in sync with the parent view (make sure we cover it fully)
CGRect theBounds = self.superview.bounds;
self.frame = self.superview.bounds;
[self setNeedsDisplay];
I ask because the hud view has autorizing options set when it is created, so will always resize when rotated.
In addition in my particular app (separate view for portrait/landscape and lots of frame setting) these lines break my views. Removing them has no ill effects.
Michael.
How can I do this with [NSThread detachNewThreadSelector:@selector(threadedDownload) toTarget:self withObject:nil];
Can we get the Demo project assets updated to include @3x images (for the iPhone 6 Plus)? Thanks!
Hi,
I had been using the MBProgressHUD, marked as version 0.5 in the herder, that I got directly off of github last year, however it seems to differ from the cocoa pods 0.5 version.
I'm moving our project over to use cocoa pods and realized that you could no longer set the fill color for the pie chart and wanted to make sure I wan't missing something.
By setting the progressTintColor this is the result we had previously:
Is this no longer supported?
Thanks
Instead of KVO, can we use property getter & setters? Wouldn't this be an exact equivalent?
Hi the following line in - (void)deviceOrientationDidChange:(NSNotification *)notification method (MBProgressHUD.m line 595) causes a crash
self.frame = self.superview.bounds;
Not sure of the knock on effect, but testing that we still have a superview fixes it for me.
if (self.superview) {
self.frame = self.superview.bounds;
}
It could be something in the way I am calling HUD or maybe I'm over releasing. For the moment the changes works for me.
Is there any way to rotate the HUD view on a device rotation. The problem I think is that the HUD view is attached to the window and the window method does not rotate view…viewControllers do.
Any ideas?
I have the following code in my app:
dispatch_async(dispatch_get_main_queue(), ^{ MBProgressHUD *hud = [MBProgressHUD HUDForView:self.view]; hud.label.text = @"Authenticating"; [hud showAnimated:YES]; });
Which results in the following:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MBProgressHUD label]: unrecognized selector sent to instance 0x7fa0d33f00b0'
I recently upgraded to v1.0 and previously my code was re-using a single hud and would show/hide and update the label text appropriately. After updating to v1.0 I can't for the life of me get this to work. I've even tried changing the way I was accessing the reusable hud from self.hud to what you see in the above code snippet.
It seems the only way I can get the label text to work is to use the deprecated labelText
approach.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.