Compare commits
204 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7c3601fbd | |||
| c843711aa8 | |||
| ec7d1e4aca | |||
| aec802ba2c | |||
| e1e6052966 | |||
| 51291d888e | |||
| 0088039ee7 | |||
| 6424bb843b | |||
| 117d524029 | |||
| cd545e566d | |||
| e5ff0eb91b | |||
| 59a8240da6 | |||
| dffe0e2763 | |||
| bb8e454998 | |||
| 302e56caa4 | |||
| dbbb9e7b08 | |||
| 9365cb42e8 | |||
| 0f0686cc18 | |||
| 6d8aabcb35 | |||
| 5a5e8b1b12 | |||
| bc89f10b91 | |||
| 9f5c392d49 | |||
| 772efaa7ec | |||
| 95ac3cc577 | |||
| b8e4ad0fcc | |||
| 6cdb787c21 | |||
| e946b05a9a | |||
| 740d475fe8 | |||
| 1dc32f2e4d | |||
| 406eb5e62f | |||
| 0416fa6c6f | |||
| 7e1f4b6a33 | |||
| 1f794f62eb | |||
| b11d70c22d | |||
| ae9dd5f244 | |||
| 643c6d1727 | |||
| 18127ef046 | |||
| a29c736ef8 | |||
| 2171272be3 | |||
| fd6548f547 | |||
| 61e5236bd3 | |||
| 2546c7efd9 | |||
| c8c91f7783 | |||
| 33eb2ddbe8 | |||
| 3baf8db932 | |||
| 7f12067e3b | |||
| ca93b61a84 | |||
| f663584e42 | |||
| 4acabac2e3 | |||
| 4762896393 | |||
| d6f3e37d7b | |||
| ad8148d32e | |||
| 3de6e1398f | |||
| c2d44aa0e8 | |||
| 383e8f5131 | |||
| f3732cc105 | |||
| 316cb39f86 | |||
| ba3bd1b313 | |||
| 5c3b93fe4f | |||
| abf99ff2c3 | |||
| 5ec046ae8e | |||
| 874860e0f5 | |||
| 605f9d762e | |||
| b1b206c7ca | |||
| e9408d01f3 | |||
| c9028d2412 | |||
| 1a7424df44 | |||
| 73f3353a93 | |||
| 49c1136fa6 | |||
| d802c7c73c | |||
| ebdd2ff653 | |||
| 7e65c68e9f | |||
| 32843df5b6 | |||
| f6913b4db1 | |||
| f39a83aef6 | |||
| 7ea2306a8d | |||
| 14ec8907af | |||
| 57d5f406b1 | |||
| 782538a3fc | |||
| 00b84fa176 | |||
| 4b359365ac | |||
| 29f8ddc9cf | |||
| a6d9f95b1e | |||
| 5fb23d6df8 | |||
| a46e1bc21f | |||
| 15718b937d | |||
| 2703ca1601 | |||
| fbf05a09c2 | |||
| 7105c505c8 | |||
| 8bb8d79140 | |||
| 80fc1445c0 | |||
| 225de3cb29 | |||
| f6864fd49e | |||
| cc19e2277b | |||
| 4d8c0a7f18 | |||
| 89218d6043 | |||
| c46e739db0 | |||
| a578f8084b | |||
| 24e4fee6f5 | |||
| 2107d0d6a3 | |||
| e733e566c8 | |||
| a3d360c6a2 | |||
| ae19a541b3 | |||
| 5935c741ab | |||
| 6185a5e4f6 | |||
| cc02637cc5 | |||
| 9c91d4e776 | |||
| 011c76ede6 | |||
| de4938c0bb | |||
| 9d59d0bbee | |||
| 3e64c75ebc | |||
| fa6b939fa7 | |||
| 354346840f | |||
| 8c9aacb712 | |||
| 66ecfd19fb | |||
| ae6aabb87e | |||
| 7a2b1ec8d7 | |||
| 2960142018 | |||
| 2dbe3e42d0 | |||
| 323efb5ffd | |||
| fdff68e528 | |||
| 0b43a40bc6 | |||
| c6311feb43 | |||
| fbb5141587 | |||
| dec9671f70 | |||
| a1302e953a | |||
| 82cbc6f6b0 | |||
| f303b71e94 | |||
| 1db6c6d77c | |||
| 4790013427 | |||
| 4624d82d9a | |||
| dc5fe5a3a7 | |||
| 33b2f61d61 | |||
| 951568b2c5 | |||
| f2361de0b6 | |||
| bafe0e3d14 | |||
| 1e276402b9 | |||
| 200c7393d6 | |||
| 789127c0e6 | |||
| 7214621068 | |||
| 66dfd14a98 | |||
| 4f54a2fa62 | |||
| 7391373de1 | |||
| ebd0f7d473 | |||
| ee53addbac | |||
| 8ad3217f8e | |||
| 7a13716d15 | |||
| 0647d46889 | |||
| 85d6948184 | |||
| 0690b7fdf4 | |||
| 8cd77c6565 | |||
| eb5b08346b | |||
| 5094d45f8c | |||
| b039d5dd86 | |||
| 184bf5e9fb | |||
| c2989e2530 | |||
| 40084a69cd | |||
| 4bf4207e14 | |||
| a440364a9d | |||
| e208675d59 | |||
| 794daa144d | |||
| 343653cad7 | |||
| f55d80a7b1 | |||
| be79544453 | |||
| bfe2bd7e72 | |||
| bea8cd649d | |||
| 427b24d066 | |||
| 2fa6932545 | |||
| 58eea2077c | |||
| 9d3fa3ac39 | |||
| bec47eff43 | |||
| f487a8fa17 | |||
| 1efc22a47d | |||
| 22dc7954c8 | |||
| 8aba5989c8 | |||
| 8c0678b52c | |||
| bfa86eff5b | |||
| 36a14f4644 | |||
| f3d2d9c63c | |||
| 1c0dc2e519 | |||
| 6884364369 | |||
| 9e110dfe78 | |||
| 7afbf66cd3 | |||
| bce190f0f3 | |||
| ceb113ed3d | |||
| 9d22e42d31 | |||
| 3ee00aa2e7 | |||
| b3c1864352 | |||
| 252d75257e | |||
| d8037ba621 | |||
| 083c55f2d7 | |||
| 3c7c146ebf | |||
| 5e99b1b7ba | |||
| 6afd859c27 | |||
| 4b5966376f | |||
| e10a8efdfb | |||
| 96df2843df | |||
| 5f9fbd6540 | |||
| c7c95f4015 | |||
| 7c165f0740 | |||
| 78de340a1a | |||
| 701f0b3ba5 | |||
| b926ea64d8 | |||
| 5c4f8a60f0 |
@@ -20,3 +20,6 @@ profile
|
||||
|
||||
# AppCode noise
|
||||
.idea/
|
||||
|
||||
# Ruby
|
||||
.ruby-version
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
language: objective-c
|
||||
xcode_workspace: MBProgressHUD.xcworkspace
|
||||
xcode_scheme: HudDemo
|
||||
xcode_sdk: iphonesimulator
|
||||
osx_image: xcode7.2
|
||||
script:
|
||||
- xctool -workspace MBProgressHUD.xcworkspace -scheme HudDemo -sdk iphonesimulator clean build
|
||||
- xctool -workspace MBProgressHUD.xcworkspace -scheme HudDemoTV -sdk iphonesimulator clean build
|
||||
- xctool -workspace MBProgressHUD.xcworkspace -scheme HudTests -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPad Air 2,OS=9.2" clean build test GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
**Version 1.0.0** @ 14.07.16
|
||||
|
||||
- Requires ARC and iOS 6+.
|
||||
- Includes a new default design for iOS 7+.
|
||||
- Deprecates certain helpers and exposes some more flexible API.
|
||||
- Removes KVO observing of local properties.
|
||||
- Migrates layout code to Auto Layout.
|
||||
- Includes a rewritten demo app.
|
||||
- Includes a rewritten iOS example app.
|
||||
- Updates and extends documentation.
|
||||
- Adds a new button property (cancellation support).
|
||||
- Adds support for `NSProgress`
|
||||
- Adds a new customizable background view class.
|
||||
- Adds new assertions.
|
||||
- Adds basic unit tests.
|
||||
- Adds support for motion effects.
|
||||
- Adds nullability.
|
||||
- Adds basic interface builder support.
|
||||
- Adds tvOS support.
|
||||
- Adds a simple tvOS example app.
|
||||
- Improves behavior when showing and hiding in quick succession.
|
||||
- Improves support for `UIAppearance `.
|
||||
- Various smaller bug-fixes
|
||||
|
||||
**Version 0.9.2** @ 22.12.15
|
||||
|
||||
- Timer improvements
|
||||
- Additional assertions
|
||||
- Added a framework target
|
||||
- Tint progress tint color enhancements
|
||||
|
||||
**Version 0.9.1** @ 06.03.15
|
||||
|
||||
- Bug-fixes
|
||||
- Modernization
|
||||
|
||||
**Version 0.9** @ 12.08.14
|
||||
|
||||
- iOS 8 compatibility and some bug fixes.
|
||||
- Additional iOS 7 / iOS 8 styling enhancements.
|
||||
- Improved 64bit support.
|
||||
- Demo modernization.
|
||||
|
||||
**Version 0.8** @ 19.09.13
|
||||
|
||||
- iOS 7 compatibility and some bug fixes.
|
||||
|
||||
**Version 0.7** @ 25.06.13
|
||||
|
||||
- Added horizontal bar mode. ([jjxtra](https://github.com/jjxtra)).
|
||||
- CI integration.
|
||||
|
||||
**Version 0.6** @ 13.03.13
|
||||
|
||||
- Full cocoapods support.
|
||||
- Static library integration option.
|
||||
- Improved blocks support.
|
||||
- Bezel color.
|
||||
- Demo app fixes (iOS 6).
|
||||
- Various bug-fixes and enhancements.
|
||||
|
||||
**Version 0.5** @ 22.03.12
|
||||
|
||||
- Major source code modernization and cleanup (KVO, layout code, instance vars, etc.).
|
||||
- New annular determinate mode.
|
||||
- New text only mode.
|
||||
- Added a static library project and Xcode 4 workspace.
|
||||
- Added methods to find and return HUD(s) on a view.
|
||||
- Various bug fixes.
|
||||
- Various demo project enhancements (hi-res rescues, new samples).
|
||||
|
||||
IMPORTANT: Requires LLVM 3+.
|
||||
|
||||
**Version 0.41** @ 03.01.12
|
||||
|
||||
- Support for ARC.
|
||||
|
||||
**Version 0.4** @ 25.07.10
|
||||
|
||||
- Different animation modes. Default set to zoom.
|
||||
- Class convenience methods ([tadelv](http://github.com/tadelv)).
|
||||
- Autorotation when added to a UIWindow ([wuf810](http://github.com/wuf810)).
|
||||
- Extended demo app.
|
||||
- Several smaller fixes.
|
||||
|
||||
**Version 0.33** @ 27.03.10
|
||||
|
||||
- Custom view operation mode added.
|
||||
- Fixed a memory leak.
|
||||
|
||||
**Version 0.32** @ 4.01.10
|
||||
|
||||
- Added minShowTime, graceTime, xOffset, yOffset.
|
||||
- Various fixes.
|
||||
|
||||
**Version 0.31** @ 8.10.09
|
||||
|
||||
- Fix for touch through during the fade-out animation.
|
||||
|
||||
**Version 0.3** @ 30.9.09
|
||||
|
||||
- Added show: and hide: methods.
|
||||
- Now using UIViews layoutSubviews to automate layout calls.
|
||||
- Added some floors to round pixel positions and thereby prevent unsharp views.
|
||||
- Some additional documentation and code cleanup.
|
||||
|
||||
**Version 0.2** @ 21.7.09
|
||||
|
||||
- Added determinate progress mode and switching capabilities between determinate and indeterminate modes.
|
||||
- Various bug-fixes.
|
||||
|
||||
**Version 0.11** @ 2.6.09.
|
||||
|
||||
- Updated labelText and detailsLabelText properties to support text modifications while the HUD is being shown.
|
||||
|
||||
**Version 0.1** @ 2.4.09
|
||||
|
||||
- Initial release.
|
||||
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// HudDemoAppDelegate.h
|
||||
// HudDemo
|
||||
//
|
||||
// Created by Matej Bukovinski on 2.4.09.
|
||||
// Copyright bukovinski.com 2009. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class HudDemoViewController;
|
||||
|
||||
|
||||
@interface HudDemoAppDelegate : NSObject <UIApplicationDelegate> {
|
||||
UIWindow *window;
|
||||
UINavigationController *navController;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIWindow *window;
|
||||
@property (nonatomic, retain) IBOutlet UINavigationController *navController;
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
//
|
||||
// HudDemoAppDelegate.m
|
||||
// HudDemo
|
||||
//
|
||||
// Created by Matej Bukovinski on 2.4.09.
|
||||
// Copyright bukovinski.com 2009. All rights reserved.
|
||||
//
|
||||
|
||||
#import "HudDemoAppDelegate.h"
|
||||
#import "HudDemoViewController.h"
|
||||
|
||||
|
||||
@implementation HudDemoAppDelegate
|
||||
|
||||
@synthesize window;
|
||||
@synthesize navController;
|
||||
|
||||
- (void)applicationDidFinishLaunching:(UIApplication *)application {
|
||||
window.rootViewController = navController;
|
||||
[window makeKeyAndVisible];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[navController release];
|
||||
[window release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,334 +0,0 @@
|
||||
//
|
||||
// HudDemoViewController.m
|
||||
// HudDemo
|
||||
//
|
||||
// Created by Matej Bukovinski on 30.9.09.
|
||||
// Copyright bukovinski.com 2009. All rights reserved.
|
||||
//
|
||||
|
||||
#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 - 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;
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
|
||||
UIView *content = [[self.view subviews] objectAtIndex:0];
|
||||
((UIScrollView *)self.view).contentSize = content.bounds.size;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_buttons release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#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)
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:HUD];
|
||||
|
||||
// Regiser for HUD callbacks so we can remove it from the window at the right time
|
||||
HUD.delegate = self;
|
||||
|
||||
// Show the HUD while the provided method executes in a new thread
|
||||
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)showWithLabel:(id)sender {
|
||||
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:HUD];
|
||||
|
||||
HUD.delegate = self;
|
||||
HUD.labelText = @"Loading";
|
||||
|
||||
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)showWithDetailsLabel:(id)sender {
|
||||
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:HUD];
|
||||
|
||||
HUD.delegate = self;
|
||||
HUD.labelText = @"Loading";
|
||||
HUD.detailsLabelText = @"updating data";
|
||||
HUD.square = YES;
|
||||
|
||||
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)showWithLabelDeterminate:(id)sender {
|
||||
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:HUD];
|
||||
|
||||
// Set determinate mode
|
||||
HUD.mode = MBProgressHUDModeDeterminate;
|
||||
|
||||
HUD.delegate = self;
|
||||
HUD.labelText = @"Loading";
|
||||
|
||||
// myProgressTask uses the HUD instance to update progress
|
||||
[HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)showWIthLabelAnnularDeterminate:(id)sender {
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:HUD];
|
||||
|
||||
// Set determinate mode
|
||||
HUD.mode = MBProgressHUDModeAnnularDeterminate;
|
||||
|
||||
HUD.delegate = self;
|
||||
HUD.labelText = @"Loading";
|
||||
|
||||
// myProgressTask uses the HUD instance to update progress
|
||||
[HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)showWithLabelDeterminateHorizontalBar:(id)sender {
|
||||
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:HUD];
|
||||
|
||||
// Set determinate bar mode
|
||||
HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
|
||||
|
||||
HUD.delegate = self;
|
||||
|
||||
// myProgressTask uses the HUD instance to update progress
|
||||
[HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)showWithCustomView:(id)sender {
|
||||
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:HUD];
|
||||
|
||||
// The sample image is based on the work by http://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];
|
||||
|
||||
// Set custom view mode
|
||||
HUD.mode = MBProgressHUDModeCustomView;
|
||||
|
||||
HUD.delegate = self;
|
||||
HUD.labelText = @"Completed";
|
||||
|
||||
[HUD show:YES];
|
||||
[HUD hide:YES afterDelay:3];
|
||||
}
|
||||
|
||||
- (IBAction)showWithLabelMixed:(id)sender {
|
||||
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:HUD];
|
||||
|
||||
HUD.delegate = self;
|
||||
HUD.labelText = @"Connecting";
|
||||
HUD.minSize = CGSizeMake(135.f, 135.f);
|
||||
|
||||
[HUD showWhileExecuting:@selector(myMixedTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)showUsingBlocks:(id)sender {
|
||||
#if NS_BLOCKS_AVAILABLE
|
||||
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:hud];
|
||||
hud.labelText = @"With a block";
|
||||
|
||||
[hud showAnimated:YES whileExecutingBlock:^{
|
||||
[self myTask];
|
||||
} completionBlock:^{
|
||||
[hud removeFromSuperview];
|
||||
[hud release];
|
||||
}];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (IBAction)showOnWindow:(id)sender {
|
||||
// The hud will dispable all input on the window
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.view.window];
|
||||
[self.view.window addSubview:HUD];
|
||||
|
||||
HUD.delegate = self;
|
||||
HUD.labelText = @"Loading";
|
||||
|
||||
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)showURL:(id)sender {
|
||||
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];
|
||||
[connection start];
|
||||
[connection release];
|
||||
|
||||
HUD = [[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES] retain];
|
||||
HUD.delegate = self;
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)showWithGradient:(id)sender {
|
||||
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:HUD];
|
||||
|
||||
HUD.dimBackground = YES;
|
||||
|
||||
// Regiser for HUD callbacks so we can remove it from the window at the right time
|
||||
HUD.delegate = self;
|
||||
|
||||
// Show the HUD while the provided method executes in a new thread
|
||||
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)showTextOnly:(id)sender {
|
||||
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Configure for text only and offset down
|
||||
hud.mode = MBProgressHUDModeText;
|
||||
hud.labelText = @"Some message...";
|
||||
hud.margin = 10.f;
|
||||
hud.removeFromSuperViewOnHide = YES;
|
||||
|
||||
[hud hide:YES afterDelay:3];
|
||||
}
|
||||
|
||||
- (IBAction)showWithColor:(id)sender{
|
||||
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
|
||||
[self.navigationController.view addSubview:HUD];
|
||||
|
||||
// Set the hud to display with a color
|
||||
HUD.color = [UIColor colorWithRed:0.23 green:0.50 blue:0.82 alpha:0.90];
|
||||
|
||||
HUD.delegate = self;
|
||||
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Execution code
|
||||
|
||||
- (void)myTask {
|
||||
// Do something usefull in here instead of sleeping ...
|
||||
sleep(3);
|
||||
}
|
||||
|
||||
- (void)myProgressTask {
|
||||
// This just increases the progress indicator in a loop
|
||||
float progress = 0.0f;
|
||||
while (progress < 1.0f) {
|
||||
progress += 0.01f;
|
||||
HUD.progress = progress;
|
||||
usleep(50000);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)myMixedTask {
|
||||
// Indeterminate mode
|
||||
sleep(2);
|
||||
// Switch to determinate mode
|
||||
HUD.mode = MBProgressHUDModeDeterminate;
|
||||
HUD.labelText = @"Progress";
|
||||
float progress = 0.0f;
|
||||
while (progress < 1.0f)
|
||||
{
|
||||
progress += 0.01f;
|
||||
HUD.progress = progress;
|
||||
usleep(50000);
|
||||
}
|
||||
// Back to indeterminate mode
|
||||
HUD.mode = MBProgressHUDModeIndeterminate;
|
||||
HUD.labelText = @"Cleaning up";
|
||||
sleep(2);
|
||||
// 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 - NSURLConnectionDelegete
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
|
||||
expectedLength = MAX([response expectedContentLength], 1);
|
||||
currentLength = 0;
|
||||
HUD.mode = MBProgressHUDModeDeterminate;
|
||||
}
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
|
||||
currentLength += [data length];
|
||||
HUD.progress = currentLength / (float)expectedLength;
|
||||
}
|
||||
|
||||
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
|
||||
HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease];
|
||||
HUD.mode = MBProgressHUDModeCustomView;
|
||||
[HUD hide:YES afterDelay:2];
|
||||
}
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
|
||||
[HUD hide:YES];
|
||||
}
|
||||
|
||||
#pragma mark - MBProgressHUDDelegate
|
||||
|
||||
- (void)hudWasHidden:(MBProgressHUD *)hud {
|
||||
// Remove HUD from screen when the HUD was hidded
|
||||
[HUD removeFromSuperview];
|
||||
[HUD release];
|
||||
HUD = nil;
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
[self setButtons:nil];
|
||||
[super viewDidUnload];
|
||||
}
|
||||
@end
|
||||
@@ -7,33 +7,28 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1D3623260D0F684500981E51 /* HudDemoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* HudDemoAppDelegate.m */; };
|
||||
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
|
||||
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
|
||||
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
|
||||
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 */; };
|
||||
5BE141EE1CD8C33D0023BC9E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BE141ED1CD8C33D0023BC9E /* QuartzCore.framework */; };
|
||||
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 */; };
|
||||
D286A6801518736B00E13FB8 /* 37x-Checkmark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D286A67F1518736B00E13FB8 /* 37x-Checkmark@2x.png */; };
|
||||
D286A7321518C53500E13FB8 /* HudDemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D286A7341518C53500E13FB8 /* HudDemoViewController.xib */; };
|
||||
D286A7361518C53C00E13FB8 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = D286A7381518C53C00E13FB8 /* MainWindow.xib */; };
|
||||
D274948B1D3B74AA00ABEB66 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D274948A1D3B74AA00ABEB66 /* Images.xcassets */; };
|
||||
D27F18451D3B5878009D7482 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D27F18441D3B5878009D7482 /* main.m */; };
|
||||
D27F18481D3B5878009D7482 /* MBHudDemoTVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D27F18471D3B5878009D7482 /* MBHudDemoTVAppDelegate.m */; };
|
||||
D27F184B1D3B5878009D7482 /* MBHudDemoTVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D27F184A1D3B5878009D7482 /* MBHudDemoTVViewController.m */; };
|
||||
D27F184E1D3B5878009D7482 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D27F184C1D3B5878009D7482 /* Main.storyboard */; };
|
||||
D27F18551D3B5AAF009D7482 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D22F7D800F85241C00550BB3 /* MBProgressHUD.m */; };
|
||||
D27F185A1D3B5DFF009D7482 /* MBHudDemoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D27F18581D3B5DFF009D7482 /* MBHudDemoAppDelegate.m */; };
|
||||
D27F185B1D3B5DFF009D7482 /* MBHudDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D27F18591D3B5DFF009D7482 /* MBHudDemoViewController.m */; };
|
||||
D27F185E1D3B5E0D009D7482 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D27F185D1D3B5E0D009D7482 /* main.m */; };
|
||||
D27F18631D3B5E21009D7482 /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D27F185F1D3B5E21009D7482 /* Launch.storyboard */; };
|
||||
D27F18641D3B5E21009D7482 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D27F18611D3B5E21009D7482 /* Main.storyboard */; };
|
||||
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 */; };
|
||||
D2B174121C5E3A3D00021915 /* HudTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B174111C5E3A3D00021915 /* HudTests.m */; };
|
||||
D2EEB3811B55967200F59EC1 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D2EEB3801B55967200F59EC1 /* Images.xcassets */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
D28CBB331A87A45A0052DCEC /* PBXContainerItemProxy */ = {
|
||||
D2B174141C5E3A3D00021915 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
proxyType = 1;
|
||||
@@ -44,35 +39,34 @@
|
||||
|
||||
/* 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>"; };
|
||||
1D3623250D0F684500981E51 /* HudDemoAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HudDemoAppDelegate.m; sourceTree = "<group>"; };
|
||||
1D6058910D05DD3D006BFB54 /* HudDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HudDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
28D7ACF60DDB3853001CB0EB /* HudDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HudDemoViewController.h; sourceTree = "<group>"; };
|
||||
28D7ACF70DDB3853001CB0EB /* HudDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HudDemoViewController.m; sourceTree = "<group>"; usesTabs = 1; };
|
||||
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
5BE141ED1CD8C33D0023BC9E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
D286A67F1518736B00E13FB8 /* 37x-Checkmark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "37x-Checkmark@2x.png"; path = "Images/37x-Checkmark@2x.png"; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
D274948A1D3B74AA00ABEB66 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
D27F18411D3B5878009D7482 /* HudDemoTV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HudDemoTV.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D27F18441D3B5878009D7482 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
D27F18461D3B5878009D7482 /* MBHudDemoTVAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBHudDemoTVAppDelegate.h; sourceTree = "<group>"; };
|
||||
D27F18471D3B5878009D7482 /* MBHudDemoTVAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBHudDemoTVAppDelegate.m; sourceTree = "<group>"; };
|
||||
D27F18491D3B5878009D7482 /* MBHudDemoTVViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBHudDemoTVViewController.h; sourceTree = "<group>"; };
|
||||
D27F184A1D3B5878009D7482 /* MBHudDemoTVViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBHudDemoTVViewController.m; sourceTree = "<group>"; };
|
||||
D27F184D1D3B5878009D7482 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
D27F18511D3B5878009D7482 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
D27F18561D3B5DFF009D7482 /* MBHudDemoAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MBHudDemoAppDelegate.h; path = HudDemo/MBHudDemoAppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
D27F18571D3B5DFF009D7482 /* MBHudDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MBHudDemoViewController.h; path = HudDemo/MBHudDemoViewController.h; sourceTree = SOURCE_ROOT; };
|
||||
D27F18581D3B5DFF009D7482 /* MBHudDemoAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MBHudDemoAppDelegate.m; path = HudDemo/MBHudDemoAppDelegate.m; sourceTree = SOURCE_ROOT; };
|
||||
D27F18591D3B5DFF009D7482 /* MBHudDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MBHudDemoViewController.m; path = HudDemo/MBHudDemoViewController.m; sourceTree = SOURCE_ROOT; };
|
||||
D27F185C1D3B5E0D009D7482 /* HudDemo_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HudDemo_Prefix.pch; path = HudDemo/HudDemo_Prefix.pch; sourceTree = "<group>"; };
|
||||
D27F185D1D3B5E0D009D7482 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HudDemo/main.m; sourceTree = "<group>"; };
|
||||
D27F18601D3B5E21009D7482 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = HudDemo/en.lproj/Launch.storyboard; sourceTree = "<group>"; };
|
||||
D27F18621D3B5E21009D7482 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = HudDemo/en.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
D27F18651D3B5E2D009D7482 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HudDemo/Info.plist; 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>"; };
|
||||
D2B1740F1C5E3A3D00021915 /* HudTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HudTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D2B174111C5E3A3D00021915 /* HudTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HudTests.m; sourceTree = "<group>"; };
|
||||
D2B174131C5E3A3D00021915 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
D2EEB3801B55967200F59EC1 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HudDemo/Images.xcassets; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -80,13 +74,21 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5BE141EE1CD8C33D0023BC9E /* QuartzCore.framework in Frameworks */,
|
||||
D286A76D1518CA9F00E13FB8 /* CoreGraphics.framework in Frameworks */,
|
||||
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
|
||||
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D28CBB2A1A87A45A0052DCEC /* Frameworks */ = {
|
||||
D27F183E1D3B5878009D7482 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D2B1740C1C5E3A3D00021915 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -99,10 +101,10 @@
|
||||
080E96DDFE201D6D7F000001 /* HudDemo */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D3623240D0F684500981E51 /* HudDemoAppDelegate.h */,
|
||||
1D3623250D0F684500981E51 /* HudDemoAppDelegate.m */,
|
||||
28D7ACF60DDB3853001CB0EB /* HudDemoViewController.h */,
|
||||
28D7ACF70DDB3853001CB0EB /* HudDemoViewController.m */,
|
||||
D27F18561D3B5DFF009D7482 /* MBHudDemoAppDelegate.h */,
|
||||
D27F18571D3B5DFF009D7482 /* MBHudDemoViewController.h */,
|
||||
D27F18581D3B5DFF009D7482 /* MBHudDemoAppDelegate.m */,
|
||||
D27F18591D3B5DFF009D7482 /* MBHudDemoViewController.m */,
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
);
|
||||
@@ -114,7 +116,8 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D6058910D05DD3D006BFB54 /* HudDemo.app */,
|
||||
D28CBB2D1A87A45A0052DCEC /* HudTests.xctest */,
|
||||
D2B1740F1C5E3A3D00021915 /* HudTests.xctest */,
|
||||
D27F18411D3B5878009D7482 /* HudDemoTV.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -123,7 +126,8 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
080E96DDFE201D6D7F000001 /* HudDemo */,
|
||||
D28CBB2E1A87A45A0052DCEC /* HudTests */,
|
||||
D27F18421D3B5878009D7482 /* HudDemoTV */,
|
||||
D2B174101C5E3A3D00021915 /* HudTests */,
|
||||
D28CBB391A87A6B00052DCEC /* MBProgressHUD */,
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */,
|
||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||
@@ -134,8 +138,8 @@
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
32CA4F630368D1EE00C91783 /* HudDemo_Prefix.pch */,
|
||||
29B97316FDCFA39411CA2CEA /* main.m */,
|
||||
D27F185C1D3B5E0D009D7482 /* HudDemo_Prefix.pch */,
|
||||
D27F185D1D3B5E0D009D7482 /* main.m */,
|
||||
);
|
||||
name = "Other Sources";
|
||||
path = ..;
|
||||
@@ -144,9 +148,9 @@
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D27F18651D3B5E2D009D7482 /* Info.plist */,
|
||||
D277FDBF11FC880100304321 /* UI */,
|
||||
D277FDBD11FC879500304321 /* Images */,
|
||||
8D1107310486CEB800E47090 /* Info.plist */,
|
||||
D2EEB3801B55967200F59EC1 /* Images.xcassets */,
|
||||
);
|
||||
name = Resources;
|
||||
path = ..;
|
||||
@@ -155,6 +159,7 @@
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5BE141ED1CD8C33D0023BC9E /* QuartzCore.framework */,
|
||||
D286A76C1518CA9F00E13FB8 /* CoreGraphics.framework */,
|
||||
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
|
||||
1D30AB110D05D00D00671497 /* Foundation.framework */,
|
||||
@@ -162,49 +167,44 @@
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D277FDBD11FC879500304321 /* Images */ = {
|
||||
isa = PBXGroup;
|
||||
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 */,
|
||||
);
|
||||
name = Images;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D277FDBF11FC880100304321 /* UI */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D286A7341518C53500E13FB8 /* HudDemoViewController.xib */,
|
||||
D286A7381518C53C00E13FB8 /* MainWindow.xib */,
|
||||
D27F185F1D3B5E21009D7482 /* Launch.storyboard */,
|
||||
D27F18611D3B5E21009D7482 /* Main.storyboard */,
|
||||
);
|
||||
name = UI;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D28CBB2E1A87A45A0052DCEC /* HudTests */ = {
|
||||
D27F18421D3B5878009D7482 /* HudDemoTV */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D28CBB311A87A45A0052DCEC /* HudTests.m */,
|
||||
D28CBB2F1A87A45A0052DCEC /* Supporting Files */,
|
||||
D27F18461D3B5878009D7482 /* MBHudDemoTVAppDelegate.h */,
|
||||
D27F18471D3B5878009D7482 /* MBHudDemoTVAppDelegate.m */,
|
||||
D27F18491D3B5878009D7482 /* MBHudDemoTVViewController.h */,
|
||||
D27F184A1D3B5878009D7482 /* MBHudDemoTVViewController.m */,
|
||||
D27F18431D3B5878009D7482 /* Other Sources */,
|
||||
D27F18671D3B5E43009D7482 /* Resources */,
|
||||
);
|
||||
path = HudTests;
|
||||
path = HudDemoTV;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D28CBB2F1A87A45A0052DCEC /* Supporting Files */ = {
|
||||
D27F18431D3B5878009D7482 /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D28CBB301A87A45A0052DCEC /* Info.plist */,
|
||||
D27F18441D3B5878009D7482 /* main.m */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
name = "Other Sources";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D27F18671D3B5E43009D7482 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D27F184C1D3B5878009D7482 /* Main.storyboard */,
|
||||
D27F18511D3B5878009D7482 /* Info.plist */,
|
||||
D274948A1D3B74AA00ABEB66 /* Images.xcassets */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D28CBB391A87A6B00052DCEC /* MBProgressHUD */ = {
|
||||
@@ -216,6 +216,15 @@
|
||||
name = MBProgressHUD;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D2B174101C5E3A3D00021915 /* HudTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D2B174111C5E3A3D00021915 /* HudTests.m */,
|
||||
D2B174131C5E3A3D00021915 /* Info.plist */,
|
||||
);
|
||||
path = HudTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -236,22 +245,39 @@
|
||||
productReference = 1D6058910D05DD3D006BFB54 /* HudDemo.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
D28CBB2C1A87A45A0052DCEC /* HudTests */ = {
|
||||
D27F18401D3B5878009D7482 /* HudDemoTV */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = D28CBB351A87A45A0052DCEC /* Build configuration list for PBXNativeTarget "HudTests" */;
|
||||
buildConfigurationList = D27F18541D3B5878009D7482 /* Build configuration list for PBXNativeTarget "HudDemoTV" */;
|
||||
buildPhases = (
|
||||
D28CBB291A87A45A0052DCEC /* Sources */,
|
||||
D28CBB2A1A87A45A0052DCEC /* Frameworks */,
|
||||
D28CBB2B1A87A45A0052DCEC /* Resources */,
|
||||
D27F183D1D3B5878009D7482 /* Sources */,
|
||||
D27F183E1D3B5878009D7482 /* Frameworks */,
|
||||
D27F183F1D3B5878009D7482 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
D28CBB341A87A45A0052DCEC /* PBXTargetDependency */,
|
||||
);
|
||||
name = HudDemoTV;
|
||||
productName = HudDemoTV;
|
||||
productReference = D27F18411D3B5878009D7482 /* HudDemoTV.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
D2B1740E1C5E3A3D00021915 /* HudTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = D2B174161C5E3A3D00021915 /* Build configuration list for PBXNativeTarget "HudTests" */;
|
||||
buildPhases = (
|
||||
D2B1740B1C5E3A3D00021915 /* Sources */,
|
||||
D2B1740C1C5E3A3D00021915 /* Frameworks */,
|
||||
D2B1740D1C5E3A3D00021915 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
D2B174151C5E3A3D00021915 /* PBXTargetDependency */,
|
||||
);
|
||||
name = HudTests;
|
||||
productName = HudTests;
|
||||
productReference = D28CBB2D1A87A45A0052DCEC /* HudTests.xctest */;
|
||||
productReference = D2B1740F1C5E3A3D00021915 /* HudTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
@@ -264,8 +290,11 @@
|
||||
LastUpgradeCheck = 0720;
|
||||
ORGANIZATIONNAME = "Matej Bukovinski";
|
||||
TargetAttributes = {
|
||||
D28CBB2C1A87A45A0052DCEC = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
D27F18401D3B5878009D7482 = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
};
|
||||
D2B1740E1C5E3A3D00021915 = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
TestTargetID = 1D6058900D05DD3D006BFB54;
|
||||
};
|
||||
};
|
||||
@@ -279,13 +308,16 @@
|
||||
Japanese,
|
||||
French,
|
||||
German,
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
1D6058900D05DD3D006BFB54 /* HudDemo */,
|
||||
D28CBB2C1A87A45A0052DCEC /* HudTests */,
|
||||
D27F18401D3B5878009D7482 /* HudDemoTV */,
|
||||
D2B1740E1C5E3A3D00021915 /* HudTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@@ -295,24 +327,22 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D286A7361518C53C00E13FB8 /* MainWindow.xib in Resources */,
|
||||
D286A7321518C53500E13FB8 /* HudDemoViewController.xib in Resources */,
|
||||
D2F88CD6115E9F7F00E6DB82 /* 37x-Checkmark.png in Resources */,
|
||||
D277FDB311FC834200304321 /* Default.png in Resources */,
|
||||
D277FDB911FC877E00304321 /* Icon.png in Resources */,
|
||||
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 */,
|
||||
D27F18641D3B5E21009D7482 /* Main.storyboard in Resources */,
|
||||
D2EEB3811B55967200F59EC1 /* Images.xcassets in Resources */,
|
||||
D27F18631D3B5E21009D7482 /* Launch.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D28CBB2B1A87A45A0052DCEC /* Resources */ = {
|
||||
D27F183F1D3B5878009D7482 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D27F184E1D3B5878009D7482 /* Main.storyboard in Resources */,
|
||||
D274948B1D3B74AA00ABEB66 /* Images.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D2B1740D1C5E3A3D00021915 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -326,47 +356,65 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
|
||||
1D3623260D0F684500981E51 /* HudDemoAppDelegate.m in Sources */,
|
||||
28D7ACF80DDB3853001CB0EB /* HudDemoViewController.m in Sources */,
|
||||
D27F185B1D3B5DFF009D7482 /* MBHudDemoViewController.m in Sources */,
|
||||
D22F7D810F85241C00550BB3 /* MBProgressHUD.m in Sources */,
|
||||
D27F185E1D3B5E0D009D7482 /* main.m in Sources */,
|
||||
D27F185A1D3B5DFF009D7482 /* MBHudDemoAppDelegate.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D28CBB291A87A45A0052DCEC /* Sources */ = {
|
||||
D27F183D1D3B5878009D7482 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D28CBB321A87A45A0052DCEC /* HudTests.m in Sources */,
|
||||
D28CBB381A87A4A10052DCEC /* MBProgressHUD.m in Sources */,
|
||||
D27F184B1D3B5878009D7482 /* MBHudDemoTVViewController.m in Sources */,
|
||||
D27F18481D3B5878009D7482 /* MBHudDemoTVAppDelegate.m in Sources */,
|
||||
D27F18451D3B5878009D7482 /* main.m in Sources */,
|
||||
D27F18551D3B5AAF009D7482 /* MBProgressHUD.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D2B1740B1C5E3A3D00021915 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D2B174121C5E3A3D00021915 /* HudTests.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
D28CBB341A87A45A0052DCEC /* PBXTargetDependency */ = {
|
||||
D2B174151C5E3A3D00021915 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 1D6058900D05DD3D006BFB54 /* HudDemo */;
|
||||
targetProxy = D28CBB331A87A45A0052DCEC /* PBXContainerItemProxy */;
|
||||
targetProxy = D2B174141C5E3A3D00021915 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
D286A7341518C53500E13FB8 /* HudDemoViewController.xib */ = {
|
||||
D27F184C1D3B5878009D7482 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
D286A7331518C53500E13FB8 /* en */,
|
||||
D27F184D1D3B5878009D7482 /* Base */,
|
||||
);
|
||||
name = HudDemoViewController.xib;
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D286A7381518C53C00E13FB8 /* MainWindow.xib */ = {
|
||||
D27F185F1D3B5E21009D7482 /* Launch.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
D286A7371518C53C00E13FB8 /* en */,
|
||||
D27F18601D3B5E21009D7482 /* en */,
|
||||
);
|
||||
name = MainWindow.xib;
|
||||
name = Launch.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D27F18611D3B5E21009D7482 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
D27F18621D3B5E21009D7482 /* en */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
@@ -376,12 +424,14 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = HudDemo_Prefix.pch;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
GCC_PREFIX_HEADER = HudDemo/HudDemo_Prefix.pch;
|
||||
INFOPLIST_FILE = HudDemo/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.bukovinski.${PRODUCT_NAME:identifier}";
|
||||
PRODUCT_NAME = HudDemo;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
@@ -392,10 +442,12 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = HudDemo_Prefix.pch;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
GCC_PREFIX_HEADER = HudDemo/HudDemo_Prefix.pch;
|
||||
INFOPLIST_FILE = HudDemo/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.bukovinski.${PRODUCT_NAME:identifier}";
|
||||
PRODUCT_NAME = HudDemo;
|
||||
SDKROOT = iphoneos;
|
||||
@@ -406,6 +458,7 @@
|
||||
C01FCF4F08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
@@ -425,7 +478,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
@@ -434,6 +487,7 @@
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
@@ -452,27 +506,23 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
D28CBB361A87A45A0052DCEC /* Debug */ = {
|
||||
D27F18521D3B5878009D7482 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
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)",
|
||||
);
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
@@ -480,20 +530,48 @@
|
||||
"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";
|
||||
INFOPLIST_FILE = HudDemoTV/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.bukovinski.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.bukovinski.HudDemoTV;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HudDemo.app/HudDemo";
|
||||
SDKROOT = appletvos;
|
||||
TARGETED_DEVICE_FAMILY = 3;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
D28CBB371A87A45A0052DCEC /* Release */ = {
|
||||
D27F18531D3B5878009D7482 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = HudDemoTV/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.bukovinski.HudDemoTV;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
TARGETED_DEVICE_FAMILY = 3;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
D2B174171C5E3A3D00021915 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
@@ -501,23 +579,50 @@
|
||||
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",
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = HudTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.bukovinski.HudTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HudDemo.app/HudDemo";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
D2B174181C5E3A3D00021915 /* 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_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
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;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
|
||||
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_BUNDLE_IDENTIFIER = com.bukovinski.HudTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HudDemo.app/HudDemo";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
@@ -545,11 +650,20 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
D28CBB351A87A45A0052DCEC /* Build configuration list for PBXNativeTarget "HudTests" */ = {
|
||||
D27F18541D3B5878009D7482 /* Build configuration list for PBXNativeTarget "HudDemoTV" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
D28CBB361A87A45A0052DCEC /* Debug */,
|
||||
D28CBB371A87A45A0052DCEC /* Release */,
|
||||
D27F18521D3B5878009D7482 /* Debug */,
|
||||
D27F18531D3B5878009D7482 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
D2B174161C5E3A3D00021915 /* Build configuration list for PBXNativeTarget "HudTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
D2B174171C5E3A3D00021915 /* Debug */,
|
||||
D2B174181C5E3A3D00021915 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D28CBB2C1A87A45A0052DCEC"
|
||||
BlueprintIdentifier = "D2B1740E1C5E3A3D00021915"
|
||||
BuildableName = "HudTests.xctest"
|
||||
BlueprintName = "HudTests"
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
@@ -42,16 +42,6 @@
|
||||
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
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0730"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D27F18401D3B5878009D7482"
|
||||
BuildableName = "HudDemoTV.app"
|
||||
BlueprintName = "HudDemoTV"
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D27F18401D3B5878009D7482"
|
||||
BuildableName = "HudDemoTV.app"
|
||||
BlueprintName = "HudDemoTV"
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<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">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D27F18401D3B5878009D7482"
|
||||
BuildableName = "HudDemoTV.app"
|
||||
BlueprintName = "HudDemoTV"
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D27F18401D3B5878009D7482"
|
||||
BuildableName = "HudDemoTV.app"
|
||||
BlueprintName = "HudDemoTV"
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D2B1740E1C5E3A3D00021915"
|
||||
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.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
|
||||
BuildableName = "HudDemo.app"
|
||||
BlueprintName = "HudDemo"
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
|
||||
BuildableName = "HudDemo.app"
|
||||
BlueprintName = "HudDemo"
|
||||
ReferencedContainer = "container:HudDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,128 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-Small.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-Small@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-Small@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-Small-40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-Small-40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small-1.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small-40.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small-40@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "50x50",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small-50.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "50x50",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small-50@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "72x72",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-72.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "72x72",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-72@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-76.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-167.png",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 460 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 458 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 456 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Checkmark.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Checkmark@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Checkmark@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -8,15 +8,10 @@
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<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>CFBundleIcons</key>
|
||||
<dict/>
|
||||
<key>CFBundleIcons~ipad</key>
|
||||
<dict/>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
@@ -33,8 +28,6 @@
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainWindow</string>
|
||||
<key>UILaunchImages</key>
|
||||
<array>
|
||||
<dict>
|
||||
@@ -59,7 +52,9 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>MainWindow</string>
|
||||
<string>Launch</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// MBHudDemoAppDelegate.h
|
||||
// HudDemo
|
||||
//
|
||||
// Created by Matej Bukovinski on 2.4.09.
|
||||
// Copyright © 2009-2016 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MBHudDemoAppDelegate : NSObject <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// MBHudDemoAppDelegate.m
|
||||
// HudDemo
|
||||
//
|
||||
// Created by Matej Bukovinski on 2.4.09.
|
||||
// Copyright © 2009-2016 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MBHudDemoAppDelegate.h"
|
||||
#import "MBHudDemoViewController.h"
|
||||
|
||||
|
||||
@implementation MBHudDemoAppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
self.window.tintColor = [UIColor colorWithRed:.337f green:.57f blue:.731f alpha:1.f];
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -3,12 +3,12 @@
|
||||
// HudDemo
|
||||
//
|
||||
// Created by Matej Bukovinski on 30.9.09.
|
||||
// Copyright bukovinski.com 2009. All rights reserved.
|
||||
// Copyright © 2009-2016 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
@interface HudDemoViewController : UIViewController
|
||||
@interface MBHudDemoViewController : UITableViewController
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,451 @@
|
||||
//
|
||||
// MBHudDemoViewController.m
|
||||
// HudDemo
|
||||
//
|
||||
// Created by Matej Bukovinski on 30.9.09.
|
||||
// Copyright © 2009-2016 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MBHudDemoViewController.h"
|
||||
#import "MBProgressHUD.h"
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@interface MBExample : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString *title;
|
||||
@property (nonatomic, assign) SEL selector;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation MBExample
|
||||
|
||||
+ (instancetype)exampleWithTitle:(NSString *)title selector:(SEL)selector {
|
||||
MBExample *example = [[self class] new];
|
||||
example.title = title;
|
||||
example.selector = selector;
|
||||
return example;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface MBHudDemoViewController () <NSURLSessionDelegate>
|
||||
|
||||
@property (nonatomic, strong) NSArray<NSArray<MBExample *> *> *examples;
|
||||
// Atomic, because it may be cancelled from main thread, flag is read on a background thread
|
||||
@property (atomic, assign) BOOL canceled;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation MBHudDemoViewController
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
self.examples =
|
||||
@[@[[MBExample exampleWithTitle:@"Indeterminate mode" selector:@selector(indeterminateExample)],
|
||||
[MBExample exampleWithTitle:@"With label" selector:@selector(labelExample)],
|
||||
[MBExample exampleWithTitle:@"With details label" selector:@selector(detailsLabelExample)]],
|
||||
@[[MBExample exampleWithTitle:@"Determinate mode" selector:@selector(determinateExample)],
|
||||
[MBExample exampleWithTitle:@"Annular determinate mode" selector:@selector(annularDeterminateExample)],
|
||||
[MBExample exampleWithTitle:@"Bar determinate mode" selector:@selector(barDeterminateExample)]],
|
||||
@[[MBExample exampleWithTitle:@"Text only" selector:@selector(textExample)],
|
||||
[MBExample exampleWithTitle:@"Custom view" selector:@selector(customViewExample)],
|
||||
[MBExample exampleWithTitle:@"With action button" selector:@selector(cancelationExample)],
|
||||
[MBExample exampleWithTitle:@"Mode switching" selector:@selector(modeSwitchingExample)]],
|
||||
@[[MBExample exampleWithTitle:@"On window" selector:@selector(indeterminateExample)],
|
||||
[MBExample exampleWithTitle:@"NSURLSession" selector:@selector(networkingExample)],
|
||||
[MBExample exampleWithTitle:@"Determinate with NSProgress" selector:@selector(determinateNSProgressExample)],
|
||||
[MBExample exampleWithTitle:@"Dim background" selector:@selector(dimBackgroundExample)],
|
||||
[MBExample exampleWithTitle:@"Colored" selector:@selector(colorExample)]]
|
||||
];
|
||||
}
|
||||
|
||||
#pragma mark - Examples
|
||||
|
||||
- (void)indeterminateExample {
|
||||
// Show the HUD on the root view (self.view is a scrollable table view and thus not suitable,
|
||||
// as the HUD would move with the content as we scroll).
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Fire off an asynchronous task, giving UIKit the opportunity to redraw wit the HUD added to the
|
||||
// view hierarchy.
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
|
||||
// Do something useful in the background
|
||||
[self doSomeWork];
|
||||
|
||||
// IMPORTANT - Dispatch back to the main thread. Always access UI
|
||||
// classes (including MBProgressHUD) on the main thread.
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)labelExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set the label text.
|
||||
hud.label.text = NSLocalizedString(@"Loading...", @"HUD loading title");
|
||||
// You can also adjust other label properties if needed.
|
||||
// hud.label.font = [UIFont italicSystemFontOfSize:16.f];
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
[self doSomeWork];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)detailsLabelExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set the label text.
|
||||
hud.label.text = NSLocalizedString(@"Loading...", @"HUD loading title");
|
||||
// Set the details label text. Let's make it multiline this time.
|
||||
hud.detailsLabel.text = NSLocalizedString(@"Parsing data\n(1/1)", @"HUD title");
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
[self doSomeWork];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)windowExample {
|
||||
// Covers the entire screen. Similar to using the root view controller view.
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
[self doSomeWork];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)determinateExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set the determinate mode to show task progress.
|
||||
hud.mode = MBProgressHUDModeDeterminate;
|
||||
hud.label.text = NSLocalizedString(@"Loading...", @"HUD loading title");
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
// Do something useful in the background and update the HUD periodically.
|
||||
[self doSomeWorkWithProgress];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)determinateNSProgressExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set the determinate mode to show task progress.
|
||||
hud.mode = MBProgressHUDModeDeterminate;
|
||||
hud.label.text = NSLocalizedString(@"Loading...", @"HUD loading title");
|
||||
|
||||
// Set up NSProgress
|
||||
NSProgress *progressObject = [NSProgress progressWithTotalUnitCount:100];
|
||||
hud.progressObject = progressObject;
|
||||
|
||||
// Configure a cancel button.
|
||||
[hud.button setTitle:NSLocalizedString(@"Cancel", @"HUD cancel button title") forState:UIControlStateNormal];
|
||||
[hud.button addTarget:progressObject action:@selector(cancel) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
// Do something useful in the background and update the HUD periodically.
|
||||
[self doSomeWorkWithProgressObject:progressObject];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)annularDeterminateExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set the annular determinate mode to show task progress.
|
||||
hud.mode = MBProgressHUDModeAnnularDeterminate;
|
||||
hud.label.text = NSLocalizedString(@"Loading...", @"HUD loading title");
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
// Do something useful in the background and update the HUD periodically.
|
||||
[self doSomeWorkWithProgress];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)barDeterminateExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set the bar determinate mode to show task progress.
|
||||
hud.mode = MBProgressHUDModeDeterminateHorizontalBar;
|
||||
hud.label.text = NSLocalizedString(@"Loading...", @"HUD loading title");
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
// Do something useful in the background and update the HUD periodically.
|
||||
[self doSomeWorkWithProgress];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)customViewExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set the custom view mode to show any view.
|
||||
hud.mode = MBProgressHUDModeCustomView;
|
||||
// Set an image view with a checkmark.
|
||||
UIImage *image = [[UIImage imageNamed:@"Checkmark"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
||||
hud.customView = [[UIImageView alloc] initWithImage:image];
|
||||
// Looks a bit nicer if we make it square.
|
||||
hud.square = YES;
|
||||
// Optional label text.
|
||||
hud.label.text = NSLocalizedString(@"Done", @"HUD done title");
|
||||
|
||||
[hud hideAnimated:YES afterDelay:3.f];
|
||||
}
|
||||
|
||||
- (void)textExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set the text mode to show only text.
|
||||
hud.mode = MBProgressHUDModeText;
|
||||
hud.label.text = NSLocalizedString(@"Message here!", @"HUD message title");
|
||||
// Move to bottm center.
|
||||
hud.offset = CGPointMake(0.f, MBProgressMaxOffset);
|
||||
|
||||
[hud hideAnimated:YES afterDelay:3.f];
|
||||
}
|
||||
|
||||
- (void)cancelationExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set the determinate mode to show task progress.
|
||||
hud.mode = MBProgressHUDModeDeterminate;
|
||||
hud.label.text = NSLocalizedString(@"Loading...", @"HUD loading title");
|
||||
|
||||
// Configure the button.
|
||||
[hud.button setTitle:NSLocalizedString(@"Cancel", @"HUD cancel button title") forState:UIControlStateNormal];
|
||||
[hud.button addTarget:self action:@selector(cancelWork:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
// Do something useful in the background and update the HUD periodically.
|
||||
[self doSomeWorkWithProgress];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)modeSwitchingExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set some text to show the initial status.
|
||||
hud.label.text = NSLocalizedString(@"Preparing...", @"HUD preparing title");
|
||||
// Will look best, if we set a minimum size.
|
||||
hud.minSize = CGSizeMake(150.f, 100.f);
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
// Do something useful in the background and update the HUD periodically.
|
||||
[self doSomeWorkWithMixedProgress];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)networkingExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Set some text to show the initial status.
|
||||
hud.label.text = NSLocalizedString(@"Preparing...", @"HUD preparing title");
|
||||
// Will look best, if we set a minimum size.
|
||||
hud.minSize = CGSizeMake(150.f, 100.f);
|
||||
|
||||
[self doSomeNetworkWorkWithProgress];
|
||||
}
|
||||
|
||||
- (void)dimBackgroundExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
|
||||
// Change the background view style and color.
|
||||
hud.backgroundView.style = MBProgressHUDBackgroundStyleSolidColor;
|
||||
hud.backgroundView.color = [UIColor colorWithWhite:0.f alpha:0.1f];
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
[self doSomeWork];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)colorExample {
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
|
||||
hud.contentColor = [UIColor colorWithRed:0.f green:0.6f blue:0.7f alpha:1.f];
|
||||
|
||||
// Set the label text.
|
||||
hud.label.text = NSLocalizedString(@"Loading...", @"HUD loading title");
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
[self doSomeWork];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark - Tasks
|
||||
|
||||
- (void)doSomeWork {
|
||||
// Simulate by just waiting.
|
||||
sleep(3.);
|
||||
}
|
||||
|
||||
- (void)doSomeWorkWithProgressObject:(NSProgress *)progressObject {
|
||||
// This just increases the progress indicator in a loop.
|
||||
while (progressObject.fractionCompleted < 1.0f) {
|
||||
if (progressObject.isCancelled) break;
|
||||
[progressObject becomeCurrentWithPendingUnitCount:1];
|
||||
[progressObject resignCurrent];
|
||||
usleep(50000);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)doSomeWorkWithProgress {
|
||||
self.canceled = NO;
|
||||
// This just increases the progress indicator in a loop.
|
||||
float progress = 0.0f;
|
||||
while (progress < 1.0f) {
|
||||
if (self.canceled) break;
|
||||
progress += 0.01f;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// Instead we could have also passed a reference to the HUD
|
||||
// to the HUD to myProgressTask as a method parameter.
|
||||
[MBProgressHUD HUDForView:self.navigationController.view].progress = progress;
|
||||
});
|
||||
usleep(50000);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)doSomeWorkWithMixedProgress {
|
||||
MBProgressHUD *hud = [MBProgressHUD HUDForView:self.navigationController.view];
|
||||
// Indeterminate mode
|
||||
sleep(2);
|
||||
// Switch to determinate mode
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
hud.mode = MBProgressHUDModeDeterminate;
|
||||
hud.label.text = NSLocalizedString(@"Loading...", @"HUD loading title");
|
||||
});
|
||||
float progress = 0.0f;
|
||||
while (progress < 1.0f) {
|
||||
progress += 0.01f;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
hud.progress = progress;
|
||||
});
|
||||
usleep(50000);
|
||||
}
|
||||
// Back to indeterminate mode
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
hud.mode = MBProgressHUDModeIndeterminate;
|
||||
hud.label.text = NSLocalizedString(@"Cleaning up...", @"HUD cleanining up title");
|
||||
});
|
||||
sleep(2);
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
UIImage *image = [[UIImage imageNamed:@"Checkmark"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
||||
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
|
||||
hud.customView = imageView;
|
||||
hud.mode = MBProgressHUDModeCustomView;
|
||||
hud.label.text = NSLocalizedString(@"Completed", @"HUD completed title");
|
||||
});
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
- (void)doSomeNetworkWorkWithProgress {
|
||||
NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
NSURLSession *session = [NSURLSession sessionWithConfiguration:sessionConfig delegate:self delegateQueue:nil];
|
||||
NSURL *URL = [NSURL URLWithString:@"https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1425/sample_iPod.m4v.zip"];
|
||||
NSURLSessionDownloadTask *task = [session downloadTaskWithURL:URL];
|
||||
[task resume];
|
||||
}
|
||||
|
||||
- (void)cancelWork:(id)sender {
|
||||
self.canceled = YES;
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return self.examples.count;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.examples[section].count;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
MBExample *example = self.examples[indexPath.section][indexPath.row];
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MBExampleCell" forIndexPath:indexPath];
|
||||
cell.textLabel.text = example.title;
|
||||
cell.textLabel.textColor = self.view.tintColor;
|
||||
cell.textLabel.textAlignment = NSTextAlignmentCenter;
|
||||
cell.selectedBackgroundView = [UIView new];
|
||||
cell.selectedBackgroundView.backgroundColor = [cell.textLabel.textColor colorWithAlphaComponent:0.1f];
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
MBExample *example = self.examples[indexPath.section][indexPath.row];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
||||
[self performSelector:example.selector];
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark - NSURLSessionDelegate
|
||||
|
||||
- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location {
|
||||
// Do something with the data at location...
|
||||
|
||||
// Update the UI on the main thread
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
MBProgressHUD *hud = [MBProgressHUD HUDForView:self.navigationController.view];
|
||||
UIImage *image = [[UIImage imageNamed:@"Checkmark"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
||||
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
|
||||
hud.customView = imageView;
|
||||
hud.mode = MBProgressHUDModeCustomView;
|
||||
hud.label.text = NSLocalizedString(@"Completed", @"HUD completed title");
|
||||
[hud hideAnimated:YES afterDelay:3.f];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {
|
||||
float progress = (float)totalBytesWritten / (float)totalBytesExpectedToWrite;
|
||||
|
||||
// Update the UI on the main thread
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
MBProgressHUD *hud = [MBProgressHUD HUDForView:self.navigationController.view];
|
||||
hud.mode = MBProgressHUDModeDeterminate;
|
||||
hud.progress = progress;
|
||||
});
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15A282b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Fq2-vR-Rsu">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="gfk-xX-zgL">
|
||||
<objects>
|
||||
<navigationController id="Fq2-vR-Rsu" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="2LN-7G-jZD">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
<segue destination="iXE-FA-91q" kind="relationship" relationship="rootViewController" id="peN-oI-nI6"/>
|
||||
</connections>
|
||||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="blx-hg-yRR" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-328" y="525"/>
|
||||
</scene>
|
||||
<!--MBProgressHUD-->
|
||||
<scene sceneID="v3e-zg-M0g">
|
||||
<objects>
|
||||
<viewController id="iXE-FA-91q" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Qu9-82-m3K"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="YSo-zR-oqe"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="TWt-Z9-CWt">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" title="MBProgressHUD" id="IuF-Dp-Voh"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="zfE-vP-CLG" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="413" y="525"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="9dw-fs-BGe">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--MBProgressHUD-->
|
||||
<scene sceneID="t7O-Gz-sDn">
|
||||
<objects>
|
||||
<tableViewController id="1VA-J6-vTg" customClass="MBHudDemoViewController" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="v14-ld-S1m">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<inset key="separatorInset" minX="30" minY="0.0" maxX="30" maxY="0.0"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" indentationWidth="10" reuseIdentifier="MBExampleCell" id="EW9-df-ImK">
|
||||
<rect key="frame" x="0.0" y="114" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="EW9-df-ImK" id="TMc-hr-0mm">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</prototypes>
|
||||
<sections/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="1VA-J6-vTg" id="hKQ-Jz-Rff"/>
|
||||
<outlet property="delegate" destination="1VA-J6-vTg" id="JHC-qg-dsn"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<navigationItem key="navigationItem" title="MBProgressHUD" id="0xs-aB-nPy"/>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="e7W-Fd-fGX" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="553" y="428"/>
|
||||
</scene>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="sbm-9a-RlC">
|
||||
<objects>
|
||||
<navigationController id="9dw-fs-BGe" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="355-tf-2jt">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
<segue destination="1VA-J6-vTg" kind="relationship" relationship="rootViewController" id="JkN-8S-WYA"/>
|
||||
</connections>
|
||||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="umT-Lr-spd" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-267" y="428"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// main.m
|
||||
// HudDemo
|
||||
//
|
||||
// Created by Matej Bukovinski on 2.4.09.
|
||||
// Copyright bukovinski.com 2009-2016. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "MBHudDemoAppDelegate.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([MBHudDemoAppDelegate class]));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Hud DemoTV View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="MBHudDemoTVViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eq8-Tn-jxG">
|
||||
<rect key="frame" x="827" y="20" width="266" height="86"/>
|
||||
<inset key="contentEdgeInsets" minX="40" minY="20" maxX="40" maxY="20"/>
|
||||
<state key="normal" title="Show HUD"/>
|
||||
<connections>
|
||||
<action selector="showHud:" destination="BYZ-38-t0r" eventType="primaryActionTriggered" id="s9S-8k-jtW"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="eq8-Tn-jxG" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="LhD-Fp-nSs"/>
|
||||
<constraint firstItem="eq8-Tn-jxG" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="20" id="deC-38-WIW"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="438" y="544"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"filename" : "gradient-fill-6-copy.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 214 B |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"layers" : [
|
||||
{
|
||||
"filename" : "Front.imagestacklayer"
|
||||
},
|
||||
{
|
||||
"filename" : "Back.imagestacklayer"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"filename" : "vector-smart-object.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 9.6 KiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"filename" : "gradient-fill-6-copy.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 106 B |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"layers" : [
|
||||
{
|
||||
"filename" : "Front.imagestacklayer"
|
||||
},
|
||||
{
|
||||
"filename" : "Back.imagestacklayer"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"filename" : "vector-smart-object.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"assets" : [
|
||||
{
|
||||
"size" : "1280x768",
|
||||
"idiom" : "tv",
|
||||
"filename" : "App Icon - Large.imagestack",
|
||||
"role" : "primary-app-icon"
|
||||
},
|
||||
{
|
||||
"size" : "400x240",
|
||||
"idiom" : "tv",
|
||||
"filename" : "App Icon - Small.imagestack",
|
||||
"role" : "primary-app-icon"
|
||||
},
|
||||
{
|
||||
"size" : "1920x720",
|
||||
"idiom" : "tv",
|
||||
"filename" : "Top Shelf Image.imageset",
|
||||
"role" : "top-shelf-image"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 26 KiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"filename" : "AppleTV-TopShelf-1920x720.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "tv",
|
||||
"filename" : "AppleTV-Launch.png",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "9.0",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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>CFBundleIcons</key>
|
||||
<dict/>
|
||||
<key>CFBundleIcons~ipad</key>
|
||||
<dict/>
|
||||
<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>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// MBHudDemoTV.h
|
||||
// HudDemoTV
|
||||
//
|
||||
// Created by Matej Bukovinski on 17. 07. 16.
|
||||
// Copyright © 2016 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MBHudDemoTVAppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// MBHudDemoTV.m
|
||||
// HudDemoTV
|
||||
//
|
||||
// Created by Matej Bukovinski on 17. 07. 16.
|
||||
// Copyright © 2016 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MBHudDemoTVAppDelegate.h"
|
||||
|
||||
@implementation MBHudDemoTVAppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// MBHudDemoTVViewController.h
|
||||
// HudDemoTV
|
||||
//
|
||||
// Created by Matej Bukovinski on 17. 07. 16.
|
||||
// Copyright © 2016 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MBHudDemoTVViewController : UIViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// MBHudDemoTVViewController.m
|
||||
// HudDemoTV
|
||||
//
|
||||
// Created by Matej Bukovinski on 17. 07. 16.
|
||||
// Copyright © 2016 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MBHudDemoTVViewController.h"
|
||||
#import "MBProgressHUD.h"
|
||||
|
||||
@implementation MBHudDemoTVViewController
|
||||
|
||||
- (IBAction)showHud:(UIButton *)sender {
|
||||
sender.enabled = NO;
|
||||
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
|
||||
// Set the determinate mode to show task progress.
|
||||
hud.mode = MBProgressHUDModeDeterminate;
|
||||
hud.label.text = NSLocalizedString(@"Loading...", @"HUD loading title");
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
// Do something useful in the background and update the HUD periodically.
|
||||
[self doSomeWorkWithProgress];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[hud hideAnimated:YES];
|
||||
sender.enabled = YES;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)doSomeWorkWithProgress {
|
||||
// This just increases the progress indicator in a loop.
|
||||
float progress = 0.0f;
|
||||
while (progress < 1.0f) {
|
||||
progress += 0.01f;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// Instead we could have also passed a reference to the HUD
|
||||
// to the HUD to myProgressTask as a method parameter.
|
||||
[MBProgressHUD HUDForView:self.view].progress = progress;
|
||||
});
|
||||
usleep(50000);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// main.m
|
||||
// HudDemoTV
|
||||
//
|
||||
// Created by Matej Bukovinski on 17. 07. 16.
|
||||
// Copyright © 2016 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "MBHudDemoTVAppDelegate.h"
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([MBHudDemoTVAppDelegate class]));
|
||||
}
|
||||
}
|
||||
@@ -2,41 +2,360 @@
|
||||
// HudTests.m
|
||||
// HudTests
|
||||
//
|
||||
// Created by Matej Bukovinski on 8. 02. 15.
|
||||
// Copyright (c) 2015 Matej Bukovinski. All rights reserved.
|
||||
// Created by Matej Bukovinski on 31. 01. 16.
|
||||
// Copyright © 2016 Matej Bukovinski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "MBProgressHUD.h"
|
||||
|
||||
|
||||
@interface HudTests : XCTestCase
|
||||
#define weakify(var) __weak typeof(var) weak_##var = var;
|
||||
|
||||
@property (nonatomic, strong) MBProgressHUD *hud;
|
||||
@property (nonatomic, strong) UIView *view;
|
||||
#define strongify(var) \
|
||||
_Pragma("clang diagnostic push") \
|
||||
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
|
||||
__strong typeof(var) var = weak_##var; \
|
||||
_Pragma("clang diagnostic pop")
|
||||
|
||||
#define MBTestHUDIsVisible(hud, rootView) \
|
||||
do { \
|
||||
XCTAssertEqualObjects(hud.superview, rootView, @"The hud should be added to the view."); \
|
||||
XCTAssertEqual(hud.alpha, 1.f, @"The HUD should be visible."); \
|
||||
XCTAssertFalse(hud.hidden, @"The HUD should be visible."); \
|
||||
XCTAssertEqual(hud.bezelView.alpha, 1.f, @"The HUD should be visible."); \
|
||||
} while (0)
|
||||
|
||||
#define MBTestHUDIsHidenAndRemoved(hud, rootView) \
|
||||
do { \
|
||||
XCTAssertFalse([rootView.subviews containsObject:hud], @"The HUD should not be part of the view hierarchy."); \
|
||||
XCTAssertEqual(hud.alpha, 0.f, @"The hud should be faded out."); \
|
||||
XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
|
||||
} while (0)
|
||||
|
||||
@interface HudTests : XCTestCase <MBProgressHUDDelegate>
|
||||
|
||||
@property (nonatomic) XCTestExpectation *hideExpectation;
|
||||
@property (nonatomic, copy) dispatch_block_t hideChecks;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation HudTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
#pragma mark - Convenience
|
||||
|
||||
self.view = [[UIView alloc] init];
|
||||
self.view.bounds = [[UIScreen mainScreen] bounds];
|
||||
self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
- (void)testNonAnimatedConvenienceHUDPresentation {
|
||||
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
|
||||
UIView *rootView = rootViewController.view;
|
||||
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:rootView animated:NO];
|
||||
|
||||
XCTAssertNotNil(hud, @"A HUD should be created.");
|
||||
MBTestHUDIsVisible(hud, rootView);
|
||||
|
||||
XCTAssertEqual(hud.bezelView.alpha, 1.f, @"The HUD should be visible.");
|
||||
XCTAssertFalse([hud.bezelView.layer.animationKeys containsObject:@"opacity"], @"The opacity should NOT be animated.");
|
||||
|
||||
XCTAssertEqualObjects([MBProgressHUD HUDForView:rootView], hud, @"The HUD should be found via the convenience operation.");
|
||||
|
||||
XCTAssertTrue([MBProgressHUD hideHUDForView:rootView animated:NO], @"The HUD should be found and removed.");
|
||||
|
||||
MBTestHUDIsHidenAndRemoved(hud, rootView);
|
||||
|
||||
XCTAssertFalse([MBProgressHUD hideHUDForView:rootView animated:NO], @"A subsequent HUD hide operation should fail.");
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
self.hud = nil;
|
||||
self.view = nil;
|
||||
- (void)testAnimatedConvenienceHUDPresentation {
|
||||
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
|
||||
UIView *rootView = rootViewController.view;
|
||||
|
||||
[super tearDown];
|
||||
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
|
||||
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:rootView animated:YES];
|
||||
hud.delegate = self;
|
||||
|
||||
XCTAssertNotNil(hud, @"A HUD should be created.");
|
||||
MBTestHUDIsVisible(hud, rootView);
|
||||
|
||||
XCTAssertEqual(hud.bezelView.alpha, 1.f, @"The HUD should be visible.");
|
||||
XCTAssertTrue([hud.bezelView.layer.animationKeys containsObject:@"opacity"], @"The opacity should be animated.");
|
||||
|
||||
XCTAssertEqualObjects([MBProgressHUD HUDForView:rootView], hud, @"The HUD should be found via the convenience operation.");
|
||||
|
||||
XCTAssertTrue([MBProgressHUD hideHUDForView:rootView animated:YES], @"The HUD should be found and removed.");
|
||||
|
||||
XCTAssertTrue([rootView.subviews containsObject:hud], @"The HUD should still be part of the view hierarchy.");
|
||||
XCTAssertEqual(hud.alpha, 1.f, @"The hud should still be visible.");
|
||||
XCTAssertEqualObjects(hud.superview, rootView, @"The hud should be added to the view.");
|
||||
XCTAssertEqual(hud.bezelView.alpha, 0.f, @"The HUD bezel should be animated out.");
|
||||
XCTAssertTrue([hud.bezelView.layer.animationKeys containsObject:@"opacity"], @"The opacity should be animated.");
|
||||
|
||||
weakify(self);
|
||||
self.hideChecks = ^{
|
||||
strongify(self);
|
||||
MBTestHUDIsHidenAndRemoved(hud, rootView);
|
||||
|
||||
XCTAssertFalse([MBProgressHUD hideHUDForView:rootView animated:YES], @"A subsequent HUD hide operation should fail.");
|
||||
};
|
||||
|
||||
[self waitForExpectationsWithTimeout:5. handler:nil];
|
||||
}
|
||||
|
||||
- (void)testThatHUDExists {
|
||||
XCTAssertNotNil(self.hud, @"Should be able to create a new HUD instance");
|
||||
- (void)testCompletionBlock {
|
||||
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
|
||||
UIView *rootView = rootViewController.view;
|
||||
|
||||
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
|
||||
XCTestExpectation *completionExpectation = [self expectationWithDescription:@"The completionBlock: should have been called."];
|
||||
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:rootView animated:YES];
|
||||
hud.delegate = self;
|
||||
hud.completionBlock = ^{
|
||||
[completionExpectation fulfill];
|
||||
};
|
||||
|
||||
[hud hideAnimated:YES];
|
||||
|
||||
[self waitForExpectationsWithTimeout:5. handler:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Delay
|
||||
|
||||
- (void)testDelayedHide {
|
||||
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
|
||||
UIView *rootView = rootViewController.view;
|
||||
|
||||
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
|
||||
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:rootView animated:NO];
|
||||
hud.delegate = self;
|
||||
|
||||
XCTAssertNotNil(hud, @"A HUD should be created.");
|
||||
|
||||
[hud hideAnimated:NO afterDelay:2];
|
||||
|
||||
MBTestHUDIsVisible(hud, rootView);
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
MBTestHUDIsVisible(hud, rootView);
|
||||
});
|
||||
|
||||
XCTestExpectation *hideCheckExpectation = [self expectationWithDescription:@"Hide check"];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// After the grace time passes, the HUD should still not be shown.
|
||||
MBTestHUDIsHidenAndRemoved(hud, rootView);
|
||||
[hideCheckExpectation fulfill];
|
||||
});
|
||||
|
||||
[self waitForExpectationsWithTimeout:5. handler:nil];
|
||||
|
||||
MBTestHUDIsHidenAndRemoved(hud, rootView);
|
||||
}
|
||||
|
||||
#pragma mark - Ruse
|
||||
|
||||
- (void)testNonAnimatedHudReuse {
|
||||
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
|
||||
UIView *rootView = rootViewController.view;
|
||||
|
||||
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
|
||||
[rootView addSubview:hud];
|
||||
[hud showAnimated:NO];
|
||||
|
||||
XCTAssertNotNil(hud, @"A HUD should be created.");
|
||||
|
||||
[hud hideAnimated:NO];
|
||||
[hud showAnimated:NO];
|
||||
|
||||
MBTestHUDIsVisible(hud, rootView);
|
||||
|
||||
[hud hideAnimated:NO];
|
||||
[hud removeFromSuperview];
|
||||
}
|
||||
|
||||
- (void)testUnfinishedHidingAnimation {
|
||||
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
|
||||
UIView *rootView = rootViewController.view;
|
||||
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:rootView animated:NO];
|
||||
|
||||
[hud hideAnimated:YES];
|
||||
|
||||
// Cancel all animations. It will cause `UIView+animate...` to call completionBlock with `finished = NO`.
|
||||
// It's same as if you call `[hud hideAnimated:YES]` while the app is in background.
|
||||
[hud.bezelView.layer removeAllAnimations];
|
||||
[hud.backgroundView.layer removeAllAnimations];
|
||||
|
||||
XCTestExpectation *hideCheckExpectation = [self expectationWithDescription:@"Hide check"];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// After the grace time passes, the HUD should still not be shown.
|
||||
MBTestHUDIsHidenAndRemoved(hud, rootView);
|
||||
[hideCheckExpectation fulfill];
|
||||
});
|
||||
|
||||
[self waitForExpectationsWithTimeout:5. handler:nil];
|
||||
|
||||
MBTestHUDIsHidenAndRemoved(hud, rootView);
|
||||
}
|
||||
|
||||
- (void)testAnimatedImmediateHudReuse {
|
||||
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
|
||||
UIView *rootView = rootViewController.view;
|
||||
|
||||
XCTestExpectation *hideExpectation = [self expectationWithDescription:@"The hud should have been hidden."];
|
||||
|
||||
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
|
||||
[rootView addSubview:hud];
|
||||
[hud showAnimated:YES];
|
||||
|
||||
XCTAssertNotNil(hud, @"A HUD should be created.");
|
||||
|
||||
[hud hideAnimated:YES];
|
||||
[hud showAnimated:YES];
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
MBTestHUDIsVisible(hud, rootView);
|
||||
|
||||
[hud hideAnimated:NO];
|
||||
[hud removeFromSuperview];
|
||||
|
||||
[hideExpectation fulfill];
|
||||
});
|
||||
|
||||
[self waitForExpectationsWithTimeout:5. handler:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Min show time
|
||||
|
||||
- (void)testMinShowTime {
|
||||
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
|
||||
UIView *rootView = rootViewController.view;
|
||||
|
||||
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
|
||||
|
||||
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
|
||||
hud.delegate = self;
|
||||
hud.removeFromSuperViewOnHide = YES;
|
||||
hud.minShowTime = 2.;
|
||||
[rootView addSubview:hud];
|
||||
[hud showAnimated:YES];
|
||||
|
||||
XCTAssertNotNil(hud, @"A HUD should be created.");
|
||||
|
||||
[hud hideAnimated:YES];
|
||||
|
||||
__block BOOL checkedAfterOneSecond = NO;
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// Check that the hud is still visible
|
||||
MBTestHUDIsVisible(hud, rootView);
|
||||
checkedAfterOneSecond = YES;
|
||||
});
|
||||
|
||||
weakify(self);
|
||||
self.hideChecks = ^{
|
||||
strongify(self);
|
||||
XCTAssertTrue(checkedAfterOneSecond);
|
||||
};
|
||||
|
||||
[self waitForExpectationsWithTimeout:5. handler:nil];
|
||||
|
||||
MBTestHUDIsHidenAndRemoved(hud, rootView);
|
||||
}
|
||||
|
||||
#pragma mark - Grace time
|
||||
|
||||
- (void)testGraceTime {
|
||||
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
|
||||
UIView *rootView = rootViewController.view;
|
||||
|
||||
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
|
||||
|
||||
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
|
||||
hud.delegate = self;
|
||||
hud.removeFromSuperViewOnHide = YES;
|
||||
hud.graceTime = 2.;
|
||||
[rootView addSubview:hud];
|
||||
[hud showAnimated:YES];
|
||||
|
||||
XCTAssertNotNil(hud, @"A HUD should be created.");
|
||||
|
||||
// The HUD should be added to the view but still hidden
|
||||
XCTAssertEqualObjects(hud.superview, rootView, @"The hud should be added to the view."); \
|
||||
XCTAssertEqual(hud.alpha, 0.f, @"The HUD should not be visible."); \
|
||||
XCTAssertFalse(hud.hidden, @"The HUD should be visible."); \
|
||||
XCTAssertEqual(hud.bezelView.alpha, 0.f, @"The HUD should not be visible."); \
|
||||
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// The HUD should be added to the view but still hidden
|
||||
XCTAssertEqualObjects(hud.superview, rootView, @"The hud should be added to the view."); \
|
||||
XCTAssertEqual(hud.alpha, 0.f, @"The HUD should not be visible."); \
|
||||
XCTAssertFalse(hud.hidden, @"The HUD should be visible."); \
|
||||
XCTAssertEqual(hud.bezelView.alpha, 0.f, @"The HUD should not be visible."); \
|
||||
});
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// After the grace time passes, the HUD should be shown.
|
||||
MBTestHUDIsVisible(hud, rootView);
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
|
||||
[self waitForExpectationsWithTimeout:5. handler:nil];
|
||||
|
||||
MBTestHUDIsHidenAndRemoved(hud, rootView);
|
||||
}
|
||||
|
||||
- (void)testHideBeforeGraceTimeElapsed {
|
||||
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
|
||||
UIView *rootView = rootViewController.view;
|
||||
|
||||
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
|
||||
|
||||
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
|
||||
hud.delegate = self;
|
||||
hud.removeFromSuperViewOnHide = YES;
|
||||
hud.graceTime = 2.;
|
||||
[rootView addSubview:hud];
|
||||
[hud showAnimated:YES];
|
||||
|
||||
XCTAssertNotNil(hud, @"A HUD should be created.");
|
||||
|
||||
// The HUD should be added to the view but still hidden
|
||||
XCTAssertEqualObjects(hud.superview, rootView, @"The hud should be added to the view."); \
|
||||
XCTAssertEqual(hud.alpha, 0.f, @"The HUD should not be visible."); \
|
||||
XCTAssertFalse(hud.hidden, @"The HUD should be visible."); \
|
||||
XCTAssertEqual(hud.bezelView.alpha, 0.f, @"The HUD should not be visible."); \
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// The HUD should be added to the view but still hidden
|
||||
XCTAssertEqualObjects(hud.superview, rootView, @"The hud should be added to the view."); \
|
||||
XCTAssertEqual(hud.alpha, 0.f, @"The HUD should not be visible."); \
|
||||
XCTAssertFalse(hud.hidden, @"The HUD should be visible."); \
|
||||
XCTAssertEqual(hud.bezelView.alpha, 0.f, @"The HUD should not be visible."); \
|
||||
[hud hideAnimated:YES];
|
||||
});
|
||||
|
||||
XCTestExpectation *hideCheckExpectation = [self expectationWithDescription:@"Hide check"];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// After the grace time passes, the HUD should still not be shown.
|
||||
MBTestHUDIsHidenAndRemoved(hud, rootView);
|
||||
[hideCheckExpectation fulfill];
|
||||
});
|
||||
|
||||
[self waitForExpectationsWithTimeout:5. handler:nil];
|
||||
|
||||
MBTestHUDIsHidenAndRemoved(hud, rootView);
|
||||
}
|
||||
|
||||
#pragma mark - MBProgressHUDDelegate
|
||||
|
||||
- (void)hudWasHidden:(MBProgressHUD *)hud {
|
||||
if (self.hideChecks) self.hideChecks();
|
||||
self.hideChecks = nil;
|
||||
|
||||
[self.hideExpectation fulfill];
|
||||
self.hideExpectation = nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
@@ -1,269 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="528" defaultVersion="1072" identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HudDemoViewController">
|
||||
<connections>
|
||||
<outlet property="view" destination="52" id="70"/>
|
||||
<outletCollection property="buttons" destination="8" id="1Qm-jt-yv2"/>
|
||||
<outletCollection property="buttons" destination="9" id="EHW-ch-h6c"/>
|
||||
<outletCollection property="buttons" destination="10" id="g6I-6a-hVf"/>
|
||||
<outletCollection property="buttons" destination="16" id="y8l-Gw-EuC"/>
|
||||
<outletCollection property="buttons" destination="106" id="mfq-yU-kF4"/>
|
||||
<outletCollection property="buttons" destination="117" id="Sew-7b-Taq"/>
|
||||
<outletCollection property="buttons" destination="20" id="ij2-Dq-pWR"/>
|
||||
<outletCollection property="buttons" destination="49" id="Ap4-YL-HTN"/>
|
||||
<outletCollection property="buttons" destination="71" id="5wc-Ky-Zdq"/>
|
||||
<outletCollection property="buttons" destination="76" id="N9J-sh-Sai"/>
|
||||
<outletCollection property="buttons" destination="43" id="wWh-rQ-Y81"/>
|
||||
<outletCollection property="buttons" destination="79" id="mUt-YM-wkJ"/>
|
||||
<outletCollection property="buttons" destination="111" id="2gl-eT-6Ke"/>
|
||||
<outletCollection property="buttons" destination="115" id="L2G-gy-G5K"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="52">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="697"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="54">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="697"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="9">
|
||||
<rect key="frame" x="20" y="68" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="With label">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showWithLabel:" destination="-1" eventType="touchUpInside" id="13"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="10">
|
||||
<rect key="frame" x="20" y="116" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="With details label">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="disabled" title="With details label"/>
|
||||
<state key="selected" title="With details label"/>
|
||||
<state key="highlighted" title="With details label">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showWithDetailsLabel:" destination="-1" eventType="touchUpInside" id="14"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="16">
|
||||
<rect key="frame" x="20" y="164" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="Determinate mode">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showWithLabelDeterminate:" destination="-1" eventType="touchUpInside" id="17"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="106">
|
||||
<rect key="frame" x="20" y="212" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="Annular determinate mode">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showWIthLabelAnnularDeterminate:" destination="-1" eventType="touchUpInside" id="120"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="117">
|
||||
<rect key="frame" x="20" y="257" width="280" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="Bar determinate mode">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showWithLabelDeterminateHorizontalBar:" destination="-1" eventType="touchUpInside" id="121"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="20">
|
||||
<rect key="frame" x="20" y="354" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="Mode switching">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showWithLabelMixed:" destination="-1" eventType="touchUpInside" id="21"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="49">
|
||||
<rect key="frame" x="20" y="400" width="280" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="Using blocks">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showUsingBlocks:" destination="-1" eventType="touchUpInside" id="51"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="71">
|
||||
<rect key="frame" x="20" y="450" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="On Window">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showOnWindow:" destination="-1" eventType="touchUpInside" id="73"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="76">
|
||||
<rect key="frame" x="20" y="498" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="NSURLConnection">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showURL:" destination="-1" eventType="touchUpInside" id="78"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="43">
|
||||
<rect key="frame" x="20" y="306" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="Custom view">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showWithCustomView:" destination="-1" eventType="touchUpInside" id="47"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="79">
|
||||
<rect key="frame" x="20" y="545" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="Dim background">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showWithGradient:" destination="-1" eventType="touchUpInside" id="81"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="111">
|
||||
<rect key="frame" x="20" y="593" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="Text only">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showTextOnly:" destination="-1" eventType="touchUpInside" id="113"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="115">
|
||||
<rect key="frame" x="20" y="641" width="280" height="37"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="Colored">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showWithColor:" destination="-1" eventType="touchUpInside" id="116"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="fill" buttonType="roundedRect" lineBreakMode="middleTruncation" id="8">
|
||||
<rect key="frame" x="20" y="20" width="280" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.95294117647058818" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="Simple indeterminate progress">
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" red="0.0" green="0.23884613512332439" blue="0.49733664772727271" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="showSimple:" destination="-1" eventType="touchUpInside" id="12"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.8862745098" green="0.90588235289999997" blue="0.92941176469999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
</scrollView>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -1,77 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// main.m
|
||||
// HudDemo
|
||||
//
|
||||
// Created by Matej Bukovinski on 2.4.09.
|
||||
// Copyright bukovinski.com 2009. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
int retVal = UIApplicationMain(argc, argv, nil, nil);
|
||||
[pool release];
|
||||
return retVal;
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.matej.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2009-2015 Matej Bukovinski
|
||||
Copyright © 2009-2016 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
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//
|
||||
// MBProgressHUD.h
|
||||
// Version 0.9.2
|
||||
// Version 1.0.0
|
||||
// Created by Matej Bukovinski on 2.4.09.
|
||||
//
|
||||
|
||||
// This code is distributed under the terms and conditions of the MIT license.
|
||||
|
||||
// Copyright (c) 2009-2015 Matej Bukovinski
|
||||
// Copyright © 2009-2016 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
|
||||
@@ -30,90 +30,67 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <CoreGraphics/CoreGraphics.h>
|
||||
|
||||
@class MBBackgroundView;
|
||||
@protocol MBProgressHUDDelegate;
|
||||
|
||||
|
||||
extern CGFloat const MBProgressMaxOffset;
|
||||
|
||||
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. */
|
||||
MBProgressHUDModeDeterminate,
|
||||
/** Progress is shown using a horizontal progress bar */
|
||||
MBProgressHUDModeDeterminateHorizontalBar,
|
||||
/** Progress is shown using a ring-shaped progress view. */
|
||||
MBProgressHUDModeAnnularDeterminate,
|
||||
/** Shows a custom view */
|
||||
MBProgressHUDModeCustomView,
|
||||
/** Shows only labels */
|
||||
MBProgressHUDModeText
|
||||
/// UIActivityIndicatorView.
|
||||
MBProgressHUDModeIndeterminate,
|
||||
/// A round, pie-chart like, progress view.
|
||||
MBProgressHUDModeDeterminate,
|
||||
/// Horizontal progress bar.
|
||||
MBProgressHUDModeDeterminateHorizontalBar,
|
||||
/// Ring-shaped progress view.
|
||||
MBProgressHUDModeAnnularDeterminate,
|
||||
/// Shows a custom view.
|
||||
MBProgressHUDModeCustomView,
|
||||
/// Shows only labels.
|
||||
MBProgressHUDModeText
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, MBProgressHUDAnimation) {
|
||||
/** Opacity animation */
|
||||
MBProgressHUDAnimationFade,
|
||||
/** Opacity + scale animation */
|
||||
MBProgressHUDAnimationZoom,
|
||||
MBProgressHUDAnimationZoomOut = MBProgressHUDAnimationZoom,
|
||||
MBProgressHUDAnimationZoomIn
|
||||
/// Opacity animation
|
||||
MBProgressHUDAnimationFade,
|
||||
/// Opacity + scale animation (zoom in when appearing zoom out when disappearing)
|
||||
MBProgressHUDAnimationZoom,
|
||||
/// Opacity + scale animation (zoom out style)
|
||||
MBProgressHUDAnimationZoomOut,
|
||||
/// Opacity + scale animation (zoom in style)
|
||||
MBProgressHUDAnimationZoomIn
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, MBProgressHUDBackgroundStyle) {
|
||||
/// Solid color background
|
||||
MBProgressHUDBackgroundStyleSolidColor,
|
||||
/// UIVisualEffectView or UIToolbar.layer background view
|
||||
MBProgressHUDBackgroundStyleBlur
|
||||
};
|
||||
|
||||
#ifndef MB_INSTANCETYPE
|
||||
#if __has_feature(objc_instancetype)
|
||||
#define MB_INSTANCETYPE instancetype
|
||||
#else
|
||||
#define MB_INSTANCETYPE id
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MB_STRONG
|
||||
#if __has_feature(objc_arc)
|
||||
#define MB_STRONG strong
|
||||
#else
|
||||
#define MB_STRONG retain
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MB_WEAK
|
||||
#if __has_feature(objc_arc_weak)
|
||||
#define MB_WEAK weak
|
||||
#elif __has_feature(objc_arc)
|
||||
#define MB_WEAK unsafe_unretained
|
||||
#else
|
||||
#define MB_WEAK assign
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if NS_BLOCKS_AVAILABLE
|
||||
typedef void (^MBProgressHUDCompletionBlock)();
|
||||
#endif
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* Displays a simple HUD window containing a progress indicator and two optional labels for short messages.
|
||||
*
|
||||
* This is a simple drop-in class for displaying a progress HUD view similar to Apple's private UIProgressHUD class.
|
||||
* The MBProgressHUD window spans over the entire space given to it by the initWithFrame constructor and catches all
|
||||
* user input on this region, thereby preventing the user operations on components below the view. The HUD itself is
|
||||
* drawn centered as a rounded semi-transparent view which resizes depending on the user specified content.
|
||||
* The MBProgressHUD window spans over the entire space given to it by the initWithFrame: constructor and catches all
|
||||
* user input on this region, thereby preventing the user operations on components below the view.
|
||||
*
|
||||
* 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`)
|
||||
*
|
||||
* 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.
|
||||
* @note To still allow touches to pass through the HUD, you can set hud.userInteractionEnabled = NO.
|
||||
* @attention MBProgressHUD is a UI class and should therefore only be accessed on the main thread.
|
||||
*/
|
||||
@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.
|
||||
* @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
|
||||
@@ -123,12 +100,14 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
* @see hideHUDForView:animated:
|
||||
* @see animationType
|
||||
*/
|
||||
+ (MB_INSTANCETYPE)showHUDAddedTo:(UIView *)view animated:(BOOL)animated;
|
||||
+ (instancetype)showHUDAddedTo:(UIView *)view animated:(BOOL)animated;
|
||||
|
||||
/// @name Showing and hiding
|
||||
|
||||
/**
|
||||
* Finds the top-most HUD subview and hides it. The counterpart to this method is showHUDAddedTo:animated:.
|
||||
* Finds the top-most HUD subview that hasn't finished 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.
|
||||
* @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
|
||||
@@ -141,68 +120,38 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
+ (BOOL)hideHUDForView:(UIView *)view animated:(BOOL)animated;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @return the number of HUDs found and removed.
|
||||
*
|
||||
* @see hideHUDForView:animated:
|
||||
* @see animationType
|
||||
*/
|
||||
+ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated;
|
||||
|
||||
/**
|
||||
* Finds the top-most HUD subview and returns it.
|
||||
* Finds the top-most HUD subview that hasn't finished and returns it.
|
||||
*
|
||||
* @param view The view that is going to be searched.
|
||||
* @return A reference to the last HUD subview discovered.
|
||||
*/
|
||||
+ (MB_INSTANCETYPE)HUDForView:(UIView *)view;
|
||||
|
||||
/**
|
||||
* Finds all HUD subviews and returns them.
|
||||
*
|
||||
* @param view The view that is going to be searched.
|
||||
* @return All found HUD views (array of MBProgressHUD objects).
|
||||
*/
|
||||
+ (NSArray *)allHUDsForView:(UIView *)view;
|
||||
|
||||
/**
|
||||
* A convenience constructor that initializes the HUD with the window's bounds. Calls the designated constructor with
|
||||
* window.bounds as the parameter.
|
||||
*
|
||||
* @param window The window instance that will provide the bounds for the HUD. Should be the same instance as
|
||||
* the HUD's superview (i.e., the window that the HUD will be added to).
|
||||
*/
|
||||
- (id)initWithWindow:(UIWindow *)window;
|
||||
+ (nullable MBProgressHUD *)HUDForView:(UIView *)view;
|
||||
|
||||
/**
|
||||
* A convenience constructor that initializes the HUD with the view's bounds. Calls the designated constructor with
|
||||
* view.bounds as the parameter
|
||||
* view.bounds as the parameter.
|
||||
*
|
||||
* @param view The view instance that will provide the bounds for the HUD. Should be the same instance as
|
||||
* the HUD's superview (i.e., the view that the HUD will be added to).
|
||||
*/
|
||||
- (id)initWithView:(UIView *)view;
|
||||
- (instancetype)initWithView:(UIView *)view;
|
||||
|
||||
/**
|
||||
* Display the HUD. You need to make sure that the main thread completes its run loop soon after this method call so
|
||||
* the user interface can be updated. Call this method when your task is already set-up to be executed in a new thread
|
||||
* (e.g., when using something like NSOperation or calling an asynchronous call like NSURLRequest).
|
||||
* Displays the HUD.
|
||||
*
|
||||
* @note You need to make sure that the main thread completes its run loop soon after this method call so that
|
||||
* the user interface can be updated. Call this method when your task is already set up to be executed in a new thread
|
||||
* (e.g., when using something like NSOperation or making an asynchronous call like NSURLRequest).
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @see animationType
|
||||
*/
|
||||
- (void)show:(BOOL)animated;
|
||||
- (void)showAnimated:(BOOL)animated;
|
||||
|
||||
/**
|
||||
* Hide the HUD. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to
|
||||
* Hides the HUD. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to
|
||||
* hide the HUD when your task completes.
|
||||
*
|
||||
* @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
|
||||
@@ -210,10 +159,10 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
*
|
||||
* @see animationType
|
||||
*/
|
||||
- (void)hide:(BOOL)animated;
|
||||
- (void)hideAnimated:(BOOL)animated;
|
||||
|
||||
/**
|
||||
* Hide the HUD after a delay. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to
|
||||
* Hides the HUD after a delay. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to
|
||||
* hide the HUD when your task completes.
|
||||
*
|
||||
* @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
|
||||
@@ -222,228 +171,136 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
*
|
||||
* @see animationType
|
||||
*/
|
||||
- (void)hide:(BOOL)animated afterDelay:(NSTimeInterval)delay;
|
||||
|
||||
/**
|
||||
* Shows the HUD while a background task is executing in a new thread, then hides the HUD.
|
||||
*
|
||||
* This method also takes care of autorelease pools so your method does not have to be concerned with setting up a
|
||||
* pool.
|
||||
*
|
||||
* @param method The method to be executed while the HUD is shown. This method will be executed in a new thread.
|
||||
* @param target The object that the target method belongs to.
|
||||
* @param object An optional object to be passed to the method.
|
||||
* @param animated If set to YES the HUD will (dis)appear using the current animationType. If set to NO the HUD will not use
|
||||
* animations while (dis)appearing.
|
||||
*/
|
||||
- (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(BOOL)animated;
|
||||
|
||||
#if NS_BLOCKS_AVAILABLE
|
||||
- (void)hideAnimated:(BOOL)animated afterDelay:(NSTimeInterval)delay;
|
||||
|
||||
/**
|
||||
* Shows the HUD while a block is executing on a background queue, then hides the HUD.
|
||||
*
|
||||
* @see showAnimated:whileExecutingBlock:onQueue:completionBlock:
|
||||
* The HUD delegate object. Receives HUD state notifications.
|
||||
*/
|
||||
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block;
|
||||
@property (weak, nonatomic) id<MBProgressHUDDelegate> delegate;
|
||||
|
||||
/**
|
||||
* Shows the HUD while a block is executing on a background queue, then hides the HUD.
|
||||
*
|
||||
* @see showAnimated:whileExecutingBlock:onQueue:completionBlock:
|
||||
* Called after the HUD is hiden.
|
||||
*/
|
||||
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block completionBlock:(MBProgressHUDCompletionBlock)completion;
|
||||
|
||||
/**
|
||||
* Shows the HUD while a block is executing on the specified dispatch queue, then hides the HUD.
|
||||
*
|
||||
* @see showAnimated:whileExecutingBlock:onQueue:completionBlock:
|
||||
*/
|
||||
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue;
|
||||
|
||||
/**
|
||||
* Shows the HUD while a block is executing on the specified dispatch queue, executes completion block on the main queue, and then hides the HUD.
|
||||
*
|
||||
* @param animated If set to YES the HUD will (dis)appear using the current animationType. If set to NO the HUD will
|
||||
* not use animations while (dis)appearing.
|
||||
* @param block The block to be executed while the HUD is shown.
|
||||
* @param queue The dispatch queue on which the block should be executed.
|
||||
* @param completion The block to be executed on completion.
|
||||
*
|
||||
* @see completionBlock
|
||||
*/
|
||||
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue
|
||||
completionBlock:(MBProgressHUDCompletionBlock)completion;
|
||||
|
||||
/**
|
||||
* A block that gets called after the HUD was completely hidden.
|
||||
*/
|
||||
@property (copy) MBProgressHUDCompletionBlock completionBlock;
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MBProgressHUD operation mode. The default is MBProgressHUDModeIndeterminate.
|
||||
*
|
||||
* @see MBProgressHUDMode
|
||||
*/
|
||||
@property (assign) MBProgressHUDMode mode;
|
||||
|
||||
/**
|
||||
* The animation type that should be used when the HUD is shown and hidden.
|
||||
*
|
||||
* @see MBProgressHUDAnimation
|
||||
*/
|
||||
@property (assign) MBProgressHUDAnimation animationType;
|
||||
|
||||
/**
|
||||
* The UIView (e.g., a UIImageView) to be shown when the HUD is in MBProgressHUDModeCustomView.
|
||||
* For best results use a 37 by 37 pixel view (so the bounds match the built in indicator bounds).
|
||||
*/
|
||||
@property (MB_STRONG) UIView *customView;
|
||||
|
||||
/**
|
||||
* The HUD delegate object.
|
||||
*
|
||||
* @see MBProgressHUDDelegate
|
||||
*/
|
||||
@property (MB_WEAK) id<MBProgressHUDDelegate> delegate;
|
||||
|
||||
/**
|
||||
* An optional short message to be displayed below the activity indicator. The HUD is automatically resized to fit
|
||||
* the entire text. If the text is too long it will get clipped by displaying "..." at the end. If left unchanged or
|
||||
* set to @"", then no message is displayed.
|
||||
*/
|
||||
@property (copy) NSString *labelText;
|
||||
|
||||
/**
|
||||
* An optional details message displayed below the labelText message. This message is displayed only if the labelText
|
||||
* property is also set and is different from an empty string (@""). The details text can span multiple lines.
|
||||
*/
|
||||
@property (copy) NSString *detailsLabelText;
|
||||
|
||||
/**
|
||||
* The opacity of the HUD window. Defaults to 0.8 (80% opacity).
|
||||
*/
|
||||
@property (assign) float opacity;
|
||||
|
||||
/**
|
||||
* The color of the HUD window. Defaults to black. If this property is set, color is set using
|
||||
* this UIColor and the opacity property is not used. using retain because performing copy on
|
||||
* UIColor base colors (like [UIColor greenColor]) cause problems with the copyZone.
|
||||
*/
|
||||
@property (MB_STRONG) UIColor *color;
|
||||
|
||||
/**
|
||||
* The x-axis offset of the HUD relative to the centre of the superview.
|
||||
*/
|
||||
@property (assign) float xOffset;
|
||||
|
||||
/**
|
||||
* The y-axis offset of the HUD relative to the centre of the superview.
|
||||
*/
|
||||
@property (assign) float yOffset;
|
||||
|
||||
/**
|
||||
* The amount of space between the HUD edge and the HUD elements (labels, indicators or custom views).
|
||||
* Defaults to 20.0
|
||||
*/
|
||||
@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.
|
||||
*/
|
||||
@property (assign) BOOL dimBackground;
|
||||
@property (copy, nullable) MBProgressHUDCompletionBlock completionBlock;
|
||||
|
||||
/*
|
||||
* Grace period is the time (in seconds) that the invoked method may be run without
|
||||
* Grace period is the time (in seconds) that the invoked method may be run without
|
||||
* showing the HUD. If the task finishes before the grace time runs out, the HUD will
|
||||
* not be shown at all.
|
||||
* not be shown at all.
|
||||
* This may be used to prevent HUD display for very short tasks.
|
||||
* Defaults to 0 (no grace time).
|
||||
* Grace time functionality is only supported when the task status is known!
|
||||
* @see taskInProgress
|
||||
*/
|
||||
@property (assign) float graceTime;
|
||||
@property (assign, nonatomic) NSTimeInterval graceTime;
|
||||
|
||||
/**
|
||||
* The minimum time (in seconds) that the HUD is shown.
|
||||
* The minimum time (in seconds) that the HUD is shown.
|
||||
* This avoids the problem of the HUD being shown and than instantly hidden.
|
||||
* Defaults to 0 (no minimum show time).
|
||||
*/
|
||||
@property (assign) float minShowTime;
|
||||
@property (assign, nonatomic) NSTimeInterval minShowTime;
|
||||
|
||||
/**
|
||||
* Indicates that the executed operation is in progress. Needed for correct graceTime operation.
|
||||
* If you don't set a graceTime (different than 0.0) this does nothing.
|
||||
* This property is automatically set when using showWhileExecuting:onTarget:withObject:animated:.
|
||||
* When threading is done outside of the HUD (i.e., when the show: and hide: methods are used directly),
|
||||
* you need to set this property when your task starts and completes in order to have normal graceTime
|
||||
* functionality.
|
||||
* Removes the HUD from its parent view when hidden.
|
||||
* Defaults to NO.
|
||||
*/
|
||||
@property (assign) BOOL taskInProgress;
|
||||
@property (assign, nonatomic) BOOL removeFromSuperViewOnHide;
|
||||
|
||||
/**
|
||||
* Removes the HUD from its parent view when hidden.
|
||||
* Defaults to NO.
|
||||
*/
|
||||
@property (assign) BOOL removeFromSuperViewOnHide;
|
||||
/// @name Appearance
|
||||
|
||||
/**
|
||||
* Font to be used for the main label. Set this property if the default is not adequate.
|
||||
* MBProgressHUD operation mode. The default is MBProgressHUDModeIndeterminate.
|
||||
*/
|
||||
@property (MB_STRONG) UIFont* labelFont;
|
||||
@property (assign, nonatomic) MBProgressHUDMode mode;
|
||||
|
||||
/**
|
||||
* Color to be used for the main label. Set this property if the default is not adequate.
|
||||
* A color that gets forwarded to all labels and supported indicators. Also sets the tintColor
|
||||
* for custom views on iOS 7+. Set to nil to manage color individually.
|
||||
* Defaults to semi-translucent black on iOS 7 and later and white on earlier iOS versions.
|
||||
*/
|
||||
@property (MB_STRONG) UIColor* labelColor;
|
||||
@property (strong, nonatomic, nullable) UIColor *contentColor UI_APPEARANCE_SELECTOR;
|
||||
|
||||
/**
|
||||
* Font to be used for the details label. Set this property if the default is not adequate.
|
||||
* The animation type that should be used when the HUD is shown and hidden.
|
||||
*/
|
||||
@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;
|
||||
@property (assign, nonatomic) MBProgressHUDAnimation animationType UI_APPEARANCE_SELECTOR;
|
||||
|
||||
/**
|
||||
* The color of the activity indicator. Defaults to [UIColor whiteColor]
|
||||
* Does nothing on pre iOS 5.
|
||||
* The bezel offset relative to the center of the view. You can use MBProgressMaxOffset
|
||||
* and -MBProgressMaxOffset to move the HUD all the way to the screen edge in each direction.
|
||||
* E.g., CGPointMake(0.f, MBProgressMaxOffset) would position the HUD centered on the bottom edge.
|
||||
*/
|
||||
@property (MB_STRONG) UIColor *activityIndicatorColor;
|
||||
@property (assign, nonatomic) CGPoint offset UI_APPEARANCE_SELECTOR;
|
||||
|
||||
/**
|
||||
* The progress of the progress indicator, from 0.0 to 1.0. Defaults to 0.0.
|
||||
/**
|
||||
* The amount of space between the HUD edge and the HUD elements (labels, indicators or custom views).
|
||||
* This also represents the minimum bezel distance to the edge of the HUD view.
|
||||
* Defaults to 20.f
|
||||
*/
|
||||
@property (assign) float progress;
|
||||
@property (assign, nonatomic) CGFloat margin UI_APPEARANCE_SELECTOR;
|
||||
|
||||
/**
|
||||
* The minimum size of the HUD bezel. Defaults to CGSizeZero (no minimum size).
|
||||
*/
|
||||
@property (assign) CGSize minSize;
|
||||
|
||||
@property (assign, nonatomic) CGSize minSize UI_APPEARANCE_SELECTOR;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Force the HUD dimensions to be equal if possible.
|
||||
*/
|
||||
@property (atomic, assign, readonly) CGSize size;
|
||||
|
||||
@property (assign, nonatomic, getter = isSquare) BOOL square UI_APPEARANCE_SELECTOR;
|
||||
|
||||
/**
|
||||
* Force the HUD dimensions to be equal if possible.
|
||||
* When enabled, the bezel center gets slightly affected by the device accelerometer data.
|
||||
* Has no effect on iOS < 7.0. Defaults to YES.
|
||||
*/
|
||||
@property (assign, getter = isSquare) BOOL square;
|
||||
@property (assign, nonatomic, getter=areDefaultMotionEffectsEnabled) BOOL defaultMotionEffectsEnabled UI_APPEARANCE_SELECTOR;
|
||||
|
||||
/// @name Progress
|
||||
|
||||
/**
|
||||
* The progress of the progress indicator, from 0.0 to 1.0. Defaults to 0.0.
|
||||
*/
|
||||
@property (assign, nonatomic) float progress;
|
||||
|
||||
/// @name ProgressObject
|
||||
|
||||
/**
|
||||
* The NSProgress object feeding the progress information to the progress indicator.
|
||||
*/
|
||||
@property (strong, nonatomic, nullable) NSProgress *progressObject;
|
||||
|
||||
/// @name Views
|
||||
|
||||
/**
|
||||
* The view containing the labels and indicator (or customView).
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) MBBackgroundView *bezelView;
|
||||
|
||||
/**
|
||||
* View covering the entire HUD area, placed behind bezelView.
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) MBBackgroundView *backgroundView;
|
||||
|
||||
/**
|
||||
* The UIView (e.g., a UIImageView) to be shown when the HUD is in MBProgressHUDModeCustomView.
|
||||
* The view should implement intrinsicContentSize for proper sizing. For best results use approximately 37 by 37 pixels.
|
||||
*/
|
||||
@property (strong, nonatomic, nullable) UIView *customView;
|
||||
|
||||
/**
|
||||
* A label that holds an optional short message to be displayed below the activity indicator. The HUD is automatically resized to fit
|
||||
* the entire text.
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) UILabel *label;
|
||||
|
||||
/**
|
||||
* A label that holds an optional details message displayed below the labelText message. The details text can span multiple lines.
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) UILabel *detailsLabel;
|
||||
|
||||
/**
|
||||
* A button that is placed below the labels. Visible only if a target / action is added.
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) UIButton *button;
|
||||
|
||||
@end
|
||||
|
||||
@@ -472,15 +329,16 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
|
||||
/**
|
||||
* Indicator progress color.
|
||||
* Defaults to white [UIColor whiteColor]
|
||||
* Defaults to white [UIColor whiteColor].
|
||||
*/
|
||||
@property (nonatomic, MB_STRONG) UIColor *progressTintColor;
|
||||
@property (nonatomic, strong) UIColor *progressTintColor;
|
||||
|
||||
/**
|
||||
* Indicator background (non-progress) color.
|
||||
* Defaults to translucent white (alpha 0.1)
|
||||
* Indicator background (non-progress) color.
|
||||
* Only applicable on iOS versions older than iOS 7.
|
||||
* Defaults to translucent white (alpha 0.1).
|
||||
*/
|
||||
@property (nonatomic, MB_STRONG) UIColor *backgroundTintColor;
|
||||
@property (nonatomic, strong) UIColor *backgroundTintColor;
|
||||
|
||||
/*
|
||||
* Display mode - NO = round or YES = annular. Defaults to round.
|
||||
@@ -504,18 +362,74 @@ typedef void (^MBProgressHUDCompletionBlock)();
|
||||
* Bar border line color.
|
||||
* Defaults to white [UIColor whiteColor].
|
||||
*/
|
||||
@property (nonatomic, MB_STRONG) UIColor *lineColor;
|
||||
@property (nonatomic, strong) UIColor *lineColor;
|
||||
|
||||
/**
|
||||
* Bar background color.
|
||||
* Defaults to clear [UIColor clearColor];
|
||||
*/
|
||||
@property (nonatomic, MB_STRONG) UIColor *progressRemainingColor;
|
||||
@property (nonatomic, strong) UIColor *progressRemainingColor;
|
||||
|
||||
/**
|
||||
* Bar progress color.
|
||||
* Defaults to white [UIColor whiteColor].
|
||||
*/
|
||||
@property (nonatomic, MB_STRONG) UIColor *progressColor;
|
||||
@property (nonatomic, strong) UIColor *progressColor;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface MBBackgroundView : UIView
|
||||
|
||||
/**
|
||||
* The background style.
|
||||
* Defaults to MBProgressHUDBackgroundStyleBlur on iOS 7 or later and MBProgressHUDBackgroundStyleSolidColor otherwise.
|
||||
* @note Due to iOS 7 not supporting UIVisualEffectView, the blur effect differs slightly between iOS 7 and later versions.
|
||||
*/
|
||||
@property (nonatomic) MBProgressHUDBackgroundStyle style;
|
||||
|
||||
/**
|
||||
* The background color or the blur tint color.
|
||||
* @note Due to iOS 7 not supporting UIVisualEffectView, the blur effect differs slightly between iOS 7 and later versions.
|
||||
*/
|
||||
@property (nonatomic, strong) UIColor *color;
|
||||
|
||||
@end
|
||||
|
||||
@interface MBProgressHUD (Deprecated)
|
||||
|
||||
+ (NSArray *)allHUDsForView:(UIView *)view __attribute__((deprecated("Store references when using more than one HUD per view.")));
|
||||
+ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated __attribute__((deprecated("Store references when using more than one HUD per view.")));
|
||||
|
||||
- (id)initWithWindow:(UIWindow *)window __attribute__((deprecated("Use initWithView: instead.")));
|
||||
|
||||
- (void)show:(BOOL)animated __attribute__((deprecated("Use showAnimated: instead.")));
|
||||
- (void)hide:(BOOL)animated __attribute__((deprecated("Use hideAnimated: instead.")));
|
||||
- (void)hide:(BOOL)animated afterDelay:(NSTimeInterval)delay __attribute__((deprecated("Use hideAnimated:afterDelay: instead.")));
|
||||
|
||||
- (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(BOOL)animated __attribute__((deprecated("Use GCD directly.")));
|
||||
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block __attribute__((deprecated("Use GCD directly.")));
|
||||
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block completionBlock:(nullable MBProgressHUDCompletionBlock)completion __attribute__((deprecated("Use GCD directly.")));
|
||||
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue __attribute__((deprecated("Use GCD directly.")));
|
||||
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue
|
||||
completionBlock:(nullable MBProgressHUDCompletionBlock)completion __attribute__((deprecated("Use GCD directly.")));
|
||||
@property (assign) BOOL taskInProgress __attribute__((deprecated("No longer needed.")));
|
||||
|
||||
@property (nonatomic, copy) NSString *labelText __attribute__((deprecated("Use label.text instead.")));
|
||||
@property (nonatomic, strong) UIFont *labelFont __attribute__((deprecated("Use label.font instead.")));
|
||||
@property (nonatomic, strong) UIColor *labelColor __attribute__((deprecated("Use label.textColor instead.")));
|
||||
@property (nonatomic, copy) NSString *detailsLabelText __attribute__((deprecated("Use detailsLabel.text instead.")));
|
||||
@property (nonatomic, strong) UIFont *detailsLabelFont __attribute__((deprecated("Use detailsLabel.font instead.")));
|
||||
@property (nonatomic, strong) UIColor *detailsLabelColor __attribute__((deprecated("Use detailsLabel.textColor instead.")));
|
||||
@property (assign, nonatomic) CGFloat opacity __attribute__((deprecated("Customize bezelView properties instead.")));
|
||||
@property (strong, nonatomic) UIColor *color __attribute__((deprecated("Customize the bezelView color instead.")));
|
||||
@property (assign, nonatomic) CGFloat xOffset __attribute__((deprecated("Set offset.x instead.")));
|
||||
@property (assign, nonatomic) CGFloat yOffset __attribute__((deprecated("Set offset.y instead.")));
|
||||
@property (assign, nonatomic) CGFloat cornerRadius __attribute__((deprecated("Set bezelView.layer.cornerRadius instead.")));
|
||||
@property (assign, nonatomic) BOOL dimBackground __attribute__((deprecated("Customize HUD background properties instead.")));
|
||||
@property (strong, nonatomic) UIColor *activityIndicatorColor __attribute__((deprecated("Use UIAppearance to customize UIActivityIndicatorView. E.g.: [UIActivityIndicatorView appearanceWhenContainedIn:[MBProgressHUD class], nil].color = [UIColor redColor];")));
|
||||
@property (atomic, assign, readonly) CGSize size __attribute__((deprecated("Get the bezelView.frame.size instead.")));
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "MBProgressHUD"
|
||||
s.version = "0.9.2"
|
||||
s.version = "1.0.0"
|
||||
s.summary = "An iOS activity indicator view."
|
||||
s.description = <<-DESC
|
||||
MBProgressHUD is an iOS drop-in class that displays a translucent HUD
|
||||
@@ -12,8 +12,9 @@ Pod::Spec.new do |s|
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
s.author = { 'Matej Bukovinski' => 'matej@bukovinski.com' }
|
||||
s.source = { :git => "https://github.com/matej/MBProgressHUD.git", :tag => s.version.to_s }
|
||||
s.platform = :ios
|
||||
s.ios.deployment_target = '6.0'
|
||||
s.tvos.deployment_target = '9.0'
|
||||
s.source_files = '*.{h,m}'
|
||||
s.framework = "CoreGraphics"
|
||||
s.frameworks = "CoreGraphics", "QuartzCore"
|
||||
s.requires_arc = true
|
||||
end
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
CLASSPREFIX = MB;
|
||||
LastUpgradeCheck = 0630;
|
||||
LastUpgradeCheck = 0700;
|
||||
ORGANIZATIONNAME = "Matej Bukovinski";
|
||||
TargetAttributes = {
|
||||
1D104D791ACA36CC00973364 = {
|
||||
@@ -224,6 +224,7 @@
|
||||
1D104D8E1ACA36CC00973364 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -246,6 +247,7 @@
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.matej.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = MBProgressHUD;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
@@ -257,6 +259,7 @@
|
||||
1D104D8F1ACA36CC00973364 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -277,6 +280,7 @@
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.matej.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = MBProgressHUD;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
@@ -291,6 +295,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
@@ -300,6 +305,7 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
@@ -316,7 +322,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
@@ -328,6 +334,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
@@ -346,7 +353,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
|
||||
@@ -1,55 +1,66 @@
|
||||
# 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://codecov.io/github/matej/MBProgressHUD?branch=master)
|
||||
[](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) [](https://cocoapods.org/pods/MBProgressHUD) [](http://opensource.org/licenses/MIT)
|
||||
|
||||
[](http://dl.dropbox.com/u/378729/MBProgressHUD/1.png)
|
||||
[](http://dl.dropbox.com/u/378729/MBProgressHUD/2.png)
|
||||
[](http://dl.dropbox.com/u/378729/MBProgressHUD/3.png)
|
||||
[](http://dl.dropbox.com/u/378729/MBProgressHUD/4.png)
|
||||
[](http://dl.dropbox.com/u/378729/MBProgressHUD/5.png)
|
||||
[](http://dl.dropbox.com/u/378729/MBProgressHUD/6.png)
|
||||
[](http://dl.dropbox.com/u/378729/MBProgressHUD/7.png)
|
||||
`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://cloud.githubusercontent.com/assets/91322/26737572/94a137a6-477f-11e7-9778-6266006f2dba.png)
|
||||
[](https://cloud.githubusercontent.com/assets/91322/26737575/95178c6c-477f-11e7-8df9-03aeeca5d39d.png)
|
||||
[](https://cloud.githubusercontent.com/assets/91322/26737578/95235920-477f-11e7-9968-9ecf506aba06.png)
|
||||
[](https://cloud.githubusercontent.com/assets/91322/26737573/95048432-477f-11e7-8f1d-4d5736b10488.)
|
||||
[](https://cloud.githubusercontent.com/assets/91322/26737580/954aff70-477f-11e7-9634-5802daea2dee.png)
|
||||
[](https://cloud.githubusercontent.com/assets/91322/26737582/9552886c-477f-11e7-8e90-46acd9a8527c.png)
|
||||
[](https://cloud.githubusercontent.com/assets/91322/26737584/956392f6-477f-11e7-918f-717a42758156.png)
|
||||
|
||||
**NOTE:** The class has recently undegone a major rewrite. The old version is available in the [legacy](https://github.com/jdg/MBProgressHUD/tree/legacy) branch, should you need it.
|
||||
|
||||
## Requirements
|
||||
|
||||
MBProgressHUD works on any iOS version and is compatible with both ARC and non-ARC projects. It depends on the following Apple frameworks, which should already be included with most Xcode templates:
|
||||
`MBProgressHUD` works on iOS 6+ and requires ARC to build. It depends on the following Apple frameworks, which should already be included with most Xcode templates:
|
||||
|
||||
* Foundation.framework
|
||||
* UIKit.framework
|
||||
* CoreGraphics.framework
|
||||
|
||||
You will need the latest developer tools in order to build MBProgressHUD. Old Xcode versions might work, but compatibility will not be explicitly maintained.
|
||||
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
|
||||
|
||||
### Cocoapods
|
||||
### CocoaPods
|
||||
|
||||
[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.9.2'`
|
||||
1. Add a pod entry for MBProgressHUD to your Podfile `pod 'MBProgressHUD', '~> 1.0.0'`
|
||||
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" ~> 1.0.0`
|
||||
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 +72,9 @@ 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.
|
||||
You can add the HUD on any view or window. It is however a good idea to avoid adding the HUD to certain `UIKit` views with complex view hierarchies - like `UITableView` or `UICollectionView`. Those can mutate their subviews in unexpected ways and thereby break HUD display.
|
||||
|
||||
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];
|
||||
@@ -74,6 +87,18 @@ hud.labelText = @"Loading";
|
||||
}];
|
||||
```
|
||||
|
||||
You can also use a `NSProgress` object and MBProgressHUD will update itself when there is progress reported through that object.
|
||||
|
||||
```objective-c
|
||||
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
hud.mode = MBProgressHUDModeAnnularDeterminate;
|
||||
hud.labelText = @"Loading";
|
||||
NSProgress *progress = [self doSomethingInBackgroundCompletion:^{
|
||||
[hud hide:YES];
|
||||
}];
|
||||
hud.progressObject = progress;
|
||||
```
|
||||
|
||||
UI updates should always be done on the main thread. Some MBProgressHUD setters are however considered "thread safe" and can be called from background threads. Those also include `setMode:`, `setCustomView:`, `setLabelText:`, `setLabelFont:`, `setDetailsLabelText:`, `setDetailsLabelFont:` and `setProgress:`.
|
||||
|
||||
If you need to run your long-running task in the main thread, you should perform it with a slight delay, so UIKit will have enough time to update the UI (i.e., draw the HUD) before you block the main thread with your task.
|
||||
@@ -94,8 +119,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 [wiki](https://github.com/matej/MBProgressHUD/wiki/Change-log).
|
||||
A brief summary of each MBProgressHUD release can be found in the [CHANGELOG](CHANGELOG.mdown).
|
||||
|
||||