Compare commits
115 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c6311feb43 | |||
| fbb5141587 | |||
| 3bc170a91d | |||
| 93c6958242 | |||
| 2fbcbae6a2 | |||
| 2a2f1598e8 | |||
| 690dd7614b | |||
| 9204c36a37 | |||
| 1fdda7fb51 | |||
| 5b2fb4a8e8 | |||
| f089d2a035 | |||
| 68b3c7480d | |||
| cada260e74 | |||
| 019cae8314 | |||
| 43b1ff26eb | |||
| 77828226b2 | |||
| b1564fd8d6 | |||
| f0c6d4dadb | |||
| 501abeaaf3 | |||
| e73ea408b3 | |||
| 1a541aedcd | |||
| 1f70b49ff6 | |||
| 81851db6a6 | |||
| ac7a7a8c5e | |||
| 61addd2405 | |||
| cca92d1156 | |||
| 5603383161 | |||
| fceb09cc8b | |||
| dc534dcb31 | |||
| ab71afed92 | |||
| a9f8fe88eb | |||
| 5612808fb1 | |||
| fe388ef956 | |||
| f6689c1c26 | |||
| 69c58ea278 | |||
| 6033a0b1ad | |||
| 3ac3f787eb | |||
| f75901d9b0 | |||
| fddc5dbcdf | |||
| 28c44be413 | |||
| c938b0f0f7 | |||
| 23023d7983 | |||
| f316d247ae | |||
| f4aaad3906 | |||
| 2f44900d0d | |||
| fc1903ff44 | |||
| 2216078a1a | |||
| cb56321f40 | |||
| d9886df3ad | |||
| 7e0bda2f85 | |||
| b8ef4c4e58 | |||
| 2716a01b99 | |||
| e368a8c243 | |||
| 59682eb65e | |||
| 7ed09decad | |||
| 4b403a7d2a | |||
| 0a15804a71 | |||
| 8eb3e881b9 | |||
| 4ad3584fee | |||
| 4f8b21759a | |||
| 83630b6198 | |||
| bd24a291d1 | |||
| 8e56d3e347 | |||
| 5fb0921dab | |||
| f0601bd900 | |||
| 194c82c86b | |||
| 516554f1f9 | |||
| 06fdc08431 | |||
| 9cfed6bc39 | |||
| 4194dcf10a | |||
| 2d3561081b | |||
| 8800353105 | |||
| 5918829642 | |||
| 69b4f27895 | |||
| c13d794975 | |||
| 913d8f37e5 | |||
| 130d31288e | |||
| 307ca57a4c | |||
| d775e8d985 | |||
| 7ffa6696c9 | |||
| 0fffff8031 | |||
| 322af011f6 | |||
| e879be1d22 | |||
| 65ecd91445 | |||
| da3d84ea0c | |||
| 1f1aa50bb4 | |||
| 7c90731626 | |||
| bb4a35b008 | |||
| c56e789aec | |||
| c8e51ec1ef | |||
| a5d34f1aac | |||
| 8e0aed0409 | |||
| 7c8ef3d5f1 | |||
| b157ecb0ac | |||
| fdd147f3c2 | |||
| fa5cc8e4ec | |||
| 2894a431bd | |||
| 61e8f0ad13 | |||
| ed4f0d0ec1 | |||
| 5c879487e2 | |||
| d4581b29f3 | |||
| 90c1ffc412 | |||
| fc51985417 | |||
| e7b749355c | |||
| fd37963b08 | |||
| c7b897895d | |||
| a50f7a36a4 | |||
| 355651dd21 | |||
| 6beae8260e | |||
| b68750e3a0 | |||
| febda3cb4b | |||
| 21020cdc4e | |||
| 5565c64f89 | |||
| 3e095ae0b9 | |||
| b0f1f66148 |
@@ -1 +0,0 @@
|
||||
*.pbxproj -crlf -diff -merge
|
||||
@@ -5,6 +5,7 @@ build/
|
||||
*.mode2v3
|
||||
*.perspectivev3
|
||||
xcuserdata/
|
||||
*.xccheckout
|
||||
|
||||
# old skool
|
||||
.svn
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
language: objective-c
|
||||
language: objective-c
|
||||
xcode_workspace: MBProgressHUD.xcworkspace
|
||||
xcode_scheme: HudDemo
|
||||
xcode_sdk: iphonesimulator
|
||||
|
||||
@@ -7,30 +7,8 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "MBProgressHUD.h"
|
||||
|
||||
@interface HudDemoViewController : UIViewController <MBProgressHUDDelegate> {
|
||||
MBProgressHUD *HUD;
|
||||
|
||||
long long expectedLength;
|
||||
long long currentLength;
|
||||
}
|
||||
|
||||
- (IBAction)showSimple:(id)sender;
|
||||
- (IBAction)showWithLabel:(id)sender;
|
||||
- (IBAction)showWithDetailsLabel:(id)sender;
|
||||
- (IBAction)showWithLabelDeterminate:(id)sender;
|
||||
- (IBAction)showWIthLabelAnnularDeterminate:(id)sender;
|
||||
- (IBAction)showWithLabelDeterminateHorizontalBar:(id)sender;
|
||||
- (IBAction)showWithCustomView:(id)sender;
|
||||
- (IBAction)showWithLabelMixed:(id)sender;
|
||||
- (IBAction)showUsingBlocks:(id)sender;
|
||||
- (IBAction)showOnWindow:(id)sender;
|
||||
- (IBAction)showURL:(id)sender;
|
||||
|
||||
- (void)myTask;
|
||||
- (void)myProgressTask;
|
||||
- (void)myMixedTask;
|
||||
@interface HudDemoViewController : UIViewController
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -7,18 +7,42 @@
|
||||
//
|
||||
|
||||
#import "HudDemoViewController.h"
|
||||
#import "MBProgressHUD.h"
|
||||
#import <unistd.h>
|
||||
|
||||
|
||||
#define SCREENSHOT_MODE 0
|
||||
|
||||
#ifndef kCFCoreFoundationVersionNumber_iOS_8_0
|
||||
#define kCFCoreFoundationVersionNumber_iOS_7_0 847.20
|
||||
#endif
|
||||
|
||||
|
||||
@interface HudDemoViewController () <MBProgressHUDDelegate> {
|
||||
MBProgressHUD *HUD;
|
||||
long long expectedLength;
|
||||
long long currentLength;
|
||||
}
|
||||
|
||||
@property (retain, nonatomic) IBOutletCollection(UIButton) NSArray *buttons;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation HudDemoViewController
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Constants
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Lifecycle methods
|
||||
#pragma mark - Lifecycle methods
|
||||
|
||||
- (void)viewDidLoad {
|
||||
UIView *content = [[self.view subviews] objectAtIndex:0];
|
||||
#if SCREENSHOT_MODE
|
||||
[content.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
|
||||
#endif
|
||||
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {
|
||||
[self.buttons setValue:@5.f forKeyPath:@"layer.cornerRadius"];
|
||||
} else {
|
||||
[self.buttons setValue:nil forKey:@"backgroundColor"];
|
||||
}
|
||||
((UIScrollView *)self.view).contentSize = content.bounds.size;
|
||||
}
|
||||
|
||||
@@ -32,11 +56,11 @@
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_buttons release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark IBActions
|
||||
#pragma mark - Actions
|
||||
|
||||
- (IBAction)showSimple:(id)sender {
|
||||
// The hud will dispable all input on the view (use the higest view possible in the view hierarchy)
|
||||
@@ -175,7 +199,7 @@
|
||||
}
|
||||
|
||||
- (IBAction)showURL:(id)sender {
|
||||
NSURL *URL = [NSURL URLWithString:@"https://github.com/matej/MBProgressHUD/zipball/master"];
|
||||
NSURL *URL = [NSURL URLWithString:@"http://a1408.g.akamai.net/5/1408/1388/2005110403/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_iPod.m4v.zip"];
|
||||
NSURLRequest *request = [NSURLRequest requestWithURL:URL];
|
||||
|
||||
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
|
||||
@@ -209,7 +233,6 @@
|
||||
hud.mode = MBProgressHUDModeText;
|
||||
hud.labelText = @"Some message...";
|
||||
hud.margin = 10.f;
|
||||
hud.yOffset = 150.f;
|
||||
hud.removeFromSuperViewOnHide = YES;
|
||||
|
||||
[hud hide:YES afterDelay:3];
|
||||
@@ -226,8 +249,7 @@
|
||||
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Execution code
|
||||
#pragma mark - Execution code
|
||||
|
||||
- (void)myTask {
|
||||
// Do something usefull in here instead of sleeping ...
|
||||
@@ -261,19 +283,22 @@
|
||||
HUD.mode = MBProgressHUDModeIndeterminate;
|
||||
HUD.labelText = @"Cleaning up";
|
||||
sleep(2);
|
||||
// The sample image is based on the work by www.pixelpressicons.com, http://creativecommons.org/licenses/by/2.5/ca/
|
||||
// Make the customViews 37 by 37 pixels for best results (those are the bounds of the build-in progress indicators)
|
||||
HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease];
|
||||
// UIImageView is a UIKit class, we have to initialize it on the main thread
|
||||
__block UIImageView *imageView;
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
UIImage *image = [UIImage imageNamed:@"37x-Checkmark.png"];
|
||||
imageView = [[UIImageView alloc] initWithImage:image];
|
||||
});
|
||||
HUD.customView = [imageView autorelease];
|
||||
HUD.mode = MBProgressHUDModeCustomView;
|
||||
HUD.labelText = @"Completed";
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark NSURLConnectionDelegete
|
||||
#pragma mark - NSURLConnectionDelegete
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
|
||||
expectedLength = [response expectedContentLength];
|
||||
expectedLength = MAX([response expectedContentLength], 1);
|
||||
currentLength = 0;
|
||||
HUD.mode = MBProgressHUDModeDeterminate;
|
||||
}
|
||||
@@ -293,8 +318,7 @@
|
||||
[HUD hide:YES];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark MBProgressHUDDelegate methods
|
||||
#pragma mark - MBProgressHUDDelegate
|
||||
|
||||
- (void)hudWasHidden:(MBProgressHUD *)hud {
|
||||
// Remove HUD from screen when the HUD was hidded
|
||||
@@ -303,4 +327,8 @@
|
||||
HUD = nil;
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
[self setButtons:nil];
|
||||
[super viewDidUnload];
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -14,6 +14,11 @@
|
||||
28D7ACF80DDB3853001CB0EB /* HudDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* HudDemoViewController.m */; };
|
||||
D21D40801611CF6C005FCE55 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D21D407F1611CF6C005FCE55 /* Default-568h@2x.png */; };
|
||||
D22F7D810F85241C00550BB3 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D22F7D800F85241C00550BB3 /* MBProgressHUD.m */; };
|
||||
D24A23051780ADCD0020310A /* Icon-Small.png in Resources */ = {isa = PBXBuildFile; fileRef = D22568E61780AA77008D5939 /* Icon-Small.png */; };
|
||||
D24A23061780ADD10020310A /* Icon-Small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D22568E71780AA77008D5939 /* Icon-Small@2x.png */; };
|
||||
D24A23071780ADDA0020310A /* Icon-iOS7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D22568E51780A9C6008D5939 /* Icon-iOS7@2x.png */; };
|
||||
D24A23081780ADE60020310A /* Default-iOS7-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D22568E31780A913008D5939 /* Default-iOS7-568h@2x.png */; };
|
||||
D24A23091780ADE90020310A /* Default-iOS7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D22568E41780A913008D5939 /* Default-iOS7@2x.png */; };
|
||||
D277FDB311FC834200304321 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = D277FDB211FC834200304321 /* Default.png */; };
|
||||
D277FDB911FC877E00304321 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = D277FDB711FC877E00304321 /* Icon.png */; };
|
||||
D277FDBA11FC877E00304321 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D277FDB811FC877E00304321 /* Icon@2x.png */; };
|
||||
@@ -21,10 +26,22 @@
|
||||
D286A7321518C53500E13FB8 /* HudDemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D286A7341518C53500E13FB8 /* HudDemoViewController.xib */; };
|
||||
D286A7361518C53C00E13FB8 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = D286A7381518C53C00E13FB8 /* MainWindow.xib */; };
|
||||
D286A76D1518CA9F00E13FB8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D286A76C1518CA9F00E13FB8 /* CoreGraphics.framework */; };
|
||||
D28CBB321A87A45A0052DCEC /* HudTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D28CBB311A87A45A0052DCEC /* HudTests.m */; };
|
||||
D28CBB381A87A4A10052DCEC /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D22F7D800F85241C00550BB3 /* MBProgressHUD.m */; };
|
||||
D2A6FD1D13ABC5A200BFE4C9 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D2A6FD1C13ABC5A200BFE4C9 /* Default@2x.png */; };
|
||||
D2F88CD6115E9F7F00E6DB82 /* 37x-Checkmark.png in Resources */ = {isa = PBXBuildFile; fileRef = D2F88CD5115E9F7F00E6DB82 /* 37x-Checkmark.png */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
D28CBB331A87A45A0052DCEC /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 1D6058900D05DD3D006BFB54;
|
||||
remoteInfo = HudDemo;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
1D3623240D0F684500981E51 /* HudDemoAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HudDemoAppDelegate.h; sourceTree = "<group>"; };
|
||||
@@ -37,8 +54,13 @@
|
||||
32CA4F630368D1EE00C91783 /* HudDemo_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HudDemo_Prefix.pch; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
D21D407F1611CF6C005FCE55 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Images/Default-568h@2x.png"; sourceTree = "<group>"; };
|
||||
D22568E31780A913008D5939 /* Default-iOS7-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-iOS7-568h@2x.png"; path = "Images/Default-iOS7-568h@2x.png"; sourceTree = "<group>"; };
|
||||
D22568E41780A913008D5939 /* Default-iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-iOS7@2x.png"; path = "Images/Default-iOS7@2x.png"; sourceTree = "<group>"; };
|
||||
D22568E51780A9C6008D5939 /* Icon-iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-iOS7@2x.png"; path = "Images/Icon-iOS7@2x.png"; sourceTree = "<group>"; };
|
||||
D22568E61780AA77008D5939 /* Icon-Small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-Small.png"; path = "Images/Icon-Small.png"; sourceTree = "<group>"; };
|
||||
D22568E71780AA77008D5939 /* Icon-Small@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-Small@2x.png"; path = "Images/Icon-Small@2x.png"; sourceTree = "<group>"; };
|
||||
D22F7D7F0F85241C00550BB3 /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MBProgressHUD.h; path = ../MBProgressHUD.h; sourceTree = SOURCE_ROOT; };
|
||||
D22F7D800F85241C00550BB3 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MBProgressHUD.m; path = ../../MBProgressHUD.m; sourceTree = "<group>"; };
|
||||
D22F7D800F85241C00550BB3 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MBProgressHUD.m; path = ../MBProgressHUD.m; sourceTree = "<group>"; };
|
||||
D277FDB211FC834200304321 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Images/Default.png; sourceTree = "<group>"; };
|
||||
D277FDB711FC877E00304321 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = Images/Icon.png; sourceTree = "<group>"; };
|
||||
D277FDB811FC877E00304321 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "Images/Icon@2x.png"; sourceTree = "<group>"; };
|
||||
@@ -46,6 +68,9 @@
|
||||
D286A7331518C53500E13FB8 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/HudDemoViewController.xib; sourceTree = "<group>"; };
|
||||
D286A7371518C53C00E13FB8 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = "<group>"; };
|
||||
D286A76C1518CA9F00E13FB8 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
D28CBB2D1A87A45A0052DCEC /* HudTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HudTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D28CBB301A87A45A0052DCEC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
D28CBB311A87A45A0052DCEC /* HudTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HudTests.m; sourceTree = "<group>"; };
|
||||
D2A6FD1C13ABC5A200BFE4C9 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "Images/Default@2x.png"; sourceTree = "<group>"; };
|
||||
D2F88CD5115E9F7F00E6DB82 /* 37x-Checkmark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "37x-Checkmark.png"; path = "Images/37x-Checkmark.png"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@@ -61,19 +86,27 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D28CBB2A1A87A45A0052DCEC /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
080E96DDFE201D6D7F000001 /* Classes */ = {
|
||||
080E96DDFE201D6D7F000001 /* HudDemo */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D22F7D7F0F85241C00550BB3 /* MBProgressHUD.h */,
|
||||
D22F7D800F85241C00550BB3 /* MBProgressHUD.m */,
|
||||
1D3623240D0F684500981E51 /* HudDemoAppDelegate.h */,
|
||||
1D3623250D0F684500981E51 /* HudDemoAppDelegate.m */,
|
||||
28D7ACF60DDB3853001CB0EB /* HudDemoViewController.h */,
|
||||
28D7ACF70DDB3853001CB0EB /* HudDemoViewController.m */,
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
);
|
||||
name = HudDemo;
|
||||
path = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -81,6 +114,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D6058910D05DD3D006BFB54 /* HudDemo.app */,
|
||||
D28CBB2D1A87A45A0052DCEC /* HudTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -88,9 +122,9 @@
|
||||
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
080E96DDFE201D6D7F000001 /* Classes */,
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
080E96DDFE201D6D7F000001 /* HudDemo */,
|
||||
D28CBB2E1A87A45A0052DCEC /* HudTests */,
|
||||
D28CBB391A87A6B00052DCEC /* MBProgressHUD */,
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */,
|
||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||
);
|
||||
@@ -104,6 +138,7 @@
|
||||
29B97316FDCFA39411CA2CEA /* main.m */,
|
||||
);
|
||||
name = "Other Sources";
|
||||
path = ..;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
@@ -114,6 +149,7 @@
|
||||
8D1107310486CEB800E47090 /* Info.plist */,
|
||||
);
|
||||
name = Resources;
|
||||
path = ..;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
@@ -131,9 +167,14 @@
|
||||
children = (
|
||||
D277FDB711FC877E00304321 /* Icon.png */,
|
||||
D277FDB811FC877E00304321 /* Icon@2x.png */,
|
||||
D22568E61780AA77008D5939 /* Icon-Small.png */,
|
||||
D22568E71780AA77008D5939 /* Icon-Small@2x.png */,
|
||||
D22568E51780A9C6008D5939 /* Icon-iOS7@2x.png */,
|
||||
D277FDB211FC834200304321 /* Default.png */,
|
||||
D2A6FD1C13ABC5A200BFE4C9 /* Default@2x.png */,
|
||||
D21D407F1611CF6C005FCE55 /* Default-568h@2x.png */,
|
||||
D22568E31780A913008D5939 /* Default-iOS7-568h@2x.png */,
|
||||
D22568E41780A913008D5939 /* Default-iOS7@2x.png */,
|
||||
D2F88CD5115E9F7F00E6DB82 /* 37x-Checkmark.png */,
|
||||
D286A67F1518736B00E13FB8 /* 37x-Checkmark@2x.png */,
|
||||
);
|
||||
@@ -149,6 +190,32 @@
|
||||
name = UI;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D28CBB2E1A87A45A0052DCEC /* HudTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D28CBB311A87A45A0052DCEC /* HudTests.m */,
|
||||
D28CBB2F1A87A45A0052DCEC /* Supporting Files */,
|
||||
);
|
||||
path = HudTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D28CBB2F1A87A45A0052DCEC /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D28CBB301A87A45A0052DCEC /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D28CBB391A87A6B00052DCEC /* MBProgressHUD */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D22F7D7F0F85241C00550BB3 /* MBProgressHUD.h */,
|
||||
D22F7D800F85241C00550BB3 /* MBProgressHUD.m */,
|
||||
);
|
||||
name = MBProgressHUD;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -169,6 +236,24 @@
|
||||
productReference = 1D6058910D05DD3D006BFB54 /* HudDemo.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
D28CBB2C1A87A45A0052DCEC /* HudTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = D28CBB351A87A45A0052DCEC /* Build configuration list for PBXNativeTarget "HudTests" */;
|
||||
buildPhases = (
|
||||
D28CBB291A87A45A0052DCEC /* Sources */,
|
||||
D28CBB2A1A87A45A0052DCEC /* Frameworks */,
|
||||
D28CBB2B1A87A45A0052DCEC /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
D28CBB341A87A45A0052DCEC /* PBXTargetDependency */,
|
||||
);
|
||||
name = HudTests;
|
||||
productName = HudTests;
|
||||
productReference = D28CBB2D1A87A45A0052DCEC /* HudTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
@@ -176,8 +261,14 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
CLASSPREFIX = MB;
|
||||
LastUpgradeCheck = 0460;
|
||||
LastUpgradeCheck = 0720;
|
||||
ORGANIZATIONNAME = "Matej Bukovinski";
|
||||
TargetAttributes = {
|
||||
D28CBB2C1A87A45A0052DCEC = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
TestTargetID = 1D6058900D05DD3D006BFB54;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HudDemo" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -194,6 +285,7 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
1D6058900D05DD3D006BFB54 /* HudDemo */,
|
||||
D28CBB2C1A87A45A0052DCEC /* HudTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@@ -211,7 +303,19 @@
|
||||
D277FDBA11FC877E00304321 /* Icon@2x.png in Resources */,
|
||||
D2A6FD1D13ABC5A200BFE4C9 /* Default@2x.png in Resources */,
|
||||
D286A6801518736B00E13FB8 /* 37x-Checkmark@2x.png in Resources */,
|
||||
D24A23081780ADE60020310A /* Default-iOS7-568h@2x.png in Resources */,
|
||||
D24A23051780ADCD0020310A /* Icon-Small.png in Resources */,
|
||||
D24A23071780ADDA0020310A /* Icon-iOS7@2x.png in Resources */,
|
||||
D21D40801611CF6C005FCE55 /* Default-568h@2x.png in Resources */,
|
||||
D24A23061780ADD10020310A /* Icon-Small@2x.png in Resources */,
|
||||
D24A23091780ADE90020310A /* Default-iOS7@2x.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D28CBB2B1A87A45A0052DCEC /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -229,8 +333,25 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D28CBB291A87A45A0052DCEC /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D28CBB321A87A45A0052DCEC /* HudTests.m in Sources */,
|
||||
D28CBB381A87A4A10052DCEC /* MBProgressHUD.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
D28CBB341A87A45A0052DCEC /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 1D6058900D05DD3D006BFB54 /* HudDemo */;
|
||||
targetProxy = D28CBB331A87A45A0052DCEC /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
D286A7341518C53500E13FB8 /* HudDemoViewController.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
@@ -261,7 +382,9 @@
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = HudDemo_Prefix.pch;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.bukovinski.${PRODUCT_NAME:identifier}";
|
||||
PRODUCT_NAME = HudDemo;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -273,26 +396,36 @@
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = HudDemo_Prefix.pch;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.bukovinski.${PRODUCT_NAME:identifier}";
|
||||
PRODUCT_NAME = HudDemo;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C01FCF4F08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
@@ -301,21 +434,96 @@
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
D28CBB361A87A45A0052DCEC /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(SDKROOT)/Developer/Library/Frameworks",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = HudTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.bukovinski.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HudDemo.app/HudDemo";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
D28CBB371A87A45A0052DCEC /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(SDKROOT)/Developer/Library/Frameworks",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = HudTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.bukovinski.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HudDemo.app/HudDemo";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
@@ -337,6 +545,15 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
D28CBB351A87A45A0052DCEC /* Build configuration list for PBXNativeTarget "HudTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
D28CBB361A87A45A0052DCEC /* Debug */,
|
||||
D28CBB371A87A45A0052DCEC /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0460"
|
||||
LastUpgradeVersion = "0720"
|
||||
version = "1.8">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -20,28 +20,65 @@
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "NO"
|
||||
buildForArchiving = "NO"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D28CBB2C1A87A45A0052DCEC"
|
||||
BuildableName = "HudTests.xctest"
|
||||
BlueprintName = "HudTests"
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D28CBB2C1A87A45A0052DCEC"
|
||||
BuildableName = "HudTests.xctest"
|
||||
BlueprintName = "HudTests"
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
|
||||
BuildableName = "HudDemo.app"
|
||||
BlueprintName = "HudDemo"
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
displayScaleIsEnabled = "NO"
|
||||
displayScale = "1.00"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
|
||||
@@ -56,12 +93,13 @@
|
||||
<ProfileAction
|
||||
displayScaleIsEnabled = "NO"
|
||||
displayScale = "1.00"
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// HudTests.m
|
||||
// HudTests
|
||||
//
|
||||
// Created by Matej Bukovinski on 8. 02. 15.
|
||||
// Copyright (c) 2015 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "MBProgressHUD.h"
|
||||
|
||||
|
||||
@interface HudTests : XCTestCase
|
||||
|
||||
@property (nonatomic, strong) MBProgressHUD *hud;
|
||||
@property (nonatomic, strong) UIView *view;
|
||||
|
||||
@end
|
||||
|
||||
@implementation HudTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
|
||||
self.view = [[UIView alloc] init];
|
||||
self.view.bounds = [[UIScreen mainScreen] bounds];
|
||||
self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
self.hud = nil;
|
||||
self.view = nil;
|
||||
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testThatHUDExists {
|
||||
XCTAssertNotNil(self.hud, @"Should be able to create a new HUD instance");
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
@@ -12,11 +12,13 @@
|
||||
<string></string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon-Small</string>
|
||||
<string>Icon-iOS7</string>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
</array>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.bukovinski.${PRODUCT_NAME:identifier}</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -33,6 +35,31 @@
|
||||
<true/>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainWindow</string>
|
||||
<key>UILaunchImages</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UILaunchImageMinimumOSVersion</key>
|
||||
<string>7.0</string>
|
||||
<key>UILaunchImageName</key>
|
||||
<string>Default-iOS7</string>
|
||||
<key>UILaunchImageOrientation</key>
|
||||
<string>Portrait</string>
|
||||
<key>UILaunchImageSize</key>
|
||||
<string>{320, 568}</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UILaunchImageMinimumOSVersion</key>
|
||||
<string>7.0</string>
|
||||
<key>UILaunchImageName</key>
|
||||
<string>Default-iOS7</string>
|
||||
<key>UILaunchImageOrientation</key>
|
||||
<string>Portrait</string>
|
||||
<key>UILaunchImageSize</key>
|
||||
<string>{320, 480}</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>MainWindow</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
|
||||
@@ -1,417 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">528</int>
|
||||
<string key="IBDocument.SystemVersion">12C54</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2840</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.34</string>
|
||||
<string key="IBDocument.HIToolboxVersion">625.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">1926</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUICustomObject</string>
|
||||
<string>IBUINavigationBar</string>
|
||||
<string>IBUINavigationController</string>
|
||||
<string>IBUINavigationItem</string>
|
||||
<string>IBUIViewController</string>
|
||||
<string>IBUIWindow</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="841351856">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="427554174">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUICustomObject" id="664661524">
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIWindow" id="117978783">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrameSize">{320, 480}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC44ODYyNzQ1MDk4IDAuOTA1ODgyMzUyOSAwLjkyOTQxMTc2NDcAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIResizesToFullScreen">YES</bool>
|
||||
</object>
|
||||
<object class="IBUINavigationController" id="386664917">
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
|
||||
<int key="IBUIInterfaceOrientation">1</int>
|
||||
<int key="interfaceOrientation">1</int>
|
||||
</object>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIHorizontal">NO</bool>
|
||||
<object class="IBUINavigationBar" key="IBUINavigationBar" id="500961041">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{0, 0}</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<bool key="IBUIMultipleTouchEnabled">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBUIViewControllers">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUIViewController" id="934427715">
|
||||
<string key="IBUITitle">MBProgressHUD</string>
|
||||
<object class="IBUINavigationItem" key="IBUINavigationItem" id="390734610">
|
||||
<string key="IBUITitle">MBProgressHUD</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<reference key="IBUIParentViewController" ref="386664917"/>
|
||||
<string key="IBUINibName">HudDemoViewController</string>
|
||||
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
|
||||
<int key="IBUIInterfaceOrientation">1</int>
|
||||
<int key="interfaceOrientation">1</int>
|
||||
</object>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIHorizontal">NO</bool>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="664661524"/>
|
||||
</object>
|
||||
<int key="connectionID">4</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">window</string>
|
||||
<reference key="source" ref="664661524"/>
|
||||
<reference key="destination" ref="117978783"/>
|
||||
</object>
|
||||
<int key="connectionID">14</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">navController</string>
|
||||
<reference key="source" ref="664661524"/>
|
||||
<reference key="destination" ref="386664917"/>
|
||||
</object>
|
||||
<int key="connectionID">19</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<object class="NSArray" key="object" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="841351856"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">3</int>
|
||||
<reference key="object" ref="664661524"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">HudDemo App Delegate</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="427554174"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">12</int>
|
||||
<reference key="object" ref="117978783"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">15</int>
|
||||
<reference key="object" ref="386664917"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="934427715"/>
|
||||
<reference ref="500961041"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">16</int>
|
||||
<reference key="object" ref="934427715"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="390734610"/>
|
||||
</object>
|
||||
<reference key="parent" ref="386664917"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">17</int>
|
||||
<reference key="object" ref="500961041"/>
|
||||
<reference key="parent" ref="386664917"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">18</int>
|
||||
<reference key="object" ref="390734610"/>
|
||||
<reference key="parent" ref="934427715"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-1.IBPluginDependency</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>12.IBPluginDependency</string>
|
||||
<string>15.IBPluginDependency</string>
|
||||
<string>16.CustomClassName</string>
|
||||
<string>16.IBPluginDependency</string>
|
||||
<string>17.IBPluginDependency</string>
|
||||
<string>18.IBPluginDependency</string>
|
||||
<string>3.CustomClassName</string>
|
||||
<string>3.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>UIApplication</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>UIResponder</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>HudDemoViewController</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>HudDemoAppDelegate</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">19</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">HudDemoAppDelegate</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>navController</string>
|
||||
<string>window</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>UINavigationController</string>
|
||||
<string>UIWindow</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>navController</string>
|
||||
<string>window</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">navController</string>
|
||||
<string key="candidateClassName">UINavigationController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">window</string>
|
||||
<string key="candidateClassName">UIWindow</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/HudDemoAppDelegate.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">HudDemoViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>showOnWindow:</string>
|
||||
<string>showSimple:</string>
|
||||
<string>showTextOnly:</string>
|
||||
<string>showURL:</string>
|
||||
<string>showUsingBlocks:</string>
|
||||
<string>showWIthLabelAnnularDeterminate:</string>
|
||||
<string>showWithColor:</string>
|
||||
<string>showWithCustomView:</string>
|
||||
<string>showWithDetailsLabel:</string>
|
||||
<string>showWithGradient:</string>
|
||||
<string>showWithLabel:</string>
|
||||
<string>showWithLabelDeterminate:</string>
|
||||
<string>showWithLabelMixed:</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>showOnWindow:</string>
|
||||
<string>showSimple:</string>
|
||||
<string>showTextOnly:</string>
|
||||
<string>showURL:</string>
|
||||
<string>showUsingBlocks:</string>
|
||||
<string>showWIthLabelAnnularDeterminate:</string>
|
||||
<string>showWithColor:</string>
|
||||
<string>showWithCustomView:</string>
|
||||
<string>showWithDetailsLabel:</string>
|
||||
<string>showWithGradient:</string>
|
||||
<string>showWithLabel:</string>
|
||||
<string>showWithLabelDeterminate:</string>
|
||||
<string>showWithLabelMixed:</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showOnWindow:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showSimple:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showTextOnly:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showURL:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showUsingBlocks:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showWIthLabelAnnularDeterminate:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showWithColor:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showWithCustomView:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showWithDetailsLabel:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showWithGradient:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showWithLabel:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showWithLabelDeterminate:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showWithLabelMixed:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/HudDemoViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<integer value="528" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<real value="1536" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">1926</string>
|
||||
</data>
|
||||
</archive>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4457.9" systemVersion="12E55" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="528" identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3682.9"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="3" id="4"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<customObject id="3" userLabel="HudDemo App Delegate" customClass="HudDemoAppDelegate">
|
||||
<connections>
|
||||
<outlet property="navController" destination="15" id="19"/>
|
||||
<outlet property="window" destination="12" id="14"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<window opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="12">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.8862745098" green="0.90588235289999997" blue="0.92941176469999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
|
||||
</window>
|
||||
<navigationController id="15">
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
|
||||
<nil key="simulatedTopBarMetrics"/>
|
||||
<nil key="simulatedBottomBarMetrics"/>
|
||||
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
|
||||
<nil key="simulatedDestinationMetrics"/>
|
||||
<navigationBar key="navigationBar" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="17">
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<viewControllers>
|
||||
<viewController title="MBProgressHUD" nibName="HudDemoViewController" id="16" customClass="HudDemoViewController">
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<navigationItem key="navigationItem" title="MBProgressHUD" id="18"/>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<nil key="simulatedTopBarMetrics"/>
|
||||
<nil key="simulatedBottomBarMetrics"/>
|
||||
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
|
||||
<nil key="simulatedDestinationMetrics"/>
|
||||
</viewController>
|
||||
</viewControllers>
|
||||
</navigationController>
|
||||
</objects>
|
||||
<classes>
|
||||
<class className="HudDemoAppDelegate" superclassName="NSObject">
|
||||
<source key="sourceIdentifier" type="project" relativePath="./Classes/HudDemoAppDelegate.h"/>
|
||||
<relationships>
|
||||
<relationship kind="outlet" name="navController" candidateClass="UINavigationController"/>
|
||||
<relationship kind="outlet" name="window" candidateClass="UIWindow"/>
|
||||
</relationships>
|
||||
</class>
|
||||
<class className="HudDemoViewController" superclassName="UIViewController">
|
||||
<source key="sourceIdentifier" type="project" relativePath="./Classes/HudDemoViewController.h"/>
|
||||
<relationships>
|
||||
<relationship kind="action" name="showOnWindow:"/>
|
||||
<relationship kind="action" name="showSimple:"/>
|
||||
<relationship kind="action" name="showTextOnly:"/>
|
||||
<relationship kind="action" name="showURL:"/>
|
||||
<relationship kind="action" name="showUsingBlocks:"/>
|
||||
<relationship kind="action" name="showWIthLabelAnnularDeterminate:"/>
|
||||
<relationship kind="action" name="showWithColor:"/>
|
||||
<relationship kind="action" name="showWithCustomView:"/>
|
||||
<relationship kind="action" name="showWithDetailsLabel:"/>
|
||||
<relationship kind="action" name="showWithGradient:"/>
|
||||
<relationship kind="action" name="showWithLabel:"/>
|
||||
<relationship kind="action" name="showWithLabelDeterminate:"/>
|
||||
<relationship kind="action" name="showWithLabelDeterminateHorizontalBar:"/>
|
||||
<relationship kind="action" name="showWithLabelMixed:"/>
|
||||
</relationships>
|
||||
</class>
|
||||
</classes>
|
||||
</document>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.matej.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2013 Matej Bukovinski
|
||||
Copyright (c) 2009-2015 Matej Bukovinski
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'MBProgressHUD' target in the 'MBProgressHUD' project
|
||||
//
|
||||
|
||||
#import <Availability.h>
|
||||
|
||||
#ifndef __IPHONE_3_0
|
||||
#warning "This project uses features only available in iOS SDK 3.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreGraphics/CoreGraphics.h>
|
||||
#endif
|
||||
@@ -1,12 +1,12 @@
|
||||
//
|
||||
// MBProgressHUD.h
|
||||
// Version 0.7
|
||||
// Version 0.9.2
|
||||
// Created by Matej Bukovinski on 2.4.09.
|
||||
//
|
||||
|
||||
// This code is distributed under the terms and conditions of the MIT license.
|
||||
|
||||
// Copyright (c) 2013 Matej Bukovinski
|
||||
// Copyright (c) 2009-2015 Matej Bukovinski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -33,7 +33,7 @@
|
||||
@protocol MBProgressHUDDelegate;
|
||||
|
||||
|
||||
typedef enum {
|
||||
typedef NS_ENUM(NSInteger, MBProgressHUDMode) {
|
||||
/** Progress is shown using an UIActivityIndicatorView. This is the default. */
|
||||
MBProgressHUDModeIndeterminate,
|
||||
/** Progress is shown using a round, pie-chart like, progress view. */
|
||||
@@ -46,16 +46,16 @@ typedef enum {
|
||||
MBProgressHUDModeCustomView,
|
||||
/** Shows only labels */
|
||||
MBProgressHUDModeText
|
||||
} MBProgressHUDMode;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
typedef NS_ENUM(NSInteger, MBProgressHUDAnimation) {
|
||||
/** Opacity animation */
|
||||
MBProgressHUDAnimationFade,
|
||||
/** Opacity + scale animation */
|
||||
MBProgressHUDAnimationZoom,
|
||||
MBProgressHUDAnimationZoomOut = MBProgressHUDAnimationZoom,
|
||||
MBProgressHUDAnimationZoomIn
|
||||
} MBProgressHUDAnimation;
|
||||
};
|
||||
|
||||
|
||||
#ifndef MB_INSTANCETYPE
|
||||
@@ -98,21 +98,23 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
* drawn centered as a rounded semi-transparent view which resizes depending on the user specified content.
|
||||
*
|
||||
* This view supports four modes of operation:
|
||||
* - MBProgressHUDModeIndeterminate - shows a UIActivityIndicatorView
|
||||
* - MBProgressHUDModeDeterminate - shows a custom round progress indicator
|
||||
* - MBProgressHUDModeAnnularDeterminate - shows a custom annular progress indicator
|
||||
* - MBProgressHUDModeCustomView - shows an arbitrary, user specified view (@see customView)
|
||||
* - MBProgressHUDModeIndeterminate - shows a UIActivityIndicatorView
|
||||
* - MBProgressHUDModeDeterminate - shows a custom round progress indicator
|
||||
* - MBProgressHUDModeAnnularDeterminate - shows a custom annular progress indicator
|
||||
* - MBProgressHUDModeCustomView - shows an arbitrary, user specified view (see `customView`)
|
||||
*
|
||||
* All three modes can have optional labels assigned:
|
||||
* - If the labelText property is set and non-empty then a label containing the provided content is placed below the
|
||||
* indicator view.
|
||||
* - If also the detailsLabelText property is set then another label is placed below the first label.
|
||||
* - If the labelText property is set and non-empty then a label containing the provided content is placed below the
|
||||
* indicator view.
|
||||
* - If also the detailsLabelText property is set then another label is placed below the first label.
|
||||
*/
|
||||
@interface MBProgressHUD : UIView
|
||||
|
||||
/**
|
||||
* Creates a new HUD, adds it to provided view and shows it. The counterpart to this method is hideHUDForView:animated:.
|
||||
*
|
||||
*
|
||||
* @note This method sets `removeFromSuperViewOnHide`. The HUD will automatically be removed from the view hierarchy when hidden.
|
||||
*
|
||||
* @param view The view that the HUD will be added to
|
||||
* @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use
|
||||
* animations while appearing.
|
||||
@@ -126,10 +128,12 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
/**
|
||||
* Finds the top-most HUD subview and hides it. The counterpart to this method is showHUDAddedTo:animated:.
|
||||
*
|
||||
* @note This method sets `removeFromSuperViewOnHide`. The HUD will automatically be removed from the view hierarchy when hidden.
|
||||
*
|
||||
* @param view The view that is going to be searched for a HUD subview.
|
||||
* @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
|
||||
* animations while disappearing.
|
||||
* @return YES if a HUD was found and removed, NO otherwise.
|
||||
* @return YES if a HUD was found and removed, NO otherwise.
|
||||
*
|
||||
* @see showHUDAddedTo:animated:
|
||||
* @see animationType
|
||||
@@ -139,6 +143,8 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
/**
|
||||
* Finds all the HUD subviews and hides them.
|
||||
*
|
||||
* @note This method sets `removeFromSuperViewOnHide`. The HUDs will automatically be removed from the view hierarchy when hidden.
|
||||
*
|
||||
* @param view The view that is going to be searched for HUD subviews.
|
||||
* @param animated If set to YES the HUDs will disappear using the current animationType. If set to NO the HUDs will not use
|
||||
* animations while disappearing.
|
||||
@@ -344,6 +350,12 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
*/
|
||||
@property (assign) float margin;
|
||||
|
||||
/**
|
||||
* The corner radius for the HUD
|
||||
* Defaults to 10.0
|
||||
*/
|
||||
@property (assign) float cornerRadius;
|
||||
|
||||
/**
|
||||
* Cover the HUD background view with a radial gradient.
|
||||
*/
|
||||
@@ -388,11 +400,27 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
*/
|
||||
@property (MB_STRONG) UIFont* labelFont;
|
||||
|
||||
/**
|
||||
* Font to be used for the details label. Set this property if the default is not adequate.
|
||||
/**
|
||||
* Color to be used for the main label. Set this property if the default is not adequate.
|
||||
*/
|
||||
@property (MB_STRONG) UIColor* labelColor;
|
||||
|
||||
/**
|
||||
* Font to be used for the details label. Set this property if the default is not adequate.
|
||||
*/
|
||||
@property (MB_STRONG) UIFont* detailsLabelFont;
|
||||
|
||||
/**
|
||||
* Color to be used for the details label. Set this property if the default is not adequate.
|
||||
*/
|
||||
@property (MB_STRONG) UIColor* detailsLabelColor;
|
||||
|
||||
/**
|
||||
* The color of the activity indicator. Defaults to [UIColor whiteColor]
|
||||
* Does nothing on pre iOS 5.
|
||||
*/
|
||||
@property (MB_STRONG) UIColor *activityIndicatorColor;
|
||||
|
||||
/**
|
||||
* The progress of the progress indicator, from 0.0 to 1.0. Defaults to 0.0.
|
||||
*/
|
||||
@@ -403,6 +431,15 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
*/
|
||||
@property (assign) CGSize minSize;
|
||||
|
||||
|
||||
/**
|
||||
* The actual size of the HUD bezel.
|
||||
* You can use this to limit touch handling on the bezel area only.
|
||||
* @see https://github.com/jdg/MBProgressHUD/pull/200
|
||||
*/
|
||||
@property (atomic, assign, readonly) CGSize size;
|
||||
|
||||
|
||||
/**
|
||||
* Force the HUD dimensions to be equal if possible.
|
||||
*/
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
//
|
||||
// MBProgressHUD.m
|
||||
// Version 0.7
|
||||
// Version 0.9.2
|
||||
// Created by Matej Bukovinski on 2.4.09.
|
||||
//
|
||||
|
||||
#import "MBProgressHUD.h"
|
||||
#import <tgmath.h>
|
||||
|
||||
|
||||
#if __has_feature(objc_arc)
|
||||
@@ -23,43 +24,37 @@
|
||||
#define MBLabelAlignmentCenter UITextAlignmentCenter
|
||||
#endif
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
|
||||
#define MB_TEXTSIZE(text, font) [text length] > 0 ? [text \
|
||||
sizeWithAttributes:@{NSFontAttributeName:font}] : CGSizeZero;
|
||||
#else
|
||||
#define MB_TEXTSIZE(text, font) [text length] > 0 ? [text sizeWithFont:font] : CGSizeZero;
|
||||
#endif
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
|
||||
#define MB_MULTILINE_TEXTSIZE(text, font, maxSize, mode) [text length] > 0 ? [text \
|
||||
boundingRectWithSize:maxSize options:(NSStringDrawingUsesLineFragmentOrigin) \
|
||||
attributes:@{NSFontAttributeName:font} context:nil].size : CGSizeZero;
|
||||
#else
|
||||
#define MB_MULTILINE_TEXTSIZE(text, font, maxSize, mode) [text length] > 0 ? [text \
|
||||
sizeWithFont:font constrainedToSize:maxSize lineBreakMode:mode] : CGSizeZero;
|
||||
#endif
|
||||
|
||||
#ifndef kCFCoreFoundationVersionNumber_iOS_7_0
|
||||
#define kCFCoreFoundationVersionNumber_iOS_7_0 847.20
|
||||
#endif
|
||||
|
||||
#ifndef kCFCoreFoundationVersionNumber_iOS_8_0
|
||||
#define kCFCoreFoundationVersionNumber_iOS_8_0 1129.15
|
||||
#endif
|
||||
|
||||
|
||||
static const CGFloat kPadding = 4.f;
|
||||
static const CGFloat kLabelFontSize = 16.f;
|
||||
static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
|
||||
|
||||
@interface MBProgressHUD ()
|
||||
|
||||
- (void)setupLabels;
|
||||
- (void)registerForKVO;
|
||||
- (void)unregisterFromKVO;
|
||||
- (NSArray *)observableKeypaths;
|
||||
- (void)registerForNotifications;
|
||||
- (void)unregisterFromNotifications;
|
||||
- (void)updateUIForKeypath:(NSString *)keyPath;
|
||||
- (void)hideUsingAnimation:(BOOL)animated;
|
||||
- (void)showUsingAnimation:(BOOL)animated;
|
||||
- (void)done;
|
||||
- (void)updateIndicators;
|
||||
- (void)handleGraceTimer:(NSTimer *)theTimer;
|
||||
- (void)handleMinShowTimer:(NSTimer *)theTimer;
|
||||
- (void)setTransformForCurrentOrientation:(BOOL)animated;
|
||||
- (void)cleanUp;
|
||||
- (void)launchExecution;
|
||||
- (void)deviceOrientationDidChange:(NSNotification *)notification;
|
||||
- (void)hideDelayed:(NSNumber *)animated;
|
||||
|
||||
@property (atomic, MB_STRONG) UIView *indicator;
|
||||
@property (atomic, MB_STRONG) NSTimer *graceTimer;
|
||||
@property (atomic, MB_STRONG) NSTimer *minShowTimer;
|
||||
@property (atomic, MB_STRONG) NSDate *showStarted;
|
||||
@property (atomic, assign) CGSize size;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation MBProgressHUD {
|
||||
@interface MBProgressHUD () {
|
||||
BOOL useAnimation;
|
||||
SEL methodForExecution;
|
||||
id targetForExecution;
|
||||
@@ -70,6 +65,16 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
CGAffineTransform rotationTransform;
|
||||
}
|
||||
|
||||
@property (atomic, MB_STRONG) UIView *indicator;
|
||||
@property (atomic, MB_STRONG) NSTimer *graceTimer;
|
||||
@property (atomic, MB_STRONG) NSTimer *minShowTimer;
|
||||
@property (atomic, MB_STRONG) NSDate *showStarted;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation MBProgressHUD
|
||||
|
||||
#pragma mark - Properties
|
||||
|
||||
@synthesize animationType;
|
||||
@@ -77,7 +82,9 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
@synthesize opacity;
|
||||
@synthesize color;
|
||||
@synthesize labelFont;
|
||||
@synthesize labelColor;
|
||||
@synthesize detailsLabelFont;
|
||||
@synthesize detailsLabelColor;
|
||||
@synthesize indicator;
|
||||
@synthesize xOffset;
|
||||
@synthesize yOffset;
|
||||
@@ -98,6 +105,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
@synthesize detailsLabelText;
|
||||
@synthesize progress;
|
||||
@synthesize size;
|
||||
@synthesize activityIndicatorColor;
|
||||
#if NS_BLOCKS_AVAILABLE
|
||||
@synthesize completionBlock;
|
||||
#endif
|
||||
@@ -106,6 +114,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
|
||||
+ (MB_INSTANCETYPE)showHUDAddedTo:(UIView *)view animated:(BOOL)animated {
|
||||
MBProgressHUD *hud = [[self alloc] initWithView:view];
|
||||
hud.removeFromSuperViewOnHide = YES;
|
||||
[view addSubview:hud];
|
||||
[hud show:animated];
|
||||
return MB_AUTORELEASE(hud);
|
||||
@@ -162,19 +171,24 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
self.labelText = nil;
|
||||
self.detailsLabelText = nil;
|
||||
self.opacity = 0.8f;
|
||||
self.color = nil;
|
||||
self.color = nil;
|
||||
self.labelFont = [UIFont boldSystemFontOfSize:kLabelFontSize];
|
||||
self.labelColor = [UIColor whiteColor];
|
||||
self.detailsLabelFont = [UIFont boldSystemFontOfSize:kDetailsLabelFontSize];
|
||||
self.detailsLabelColor = [UIColor whiteColor];
|
||||
self.activityIndicatorColor = [UIColor whiteColor];
|
||||
self.xOffset = 0.0f;
|
||||
self.yOffset = 0.0f;
|
||||
self.dimBackground = NO;
|
||||
self.margin = 20.0f;
|
||||
self.cornerRadius = 10.0f;
|
||||
self.graceTime = 0.0f;
|
||||
self.minShowTime = 0.0f;
|
||||
self.removeFromSuperViewOnHide = NO;
|
||||
self.minSize = CGSizeZero;
|
||||
self.square = NO;
|
||||
self.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin
|
||||
self.contentMode = UIViewContentModeCenter;
|
||||
self.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin
|
||||
| UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
|
||||
|
||||
// Transparent background
|
||||
@@ -217,6 +231,10 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
[minShowTimer release];
|
||||
[showStarted release];
|
||||
[customView release];
|
||||
[labelFont release];
|
||||
[labelColor release];
|
||||
[detailsLabelFont release];
|
||||
[detailsLabelColor release];
|
||||
#if NS_BLOCKS_AVAILABLE
|
||||
[completionBlock release];
|
||||
#endif
|
||||
@@ -227,20 +245,22 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
#pragma mark - Show & hide
|
||||
|
||||
- (void)show:(BOOL)animated {
|
||||
NSAssert([NSThread isMainThread], @"MBProgressHUD needs to be accessed on the main thread.");
|
||||
useAnimation = animated;
|
||||
// If the grace time is set postpone the HUD display
|
||||
if (self.graceTime > 0.0) {
|
||||
self.graceTimer = [NSTimer scheduledTimerWithTimeInterval:self.graceTime target:self
|
||||
selector:@selector(handleGraceTimer:) userInfo:nil repeats:NO];
|
||||
NSTimer *newGraceTimer = [NSTimer timerWithTimeInterval:self.graceTime target:self selector:@selector(handleGraceTimer:) userInfo:nil repeats:NO];
|
||||
[[NSRunLoop currentRunLoop] addTimer:newGraceTimer forMode:NSRunLoopCommonModes];
|
||||
self.graceTimer = newGraceTimer;
|
||||
}
|
||||
// ... otherwise show the HUD imediately
|
||||
else {
|
||||
[self setNeedsDisplay];
|
||||
[self showUsingAnimation:useAnimation];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)hide:(BOOL)animated {
|
||||
NSAssert([NSThread isMainThread], @"MBProgressHUD needs to be accessed on the main thread.");
|
||||
useAnimation = animated;
|
||||
// If the minShow time is set, calculate how long the hud was shown,
|
||||
// and pospone the hiding operation if necessary
|
||||
@@ -269,7 +289,6 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
- (void)handleGraceTimer:(NSTimer *)theTimer {
|
||||
// Show the HUD only if the task is still running
|
||||
if (taskInProgress) {
|
||||
[self setNeedsDisplay];
|
||||
[self showUsingAnimation:useAnimation];
|
||||
}
|
||||
}
|
||||
@@ -281,15 +300,16 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
#pragma mark - View Hierrarchy
|
||||
|
||||
- (void)didMoveToSuperview {
|
||||
// We need to take care of rotation ourselfs if we're adding the HUD to a window
|
||||
if ([self.superview isKindOfClass:[UIWindow class]]) {
|
||||
[self setTransformForCurrentOrientation:NO];
|
||||
}
|
||||
[self updateForCurrentOrientationAnimated:NO];
|
||||
}
|
||||
|
||||
#pragma mark - Internal show & hide operations
|
||||
|
||||
- (void)showUsingAnimation:(BOOL)animated {
|
||||
// Cancel any scheduled hideDelayed: calls
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
||||
[self setNeedsDisplay];
|
||||
|
||||
if (animated && animationType == MBProgressHUDAnimationZoomIn) {
|
||||
self.transform = CGAffineTransformConcat(rotationTransform, CGAffineTransformMakeScale(0.5f, 0.5f));
|
||||
} else if (animated && animationType == MBProgressHUDAnimationZoomOut) {
|
||||
@@ -341,10 +361,11 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
}
|
||||
|
||||
- (void)done {
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
||||
isFinished = YES;
|
||||
self.alpha = 0.0f;
|
||||
if ([delegate respondsToSelector:@selector(hudWasHidden:)]) {
|
||||
[delegate performSelector:@selector(hudWasHidden:) withObject:self];
|
||||
if (removeFromSuperViewOnHide) {
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
#if NS_BLOCKS_AVAILABLE
|
||||
if (self.completionBlock) {
|
||||
@@ -352,8 +373,8 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
self.completionBlock = NULL;
|
||||
}
|
||||
#endif
|
||||
if (removeFromSuperViewOnHide) {
|
||||
[self removeFromSuperview];
|
||||
if ([delegate respondsToSelector:@selector(hudWasHidden:)]) {
|
||||
[delegate performSelector:@selector(hudWasHidden:) withObject:self];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,12 +412,12 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
self.taskInProgress = YES;
|
||||
self.completionBlock = completion;
|
||||
dispatch_async(queue, ^(void) {
|
||||
block();
|
||||
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
||||
[self cleanUp];
|
||||
});
|
||||
});
|
||||
[self show:animated];
|
||||
block();
|
||||
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
||||
[self cleanUp];
|
||||
});
|
||||
});
|
||||
[self show:animated];
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -416,7 +437,6 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
|
||||
- (void)cleanUp {
|
||||
taskInProgress = NO;
|
||||
self.indicator = nil;
|
||||
#if !__has_feature(objc_arc)
|
||||
[targetForExecution release];
|
||||
[objectForExecution release];
|
||||
@@ -435,7 +455,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
label.textAlignment = MBLabelAlignmentCenter;
|
||||
label.opaque = NO;
|
||||
label.backgroundColor = [UIColor clearColor];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.textColor = self.labelColor;
|
||||
label.font = self.labelFont;
|
||||
label.text = self.labelText;
|
||||
[self addSubview:label];
|
||||
@@ -446,7 +466,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
detailsLabel.textAlignment = MBLabelAlignmentCenter;
|
||||
detailsLabel.opaque = NO;
|
||||
detailsLabel.backgroundColor = [UIColor clearColor];
|
||||
detailsLabel.textColor = [UIColor whiteColor];
|
||||
detailsLabel.textColor = self.detailsLabelColor;
|
||||
detailsLabel.numberOfLines = 0;
|
||||
detailsLabel.font = self.detailsLabelFont;
|
||||
detailsLabel.text = self.detailsLabelText;
|
||||
@@ -458,18 +478,23 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
BOOL isActivityIndicator = [indicator isKindOfClass:[UIActivityIndicatorView class]];
|
||||
BOOL isRoundIndicator = [indicator isKindOfClass:[MBRoundProgressView class]];
|
||||
|
||||
if (mode == MBProgressHUDModeIndeterminate && !isActivityIndicator) {
|
||||
// Update to indeterminate indicator
|
||||
[indicator removeFromSuperview];
|
||||
self.indicator = MB_AUTORELEASE([[UIActivityIndicatorView alloc]
|
||||
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]);
|
||||
[(UIActivityIndicatorView *)indicator startAnimating];
|
||||
[self addSubview:indicator];
|
||||
if (mode == MBProgressHUDModeIndeterminate) {
|
||||
if (!isActivityIndicator) {
|
||||
// Update to indeterminate indicator
|
||||
[indicator removeFromSuperview];
|
||||
self.indicator = MB_AUTORELEASE([[UIActivityIndicatorView alloc]
|
||||
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]);
|
||||
[(UIActivityIndicatorView *)indicator startAnimating];
|
||||
[self addSubview:indicator];
|
||||
}
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 50000
|
||||
[(UIActivityIndicatorView *)indicator setColor:self.activityIndicatorColor];
|
||||
#endif
|
||||
}
|
||||
else if (mode == MBProgressHUDModeDeterminateHorizontalBar) {
|
||||
// Update to bar determinate indicator
|
||||
[indicator removeFromSuperview];
|
||||
self.indicator = MB_AUTORELEASE([[MBBarProgressView alloc] init]);
|
||||
self.indicator = MB_AUTORELEASE([[MBBarProgressView alloc] init]);
|
||||
[self addSubview:indicator];
|
||||
}
|
||||
else if (mode == MBProgressHUDModeDeterminate || mode == MBProgressHUDModeAnnularDeterminate) {
|
||||
@@ -482,7 +507,9 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
if (mode == MBProgressHUDModeAnnularDeterminate) {
|
||||
[(MBRoundProgressView *)indicator setAnnular:YES];
|
||||
}
|
||||
}
|
||||
[(MBRoundProgressView *)indicator setProgressTintColor:self.activityIndicatorColor];
|
||||
[(MBRoundProgressView *)indicator setBackgroundTintColor:[self.activityIndicatorColor colorWithAlphaComponent:0.1f]];
|
||||
}
|
||||
else if (mode == MBProgressHUDModeCustomView && customView != indicator) {
|
||||
// Update custom view indicator
|
||||
[indicator removeFromSuperview];
|
||||
@@ -497,6 +524,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
#pragma mark - Layout
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
|
||||
// Entirely cover the parent view
|
||||
UIView *parent = self.superview;
|
||||
@@ -505,7 +533,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
}
|
||||
CGRect bounds = self.bounds;
|
||||
|
||||
// Determine the total widt and height needed
|
||||
// Determine the total width and height needed
|
||||
CGFloat maxWidth = bounds.size.width - 4 * margin;
|
||||
CGSize totalSize = CGSizeZero;
|
||||
|
||||
@@ -514,7 +542,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
totalSize.width = MAX(totalSize.width, indicatorF.size.width);
|
||||
totalSize.height += indicatorF.size.height;
|
||||
|
||||
CGSize labelSize = [label.text sizeWithFont:label.font];
|
||||
CGSize labelSize = MB_TEXTSIZE(label.text, label.font);
|
||||
labelSize.width = MIN(labelSize.width, maxWidth);
|
||||
totalSize.width = MAX(totalSize.width, labelSize.width);
|
||||
totalSize.height += labelSize.height;
|
||||
@@ -524,8 +552,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
|
||||
CGFloat remainingHeight = bounds.size.height - totalSize.height - kPadding - 4 * margin;
|
||||
CGSize maxSize = CGSizeMake(maxWidth, remainingHeight);
|
||||
CGSize detailsLabelSize = [detailsLabel.text sizeWithFont:detailsLabel.font
|
||||
constrainedToSize:maxSize lineBreakMode:detailsLabel.lineBreakMode];
|
||||
CGSize detailsLabelSize = MB_MULTILINE_TEXTSIZE(detailsLabel.text, detailsLabel.font, maxSize, detailsLabel.lineBreakMode);
|
||||
totalSize.width = MAX(totalSize.width, detailsLabelSize.width);
|
||||
totalSize.height += detailsLabelSize.height;
|
||||
if (detailsLabelSize.height > 0.f && (indicatorF.size.height > 0.f || labelSize.height > 0.f)) {
|
||||
@@ -536,10 +563,10 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
totalSize.height += 2 * margin;
|
||||
|
||||
// Position elements
|
||||
CGFloat yPos = roundf(((bounds.size.height - totalSize.height) / 2)) + margin + yOffset;
|
||||
CGFloat yPos = round(((bounds.size.height - totalSize.height) / 2)) + margin + yOffset;
|
||||
CGFloat xPos = xOffset;
|
||||
indicatorF.origin.y = yPos;
|
||||
indicatorF.origin.x = roundf((bounds.size.width - indicatorF.size.width) / 2) + xPos;
|
||||
indicatorF.origin.x = round((bounds.size.width - indicatorF.size.width) / 2) + xPos;
|
||||
indicator.frame = indicatorF;
|
||||
yPos += indicatorF.size.height;
|
||||
|
||||
@@ -548,7 +575,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
}
|
||||
CGRect labelF;
|
||||
labelF.origin.y = yPos;
|
||||
labelF.origin.x = roundf((bounds.size.width - labelSize.width) / 2) + xPos;
|
||||
labelF.origin.x = round((bounds.size.width - labelSize.width) / 2) + xPos;
|
||||
labelF.size = labelSize;
|
||||
label.frame = labelF;
|
||||
yPos += labelF.size.height;
|
||||
@@ -558,7 +585,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
}
|
||||
CGRect detailsLabelF;
|
||||
detailsLabelF.origin.y = yPos;
|
||||
detailsLabelF.origin.x = roundf((bounds.size.width - detailsLabelSize.width) / 2) + xPos;
|
||||
detailsLabelF.origin.x = round((bounds.size.width - detailsLabelSize.width) / 2) + xPos;
|
||||
detailsLabelF.size = detailsLabelSize;
|
||||
detailsLabel.frame = detailsLabelF;
|
||||
|
||||
@@ -579,7 +606,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
totalSize.height = minSize.height;
|
||||
}
|
||||
|
||||
self.size = totalSize;
|
||||
size = totalSize;
|
||||
}
|
||||
|
||||
#pragma mark BG Drawing
|
||||
@@ -608,20 +635,20 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
CGGradientRelease(gradient);
|
||||
}
|
||||
|
||||
// Set background rect color
|
||||
if (self.color) {
|
||||
CGContextSetFillColorWithColor(context, self.color.CGColor);
|
||||
} else {
|
||||
CGContextSetGrayFillColor(context, 0.0f, self.opacity);
|
||||
}
|
||||
// Set background rect color
|
||||
if (self.color) {
|
||||
CGContextSetFillColorWithColor(context, self.color.CGColor);
|
||||
} else {
|
||||
CGContextSetGrayFillColor(context, 0.0f, self.opacity);
|
||||
}
|
||||
|
||||
|
||||
// Center HUD
|
||||
CGRect allRect = self.bounds;
|
||||
// Draw rounded HUD backgroud rect
|
||||
CGRect boxRect = CGRectMake(roundf((allRect.size.width - size.width) / 2) + self.xOffset,
|
||||
roundf((allRect.size.height - size.height) / 2) + self.yOffset, size.width, size.height);
|
||||
float radius = 10.0f;
|
||||
CGRect boxRect = CGRectMake(round((allRect.size.width - size.width) / 2) + self.xOffset,
|
||||
round((allRect.size.height - size.height) / 2) + self.yOffset, size.width, size.height);
|
||||
float radius = self.cornerRadius;
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, CGRectGetMinX(boxRect) + radius, CGRectGetMinY(boxRect));
|
||||
CGContextAddArc(context, CGRectGetMaxX(boxRect) - radius, CGRectGetMinY(boxRect) + radius, radius, 3 * (float)M_PI / 2, 0, 0);
|
||||
@@ -649,8 +676,8 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
}
|
||||
|
||||
- (NSArray *)observableKeypaths {
|
||||
return [NSArray arrayWithObjects:@"mode", @"customView", @"labelText", @"labelFont",
|
||||
@"detailsLabelText", @"detailsLabelFont", @"progress", nil];
|
||||
return [NSArray arrayWithObjects:@"mode", @"customView", @"labelText", @"labelFont", @"labelColor",
|
||||
@"detailsLabelText", @"detailsLabelFont", @"detailsLabelColor", @"progress", @"activityIndicatorColor", nil];
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
@@ -662,19 +689,24 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
}
|
||||
|
||||
- (void)updateUIForKeypath:(NSString *)keyPath {
|
||||
if ([keyPath isEqualToString:@"mode"] || [keyPath isEqualToString:@"customView"]) {
|
||||
if ([keyPath isEqualToString:@"mode"] || [keyPath isEqualToString:@"customView"] ||
|
||||
[keyPath isEqualToString:@"activityIndicatorColor"]) {
|
||||
[self updateIndicators];
|
||||
} else if ([keyPath isEqualToString:@"labelText"]) {
|
||||
label.text = self.labelText;
|
||||
} else if ([keyPath isEqualToString:@"labelFont"]) {
|
||||
label.font = self.labelFont;
|
||||
} else if ([keyPath isEqualToString:@"labelColor"]) {
|
||||
label.textColor = self.labelColor;
|
||||
} else if ([keyPath isEqualToString:@"detailsLabelText"]) {
|
||||
detailsLabel.text = self.detailsLabelText;
|
||||
} else if ([keyPath isEqualToString:@"detailsLabelFont"]) {
|
||||
detailsLabel.font = self.detailsLabelFont;
|
||||
} else if ([keyPath isEqualToString:@"detailsLabelColor"]) {
|
||||
detailsLabel.textColor = self.detailsLabelColor;
|
||||
} else if ([keyPath isEqualToString:@"progress"]) {
|
||||
if ([indicator respondsToSelector:@selector(setProgress:)]) {
|
||||
[(id)indicator setProgress:progress];
|
||||
[(id)indicator setValue:@(progress) forKey:@"progress"];
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -685,34 +717,46 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
#pragma mark - Notifications
|
||||
|
||||
- (void)registerForNotifications {
|
||||
#if !TARGET_OS_TV
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(deviceOrientationDidChange:)
|
||||
name:UIDeviceOrientationDidChangeNotification object:nil];
|
||||
|
||||
[nc addObserver:self selector:@selector(statusBarOrientationDidChange:)
|
||||
name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)unregisterFromNotifications {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
#if !TARGET_OS_TV
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc removeObserver:self name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)deviceOrientationDidChange:(NSNotification *)notification {
|
||||
#if !TARGET_OS_TV
|
||||
- (void)statusBarOrientationDidChange:(NSNotification *)notification {
|
||||
UIView *superview = self.superview;
|
||||
if (!superview) {
|
||||
return;
|
||||
} else if ([superview isKindOfClass:[UIWindow class]]) {
|
||||
[self setTransformForCurrentOrientation:YES];
|
||||
} else {
|
||||
self.bounds = self.superview.bounds;
|
||||
[self setNeedsDisplay];
|
||||
[self updateForCurrentOrientationAnimated:YES];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
- (void)updateForCurrentOrientationAnimated:(BOOL)animated {
|
||||
// Stay in sync with the superview in any case
|
||||
if (self.superview) {
|
||||
self.bounds = self.superview.bounds;
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
// Not needed on iOS 8+, compile out when the deployment target allows,
|
||||
// to avoid sharedApplication problems on extension targets
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
|
||||
// Only needed pre iOS 7 when added to a window
|
||||
BOOL iOS8OrLater = kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_8_0;
|
||||
if (iOS8OrLater || ![self.superview isKindOfClass:[UIWindow class]]) return;
|
||||
|
||||
- (void)setTransformForCurrentOrientation:(BOOL)animated {
|
||||
// Stay in sync with the superview
|
||||
if (self.superview) {
|
||||
self.bounds = self.superview.bounds;
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
CGFloat radians = 0;
|
||||
if (UIInterfaceOrientationIsLandscape(orientation)) {
|
||||
@@ -728,11 +772,13 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
|
||||
if (animated) {
|
||||
[UIView beginAnimations:nil context:nil];
|
||||
[UIView setAnimationDuration:0.3];
|
||||
}
|
||||
[self setTransform:rotationTransform];
|
||||
if (animated) {
|
||||
[UIView commitAnimations];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -779,10 +825,11 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
|
||||
if (_annular) {
|
||||
// Draw background
|
||||
CGFloat lineWidth = 5.f;
|
||||
BOOL isPreiOS7 = kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_iOS_7_0;
|
||||
CGFloat lineWidth = isPreiOS7 ? 5.f : 2.f;
|
||||
UIBezierPath *processBackgroundPath = [UIBezierPath bezierPath];
|
||||
processBackgroundPath.lineWidth = lineWidth;
|
||||
processBackgroundPath.lineCapStyle = kCGLineCapRound;
|
||||
processBackgroundPath.lineCapStyle = kCGLineCapButt;
|
||||
CGPoint center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2);
|
||||
CGFloat radius = (self.bounds.size.width - lineWidth)/2;
|
||||
CGFloat startAngle = - ((float)M_PI / 2); // 90 degrees
|
||||
@@ -792,7 +839,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
[processBackgroundPath stroke];
|
||||
// Draw progress
|
||||
UIBezierPath *processPath = [UIBezierPath bezierPath];
|
||||
processPath.lineCapStyle = kCGLineCapRound;
|
||||
processPath.lineCapStyle = isPreiOS7 ? kCGLineCapRound : kCGLineCapSquare;
|
||||
processPath.lineWidth = lineWidth;
|
||||
endAngle = (self.progress * 2 * (float)M_PI) + startAngle;
|
||||
[processPath addArcWithCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES];
|
||||
@@ -810,7 +857,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
CGFloat radius = (allRect.size.width - 4) / 2;
|
||||
CGFloat startAngle = - ((float)M_PI / 2); // 90 degrees
|
||||
CGFloat endAngle = (self.progress * 2 * (float)M_PI) + startAngle;
|
||||
CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f); // white
|
||||
[_progressTintColor setFill];
|
||||
CGContextMoveToPoint(context, center.x, center.y);
|
||||
CGContextAddArc(context, center.x, center.y, radius, startAngle, endAngle, 0);
|
||||
CGContextClosePath(context);
|
||||
@@ -852,8 +899,8 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
_progress = 0.f;
|
||||
_lineColor = [UIColor whiteColor];
|
||||
_progressColor = [UIColor whiteColor];
|
||||
@@ -861,8 +908,8 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.opaque = NO;
|
||||
[self registerForKVO];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
@@ -880,12 +927,11 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
- (void)drawRect:(CGRect)rect {
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
|
||||
// setup properties
|
||||
CGContextSetLineWidth(context, 2);
|
||||
CGContextSetStrokeColorWithColor(context,[_lineColor CGColor]);
|
||||
CGContextSetFillColorWithColor(context, [_progressRemainingColor CGColor]);
|
||||
|
||||
// draw line border
|
||||
// Draw background
|
||||
float radius = (rect.size.height / 2) - 2;
|
||||
CGContextMoveToPoint(context, 2, rect.size.height/2);
|
||||
CGContextAddArcToPoint(context, 2, 2, radius + 2, 2, radius);
|
||||
@@ -896,7 +942,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
CGContextAddArcToPoint(context, 2, rect.size.height - 2, 2, rect.size.height/2, radius);
|
||||
CGContextFillPath(context);
|
||||
|
||||
// draw progress background
|
||||
// Draw border
|
||||
CGContextMoveToPoint(context, 2, rect.size.height/2);
|
||||
CGContextAddArcToPoint(context, 2, 2, radius + 2, 2, radius);
|
||||
CGContextAddLineToPoint(context, rect.size.width - radius - 2, 2);
|
||||
@@ -906,20 +952,17 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
CGContextAddArcToPoint(context, 2, rect.size.height - 2, 2, rect.size.height/2, radius);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
// setup to draw progress color
|
||||
CGContextSetFillColorWithColor(context, [_progressColor CGColor]);
|
||||
radius = radius - 2;
|
||||
float amount = self.progress * rect.size.width;
|
||||
|
||||
// if progress is in the middle area
|
||||
// Progress in the middle area
|
||||
if (amount >= radius + 4 && amount <= (rect.size.width - radius - 4)) {
|
||||
// top
|
||||
CGContextMoveToPoint(context, 4, rect.size.height/2);
|
||||
CGContextAddArcToPoint(context, 4, 4, radius + 4, 4, radius);
|
||||
CGContextAddLineToPoint(context, amount, 4);
|
||||
CGContextAddLineToPoint(context, amount, radius + 4);
|
||||
|
||||
// bottom
|
||||
CGContextMoveToPoint(context, 4, rect.size.height/2);
|
||||
CGContextAddArcToPoint(context, 4, rect.size.height - 4, radius + 4, rect.size.height - 4, radius);
|
||||
CGContextAddLineToPoint(context, amount, rect.size.height - 4);
|
||||
@@ -928,11 +971,10 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
CGContextFillPath(context);
|
||||
}
|
||||
|
||||
// progress is in the right arc
|
||||
// Progress in the right arc
|
||||
else if (amount > radius + 4) {
|
||||
float x = amount - (rect.size.width - radius - 4);
|
||||
|
||||
// top
|
||||
|
||||
CGContextMoveToPoint(context, 4, rect.size.height/2);
|
||||
CGContextAddArcToPoint(context, 4, 4, radius + 4, 4, radius);
|
||||
CGContextAddLineToPoint(context, rect.size.width - radius - 4, 4);
|
||||
@@ -940,8 +982,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
if (isnan(angle)) angle = 0;
|
||||
CGContextAddArc(context, rect.size.width - radius - 4, rect.size.height/2, radius, M_PI, angle, 0);
|
||||
CGContextAddLineToPoint(context, amount, rect.size.height/2);
|
||||
|
||||
// bottom
|
||||
|
||||
CGContextMoveToPoint(context, 4, rect.size.height/2);
|
||||
CGContextAddArcToPoint(context, 4, rect.size.height - 4, radius + 4, rect.size.height - 4, radius);
|
||||
CGContextAddLineToPoint(context, rect.size.width - radius - 4, rect.size.height - 4);
|
||||
@@ -953,14 +994,12 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
||||
CGContextFillPath(context);
|
||||
}
|
||||
|
||||
// progress is in the left arc
|
||||
// Progress is in the left arc
|
||||
else if (amount < radius + 4 && amount > 0) {
|
||||
// top
|
||||
CGContextMoveToPoint(context, 4, rect.size.height/2);
|
||||
CGContextAddArcToPoint(context, 4, 4, radius + 4, 4, radius);
|
||||
CGContextAddLineToPoint(context, radius + 4, rect.size.height/2);
|
||||
|
||||
// bottom
|
||||
|
||||
CGContextMoveToPoint(context, 4, rect.size.height/2);
|
||||
CGContextAddArcToPoint(context, 4, rect.size.height - 4, radius + 4, rect.size.height - 4, radius);
|
||||
CGContextAddLineToPoint(context, radius + 4, rect.size.height/2);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "MBProgressHUD"
|
||||
s.version = "0.7"
|
||||
s.version = "0.9.2"
|
||||
s.summary = "An iOS activity indicator view."
|
||||
s.description = <<-DESC
|
||||
MBProgressHUD is an iOS drop-in class that displays a translucent HUD
|
||||
|
||||
@@ -7,14 +7,32 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1315DD7617804CBC0032507D /* MBProgressHUD.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D286A7511518C70F00E13FB8 /* MBProgressHUD.h */; };
|
||||
1D104D931ACA371400973364 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D286A7521518C70F00E13FB8 /* MBProgressHUD.m */; };
|
||||
1D104D941ACA373100973364 /* MBProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = D286A7511518C70F00E13FB8 /* MBProgressHUD.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
D286A74D1518C70F00E13FB8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D286A74C1518C70F00E13FB8 /* Foundation.framework */; };
|
||||
D286A7531518C70F00E13FB8 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D286A7521518C70F00E13FB8 /* MBProgressHUD.m */; };
|
||||
D286A75E1518C89600E13FB8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D286A75D1518C89600E13FB8 /* UIKit.framework */; };
|
||||
D286A76F1518CAAD00E13FB8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D286A76E1518CAAD00E13FB8 /* CoreGraphics.framework */; };
|
||||
D286A7851518CBEE00E13FB8 /* MBProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = D286A7511518C70F00E13FB8 /* MBProgressHUD.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
1315DD7517804C970032507D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "include/${PRODUCT_NAME}";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
1315DD7617804CBC0032507D /* MBProgressHUD.h in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1315DD73178045000032507D /* MBProgressHUD-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MBProgressHUD-Prefix.pch"; sourceTree = SOURCE_ROOT; };
|
||||
1D104D7A1ACA36CC00973364 /* MBProgressHUD.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MBProgressHUD.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1D104D951ACA376200973364 /* Framework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Framework-Info.plist"; sourceTree = SOURCE_ROOT; };
|
||||
D286A7491518C70F00E13FB8 /* libMBProgressHUD.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMBProgressHUD.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D286A74C1518C70F00E13FB8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
D286A7511518C70F00E13FB8 /* MBProgressHUD.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = SOURCE_ROOT; };
|
||||
@@ -24,19 +42,35 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
1D104D761ACA36CC00973364 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D286A7461518C70F00E13FB8 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D286A76F1518CAAD00E13FB8 /* CoreGraphics.framework in Frameworks */,
|
||||
D286A75E1518C89600E13FB8 /* UIKit.framework in Frameworks */,
|
||||
D286A74D1518C70F00E13FB8 /* Foundation.framework in Frameworks */,
|
||||
D286A76F1518CAAD00E13FB8 /* CoreGraphics.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
1315DD72178044770032507D /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D104D951ACA376200973364 /* Framework-Info.plist */,
|
||||
1315DD73178045000032507D /* MBProgressHUD-Prefix.pch */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D286A73E1518C70E00E13FB8 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -50,6 +84,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D286A7491518C70F00E13FB8 /* libMBProgressHUD.a */,
|
||||
1D104D7A1ACA36CC00973364 /* MBProgressHUD.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -57,9 +92,9 @@
|
||||
D286A74B1518C70F00E13FB8 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D286A76E1518CAAD00E13FB8 /* CoreGraphics.framework */,
|
||||
D286A75D1518C89600E13FB8 /* UIKit.framework */,
|
||||
D286A74C1518C70F00E13FB8 /* Foundation.framework */,
|
||||
D286A76E1518CAAD00E13FB8 /* CoreGraphics.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -69,6 +104,7 @@
|
||||
children = (
|
||||
D286A7511518C70F00E13FB8 /* MBProgressHUD.h */,
|
||||
D286A7521518C70F00E13FB8 /* MBProgressHUD.m */,
|
||||
1315DD72178044770032507D /* Supporting Files */,
|
||||
);
|
||||
path = MBProgressHUD;
|
||||
sourceTree = "<group>";
|
||||
@@ -76,30 +112,48 @@
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
D286A7471518C70F00E13FB8 /* Headers */ = {
|
||||
1D104D771ACA36CC00973364 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D286A7851518CBEE00E13FB8 /* MBProgressHUD.h in Headers */,
|
||||
1D104D941ACA373100973364 /* MBProgressHUD.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
D286A7481518C70F00E13FB8 /* MBProgressHUD */ = {
|
||||
1D104D791ACA36CC00973364 /* MBProgressHUD Framework */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = D286A7561518C70F00E13FB8 /* Build configuration list for PBXNativeTarget "MBProgressHUD" */;
|
||||
buildConfigurationList = 1D104D8D1ACA36CC00973364 /* Build configuration list for PBXNativeTarget "MBProgressHUD Framework" */;
|
||||
buildPhases = (
|
||||
D286A7451518C70F00E13FB8 /* Sources */,
|
||||
D286A7461518C70F00E13FB8 /* Frameworks */,
|
||||
D286A7471518C70F00E13FB8 /* Headers */,
|
||||
1D104D751ACA36CC00973364 /* Sources */,
|
||||
1D104D761ACA36CC00973364 /* Frameworks */,
|
||||
1D104D771ACA36CC00973364 /* Headers */,
|
||||
1D104D781ACA36CC00973364 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = MBProgressHUD;
|
||||
name = "MBProgressHUD Framework";
|
||||
productName = "MBProgressHUD Framework";
|
||||
productReference = 1D104D7A1ACA36CC00973364 /* MBProgressHUD.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
D286A7481518C70F00E13FB8 /* MBProgressHUD Static Library */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = D286A7561518C70F00E13FB8 /* Build configuration list for PBXNativeTarget "MBProgressHUD Static Library" */;
|
||||
buildPhases = (
|
||||
D286A7451518C70F00E13FB8 /* Sources */,
|
||||
D286A7461518C70F00E13FB8 /* Frameworks */,
|
||||
1315DD7517804C970032507D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "MBProgressHUD Static Library";
|
||||
productName = MBProgressHUD;
|
||||
productReference = D286A7491518C70F00E13FB8 /* libMBProgressHUD.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
@@ -111,8 +165,13 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
CLASSPREFIX = MB;
|
||||
LastUpgradeCheck = 0460;
|
||||
LastUpgradeCheck = 0630;
|
||||
ORGANIZATIONNAME = "Matej Bukovinski";
|
||||
TargetAttributes = {
|
||||
1D104D791ACA36CC00973364 = {
|
||||
CreatedOnToolsVersion = 6.2;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = D286A7431518C70E00E13FB8 /* Build configuration list for PBXProject "MBProgressHUD" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -126,12 +185,31 @@
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
D286A7481518C70F00E13FB8 /* MBProgressHUD */,
|
||||
D286A7481518C70F00E13FB8 /* MBProgressHUD Static Library */,
|
||||
1D104D791ACA36CC00973364 /* MBProgressHUD Framework */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
1D104D781ACA36CC00973364 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
1D104D751ACA36CC00973364 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1D104D931ACA371400973364 /* MBProgressHUD.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D286A7451518C70F00E13FB8 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -143,18 +221,88 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1D104D8E1ACA36CC00973364 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = "Framework-Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_NAME = MBProgressHUD;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1D104D8F1ACA36CC00973364 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = "Framework-Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_NAME = MBProgressHUD;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
D286A7541518C70F00E13FB8 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
@@ -162,10 +310,14 @@
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Debug;
|
||||
@@ -174,18 +326,27 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
@@ -195,12 +356,10 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DSTROOT = /tmp/MBProgressHUD.dst;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)";
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "MBProgressHUD-Prefix.pch";
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PUBLIC_HEADERS_FOLDER_PATH = "include/$(TARGET_NAME)";
|
||||
PRODUCT_NAME = MBProgressHUD;
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Debug;
|
||||
@@ -209,12 +368,10 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DSTROOT = /tmp/MBProgressHUD.dst;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)";
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "MBProgressHUD-Prefix.pch";
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PUBLIC_HEADERS_FOLDER_PATH = "include/$(TARGET_NAME)";
|
||||
PRODUCT_NAME = MBProgressHUD;
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Release;
|
||||
@@ -222,6 +379,15 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1D104D8D1ACA36CC00973364 /* Build configuration list for PBXNativeTarget "MBProgressHUD Framework" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1D104D8E1ACA36CC00973364 /* Debug */,
|
||||
1D104D8F1ACA36CC00973364 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
D286A7431518C70E00E13FB8 /* Build configuration list for PBXProject "MBProgressHUD" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
@@ -231,7 +397,7 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
D286A7561518C70F00E13FB8 /* Build configuration list for PBXNativeTarget "MBProgressHUD" */ = {
|
||||
D286A7561518C70F00E13FB8 /* Build configuration list for PBXNativeTarget "MBProgressHUD Static Library" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
D286A7571518C70F00E13FB8 /* Debug */,
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D104D791ACA36CC00973364"
|
||||
BuildableName = "MBProgressHUD.framework"
|
||||
BlueprintName = "MBProgressHUD Framework"
|
||||
ReferencedContainer = "container:MBProgressHUD.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D104D791ACA36CC00973364"
|
||||
BuildableName = "MBProgressHUD.framework"
|
||||
BlueprintName = "MBProgressHUD Framework"
|
||||
ReferencedContainer = "container:MBProgressHUD.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D104D791ACA36CC00973364"
|
||||
BuildableName = "MBProgressHUD.framework"
|
||||
BlueprintName = "MBProgressHUD Framework"
|
||||
ReferencedContainer = "container:MBProgressHUD.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0460"
|
||||
LastUpgradeVersion = "0720"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -16,37 +16,49 @@
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D286A7481518C70F00E13FB8"
|
||||
BuildableName = "libMBProgressHUD.a"
|
||||
BlueprintName = "MBProgressHUD"
|
||||
BlueprintName = "MBProgressHUD Static Library"
|
||||
ReferencedContainer = "container:MBProgressHUD.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D286A7481518C70F00E13FB8"
|
||||
BuildableName = "libMBProgressHUD.a"
|
||||
BlueprintName = "MBProgressHUD Static Library"
|
||||
ReferencedContainer = "container:MBProgressHUD.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
|
||||
@@ -13,4 +13,7 @@
|
||||
<FileRef
|
||||
location = "group:LICENSE">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:MBProgressHUD.podspec">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# MBProgressHUD [](https://travis-ci.org/matej/MBProgressHUD)
|
||||
# MBProgressHUD
|
||||
|
||||
MBProgressHUD is an iOS drop-in class that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the undocumented, private UIKit UIProgressHUD with some additional features.
|
||||
[](https://travis-ci.org/matej/MBProgressHUD) [](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) [](https://cocoapods.org/pods/MBProgressHUD) [](http://opensource.org/licenses/MIT)
|
||||
|
||||
MBProgressHUD is an iOS drop-in class that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the undocumented, private UIKit UIProgressHUD with some additional features.
|
||||
|
||||
[](http://dl.dropbox.com/u/378729/MBProgressHUD/1.png)
|
||||
[](http://dl.dropbox.com/u/378729/MBProgressHUD/2.png)
|
||||
@@ -18,7 +20,7 @@ MBProgressHUD works on any iOS version and is compatible with both ARC and non-A
|
||||
* UIKit.framework
|
||||
* CoreGraphics.framework
|
||||
|
||||
You will need LLVM 3.0 or later in order to build MBProgressHUD.
|
||||
You will need the latest developer tools in order to build MBProgressHUD. Old Xcode versions might work, but compatibility will not be explicitly maintained.
|
||||
|
||||
## Adding MBProgressHUD to your project
|
||||
|
||||
@@ -26,30 +28,36 @@ You will need LLVM 3.0 or later in order to build MBProgressHUD.
|
||||
|
||||
[CocoaPods](http://cocoapods.org) is the recommended way to add MBProgressHUD to your project.
|
||||
|
||||
1. Add a pod entry for MBProgressHUD to your Podfile `pod 'MBProgressHUD', '~> 0.6'`
|
||||
1. Add a pod entry for MBProgressHUD to your Podfile `pod 'MBProgressHUD', '~> 0.9.2'`
|
||||
2. Install the pod(s) by running `pod install`.
|
||||
3. Include MBProgressHUD wherever you need it with `#import "MBProgressHUD.h"`.
|
||||
|
||||
### Carthage
|
||||
|
||||
1. Add MBProgressHUD to your Cartfile. e.g., `github "jdg/MBProgressHUD" ~> 0.9.2`
|
||||
2. Run `carthage update`
|
||||
3. Follow the rest of the [standard Carthage installation instructions](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) to add MBProgressHUD to your project.
|
||||
|
||||
### Source files
|
||||
|
||||
Alternatively you can directly add the `MBProgressHUD.h` and `MBProgressHUD.m` source files to your project.
|
||||
|
||||
1. Download the [latest code version](https://github.com/matej/MBProgressHUD/archive/master.zip) or add the repository as a git submodule to your git-tracked project.
|
||||
2. Open your project in Xcode, then drag and drop `MBProgressHUD.h` and `MBProgressHUD.m` onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.
|
||||
1. Download the [latest code version](https://github.com/matej/MBProgressHUD/archive/master.zip) or add the repository as a git submodule to your git-tracked project.
|
||||
2. Open your project in Xcode, then drag and drop `MBProgressHUD.h` and `MBProgressHUD.m` onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.
|
||||
3. Include MBProgressHUD wherever you need it with `#import "MBProgressHUD.h"`.
|
||||
|
||||
### Static library
|
||||
|
||||
You can also add MBProgressHUD as a static library to your project or workspace.
|
||||
You can also add MBProgressHUD as a static library to your project or workspace.
|
||||
|
||||
1. Download the [latest code version](https://github.com/matej/MBProgressHUD/downloads) or add the repository as a git submodule to your git-tracked project.
|
||||
2. Open your project in Xcode, then drag and drop `MBProgressHUD.xcodeproj` onto your project or workspace (use the "Product Navigator view").
|
||||
3. Select your target and go to the Build phases tab. In the Link Binary With Libraries section select the add button. On the sheet find and add `libMBProgressHUD.a`. You might also need to add `MBProgressHUD` to the Target Dependencies list.
|
||||
1. Download the [latest code version](https://github.com/matej/MBProgressHUD/downloads) or add the repository as a git submodule to your git-tracked project.
|
||||
2. Open your project in Xcode, then drag and drop `MBProgressHUD.xcodeproj` onto your project or workspace (use the "Product Navigator view").
|
||||
3. Select your target and go to the Build phases tab. In the Link Binary With Libraries section select the add button. On the sheet find and add `libMBProgressHUD.a`. You might also need to add `MBProgressHUD` to the Target Dependencies list.
|
||||
4. Include MBProgressHUD wherever you need it with `#import <MBProgressHUD/MBProgressHUD.h>`.
|
||||
|
||||
## Usage
|
||||
|
||||
The main guideline you need to follow when dealing with MBProgressHUD while running long-running tasks is keeping the main thread work-free, so the UI can be updated promptly. The recommended way of using MBProgressHUD is therefore to set it up on the main thread and then spinning the task, that you want to perform, off onto a new thread.
|
||||
The main guideline you need to follow when dealing with MBProgressHUD while running long-running tasks is keeping the main thread work-free, so the UI can be updated promptly. The recommended way of using MBProgressHUD is therefore to set it up on the main thread and then spinning the task, that you want to perform, off onto a new thread.
|
||||
|
||||
```objective-c
|
||||
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
@@ -61,7 +69,7 @@ dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
|
||||
});
|
||||
```
|
||||
|
||||
If you need to configure the HUD you can do this by using the MBProgressHUD reference that showHUDAddedTo:animated: returns.
|
||||
If you need to configure the HUD you can do this by using the MBProgressHUD reference that showHUDAddedTo:animated: returns.
|
||||
|
||||
```objective-c
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
@@ -94,8 +102,8 @@ For more examples, including how to use MBProgressHUD with asynchronous operatio
|
||||
|
||||
## License
|
||||
|
||||
This code is distributed under the terms and conditions of the [MIT license](LICENSE).
|
||||
This code is distributed under the terms and conditions of the [MIT license](LICENSE).
|
||||
|
||||
## Change-log
|
||||
|
||||
A brief summary of each MBProgressHUD release can be found on the [wiky](https://github.com/matej/MBProgressHUD/wiki/Change-log).
|
||||
A brief summary of each MBProgressHUD release can be found on the [wiki](https://github.com/matej/MBProgressHUD/wiki/Change-log).
|
||||
|
||||