139 Commits

Author SHA1 Message Date
Mateusz Matrejek 4a7c5f3e53 #647: Adds Privacy Manifest as Package.swift resource (#653)
* #647: Adds Privacy Manifest as Package.swift resource

* #647: Bumps swift-tools-version in Package.swift
2024-05-10 09:52:44 +02:00
Jonathan George 18c442d573 Merge pull request #652 from CH3COOH/feature/add_privacy_info
Support for Privacy Manifest
2024-03-19 09:32:46 -05:00
Kenji Wada 2c62462e38 Update MBProgressHUD.podspec 2024-03-15 17:37:50 +09:00
Kenji Wada 9682b56446 Update MBProgressHUD.podspec 2024-03-15 17:26:09 +09:00
Kenji Wada 684e5b7160 Add Privacy Info 2024-01-12 21:14:41 +09:00
Owen Thomas c843e4c86d Update minimum deployment target to iOS 9.0 (#616) 2020-11-25 13:57:02 +01:00
Matej Bukovinski 9bed52746a Merge pull request #608 from dvshelley/deploymentTarget9
change deployment target to iOS 9 to fix Archiving with Xcode 12
2020-11-20 20:42:46 +01:00
Matej Bukovinski 38dc9aa471 Fix typos 2020-11-06 16:48:40 +01:00
Matej Bukovinski 73cc7ba023 Add link to SDK Privacy Practices 2020-11-06 16:31:57 +01:00
Matej Bukovinski 9ce87e2a54 Merge pull request #602 from alexshepard/patch-1
fix simple typo in Readme
2020-09-08 06:53:21 +02:00
Daniel Shelley 71b7092441 change deployment target to iOS 9 to fix Archiving with Xcode 12 2020-07-17 16:30:33 -06:00
Alex Shepard 11fc6023b4 fix typo 2020-05-21 11:41:41 -07:00
Matej Bukovinski 61fb89ce30 Update copyright year 2020-02-19 12:55:10 +01:00
Matej Bukovinski 5097c9c14f Silence tvOS warning 2020-02-19 12:55:10 +01:00
Matej Bukovinski 24ff51d11d Remove the note about the not-so-recent rewrite 2020-01-13 23:19:30 +01:00
Matej Bukovinski 794de3587a Bump version 2020-01-13 21:34:29 +01:00
Matej Bukovinski 049b2f4dbd Update iOS version support note 2020-01-13 21:28:11 +01:00
Matej Bukovinski 3958dc56bf Add Catalyst support in the demo 2020-01-13 21:23:14 +01:00
Matej Bukovinski bf145ece96 Fix warnings on Mac Catalyst 2020-01-13 21:23:14 +01:00
Matej Bukovinski 74abf4aa76 Add conditionals to avoid warnings with UIActivityIndicatorViewStyleWhiteLarge 2020-01-13 21:23:14 +01:00
Matej Bukovinski 501fb0d0bc Enable testing from HudDemo 2020-01-13 21:23:14 +01:00
Matej Bukovinski c4d965d2c0 Merge pull request #581 from emreberge/master
Fix build warnings related to iOS 13 and Mac catalyst
2020-01-13 19:33:41 +01:00
Matej Bukovinski 898f027554 Merge pull request #564 from AccioSupport/master
Add support for SwiftPM & Accio
2020-01-09 08:52:43 +01:00
Cihat Gündüz be98d2d1cb [README] Add installation documentation for SwiftPM 2019-12-31 09:57:39 +01:00
Cihat Gündüz 8c7f89a5b9 [README] Add badge for SwiftPM support 2019-12-31 09:34:02 +01:00
Bruno Coelho 75673fdecc Fix SwiftPM naming issue using modulemap
# Conflicts:
#	Package.swift
2019-12-31 09:30:09 +01:00
Cihat Gündüz d18733fef4 [README] Document support & installation via Accio 2019-12-31 09:20:42 +01:00
Cihat Gündüz 5dcbf5b191 Add basic SwiftPM manifest file 2019-12-31 09:20:42 +01:00
Elffin Farnon-Turner 915134629f Update Contributing docs 2019-12-16 22:20:50 +01:00
Matej Bukovinski 0c7ea5defd Merge pull request #590 from matej/matej/updates
Updates for latest iOS and Xcode
2019-12-16 22:18:38 +01:00
Matej Bukovinski 3fdde685bc Remove UILaunchImages 2019-12-16 22:04:16 +01:00
Matej Bukovinski 0581fc848d Tweak example UI for Dark Mode 2019-12-16 22:00:55 +01:00
Matej Bukovinski 9ba89d33f7 Use a thicker material 2019-12-16 21:53:38 +01:00
Matej Bukovinski 3aa49153e1 Switch to appletvsimulator sdk 2019-12-16 21:31:34 +01:00
Matej Bukovinski 998d32df35 Disable code signing 2019-12-16 21:15:37 +01:00
Matej Bukovinski bf31ebe9e6 Address more tvOS issues 2019-12-16 21:15:24 +01:00
Matej Bukovinski cb9d028f2a Bump simulator version 2019-12-16 20:40:06 +01:00
Matej Bukovinski ace36f8aa2 Clean up code code sign config 2019-12-16 18:12:40 +01:00
Matej Bukovinski d0669df745 Adjust tvOS compatibility 2019-12-16 18:08:40 +01:00
Matej Bukovinski 7bedf36884 Update simulator version 2019-12-16 17:33:54 +01:00
Matej Bukovinski 48f79c8e20 Remove explicit xcpretty setup 2019-12-16 15:57:28 +01:00
Matej Bukovinski b0db9a82c4 Fix tvOS build and use better defaults for the background view 2019-12-16 15:53:56 +01:00
Matej Bukovinski 27d9ade6ea Bump Xcode on CI 2019-12-16 15:37:39 +01:00
Matej Bukovinski 1ec0e9cf81 Resolve Xcode warnings 2019-12-16 15:33:06 +01:00
Matej Bukovinski 116ae6bb45 Merge pull request #579 from larsschwegmann/master
Add iOS 13 Dark Mode support
2019-12-16 15:30:24 +01:00
Matej Bukovinski 3139692a41 Merge pull request #585 from dvshelley/master
fix Xcode 11 warnings, default localization
2019-12-16 15:13:22 +01:00
Matej Bukovinski deb72a4a7b Merge pull request #588 from rojo69/master
Empty button shown beneath spinner when latest Facebook SDK is used.
2019-12-16 15:12:35 +01:00
Roger Jönsson 25aed45cc8 Changed to an "or" statement. 2019-12-10 15:12:11 +01:00
Roger Jönsson bf2f7fb663 Only display button if it has no targets and no title. Latest version of Facebook SDK add targets to most buttons in order to track conversions (I guess). 2019-12-10 14:53:32 +01:00
Daniel Shelley f0e2b694b0 fix Xcode 11 warnings, default localization 2019-11-20 10:36:11 -07:00
Emre Berge Ergenekon a570ddafc4 Don't track status bar orientation on mac catalyst 2019-08-28 12:50:00 -04:00
Emre Berge Ergenekon 60983ca46c Handle deprecated UIActivityIndicatorViewStyleWhiteLarge when building with iOS 13 SDK 2019-08-28 12:48:58 -04:00
Lars Schwegmann 0a86894703 Change UIBlurEffectStyle 2019-08-08 17:06:15 +02:00
Lars Schwegmann e2d8b33d03 Add iOS 13 Dark Mode support 2019-08-08 15:27:33 +02:00
Matej Bukovinski d2842c9124 Merge pull request #567 from jhildensperger/patch-1
MBProgressHUD.h Fix typo in comment
2019-07-14 22:27:33 +02:00
Matej Bukovinski 9c9771ef27 Merge pull request #572 from kervich/master
Fix swift compiler error
2019-07-14 22:26:54 +02:00
Matej Bukovinski d52dc41576 Merge pull request #558 from andyRon/patch-1
Update MBProgressHUD.h
2019-07-14 22:25:45 +02:00
Matej Bukovinski 9a0d8e288d Disable motion effects by default 2019-07-14 22:12:49 +02:00
Matej Bukovinski 71ab8c0b52 Remove debug code 2019-07-14 22:10:56 +02:00
Matej Bukovinski c9cde526db Merge pull request #578 from matej/matej/motion
Lazy motion effects init
2019-07-14 22:03:01 +02:00
Matej Bukovinski f25d9697f2 Modify motion effect initialization
to ensure the motion effects are not instantiated needlessly.
2019-07-14 21:57:39 +02:00
Matej Bukovinski 4d90a04699 Remove runtime checks
They are  not needed on iOS 8 and later.
2019-07-14 21:28:40 +02:00
Matej Bukovinski df1a29bfa8 Update for iOS 8 2019-07-14 21:27:29 +02:00
Matej Bukovinski bdd4ca3272 Remove obsolete SDK checks 2019-07-14 21:27:10 +02:00
Andrey Yurkevivch dcd72533c8 Fix swift compiler error
Swift compiler treats `MBProgressHUD.HUDForView(_ view:)` as erroneous
method, suggesting a fix-it that replaces the call with `.init(with view:)`
Adding an NS_SWIFT_NAME with non-capitalized function name solves
the issue (and makes swift API more intuitive)
2019-06-14 12:15:42 +03:00
Jim Hildensperger 3c410dd1ff Fix typo in comment 2019-05-02 14:21:28 +02:00
Andy Ron 29b8447b9c Update MBProgressHUD.h 2019-01-05 11:44:24 +08:00
Matej Bukovinski 202d8895c6 Merge pull request #91 from matej/matej/test-shape
Add HUD shape test
2018-11-04 19:23:25 +01:00
Matej Bukovinski 2347f40e0f Merge pull request #548 from matej/matej/remove-legacy
Remove legacy checks
2018-11-04 19:20:59 +01:00
Matej Bukovinski b934604028 Merge pull request #549 from matej/matej/test-order
Test order
2018-11-04 19:20:44 +01:00
Matej Bukovinski 04747f8b3d Add test for https://github.com/jdg/MBProgressHUD/pull/525 2018-11-04 19:19:20 +01:00
Matej Bukovinski 80f66aa5e7 Remove iOS 7 header code 2018-11-04 19:00:17 +01:00
Matej Bukovinski 257ec88cbc Remove legacy checks (deployment target is already >= iOS 8) 2018-11-04 18:53:31 +01:00
Matej Bukovinski 27c21b2907 Remove whitespace 2018-11-04 18:36:27 +01:00
Matej Bukovinski 8782fbf288 Merge pull request #525 from nicolasgomollon/master
Fixed bug with subview ordering.
2018-11-04 18:32:31 +01:00
Matej Bukovinski 8df5e8ca98 Merge pull request #528 from wenxiangjiang/master
Remove deprecated code
2018-05-16 19:47:54 +02:00
Matej Bukovinski c161ea4227 Merge pull request #530 from Coeur/master
Updating project for Xcode 9.3 recommended settings.
2018-05-16 11:17:46 +02:00
Antoine Cœur d591e1a8e2 Updating project for Xcode 9.3 recommended settings. 2018-04-23 13:24:28 +08:00
Liu Peng e23fad1476 Remove deprecated code 2018-03-06 22:43:05 +08:00
Nicolas Gomollon 56fe3e6a87 Fixed bug with subview ordering.
Fixed bugs jdg/MBProgressHUD#516 and jdg/MBProgressHUD#509
2018-02-19 16:02:43 -08:00
Matej Bukovinski b74d8e890e Add HUD shape test 2018-02-07 18:39:05 +01:00
Matej Bukovinski c954ef3806 Merge pull request #513 from niveus/Remove-NSLog
Remove NSLog
2017-11-30 21:19:46 +01:00
jason c63cf1840e Remove NSLog 2017-11-30 09:52:15 -08:00
Matej Bukovinski a90765f5f2 Merge pull request #90 from matej/matej/hide-timer-race
Prevent a race when invalidating the hide timer
2017-11-29 10:58:30 +01:00
Matej Bukovinski 549fa28546 Add a test case for the hide delayed race 2017-11-29 10:00:37 +01:00
Matej Bukovinski 1f1d7ce8bd Use the new method signature in comments 2017-11-29 09:28:36 +01:00
Matej Bukovinski 16e8622f52 Prevent a race when invalidating the hide timer 2017-11-29 09:27:03 +01:00
Matej Bukovinski f851a0bde0 Add CONTRIBUTING guidelines 2017-11-14 09:11:12 +01:00
Matej Bukovinski ef9bd9679f Test some HUD modes 2017-11-12 18:17:33 +01:00
Matej Bukovinski d34d348a6a Test initializers 2017-11-12 17:04:42 +01:00
Matej Bukovinski 364a0fad0b Remove a deprecated property 2017-11-12 16:57:56 +01:00
Matej Bukovinski d4166737ca Improve documentation 2017-11-12 16:35:32 +01:00
Matej Bukovinski 643b58c62f Remove deprecated code 2017-11-12 16:25:27 +01:00
Matej Bukovinski 8839e57987 Prevent calling UI code on background threads 2017-11-12 16:11:49 +01:00
Matej Bukovinski 7e02366094 Bump deployment target 2017-11-12 11:28:10 +01:00
Matej Bukovinski ec887003cc Release 1.1 2017-11-12 09:51:07 +01:00
Matej Bukovinski 17ac00a076 Update screenshot references 2017-11-05 19:29:51 +01:00
Matej Bukovinski 96d3e9c424 Merge branch 'master' of github.com:jdg/MBProgressHUD 2017-11-05 18:34:35 +01:00
Florian Morello 4131642c82 cleanup 2017-11-05 18:34:09 +01:00
Florian Morello 7777e6dec8 sharing scheme tvos 2017-11-05 18:34:09 +01:00
Florian Morello 2de9404fff create tvos target 2017-11-05 18:34:09 +01:00
Matej Bukovinski 07be9e2326 Merge pull request #418 from arsonik/master
tvOS Framework
2017-11-04 19:23:46 +01:00
Matej Bukovinski 337d7c5c0d Merge branch 'master' of github.com:jdg/MBProgressHUD 2017-11-04 19:19:33 +01:00
jasonwu127@gmail.com 4f620828d8 for MBBarProgressView: 1.use CGContextDrawPath with kCGPathFillStroke instead of CGContextFillPath and CGContextStokePath; 2. delete redundant CGContextAddLineToPoint 2017-11-04 19:19:16 +01:00
こぴなたみぽ 60853bb7c3 Update README.mdown 2017-11-04 19:19:16 +01:00
Wolfgang Lutz 2d0b0e0540 fix typos using misspell 2017-11-04 19:19:16 +01:00
Jason Gavris 8919a10146 Add support for configuring blur effect style 2017-11-04 19:19:16 +01:00
Matej Bukovinski 69fbbf6704 Merge pull request #415 from molon/master
Keep bounds.origin is always CGPointZero
2017-11-04 19:15:35 +01:00
Matej Bukovinski 9097100c14 Merge pull request #434 from esetnik/master
update gitignore for carthage submodules support
2017-11-04 19:14:01 +01:00
Matej Bukovinski 3383703d3e Merge pull request #446 from CoderLT/master
Cancel any scheduled hideDelayed
2017-11-04 18:56:32 +01:00
Matej Bukovinski d235a969bc Merge pull request #466 from ButterflyNetwork/blur-effect-style
Add support for configuring blur effect style
2017-11-04 18:37:12 +01:00
Matej Bukovinski 48e100ed08 Merge pull request #476 from fixTypos/fix_typos
fix typos using misspell
2017-11-04 18:24:22 +01:00
Matej Bukovinski 862c2003a7 Merge pull request #477 from syuilo/master
Fix typo
2017-11-04 18:22:54 +01:00
Matej Bukovinski 9a019cb420 Merge pull request #497 from foolish-boy/master
for MBBarProgressView: 1.use CGContextDrawPath with kCGPathFillStroke…
2017-11-04 18:20:38 +01:00
Matej Bukovinski 1afb2dce67 Add missing icons 2017-11-03 19:56:21 +01:00
Matej Bukovinski 63f5e9ec5e Fix group references 2017-11-03 19:47:26 +01:00
Matej Bukovinski b508641808 Reference new API. 2017-11-03 18:42:07 +01:00
Matej Bukovinski 503daa92d0 Merge pull request #88 from matej/matej/xc9-iOS11
Xcode 9 and iOS 11 changes
2017-11-03 18:31:12 +01:00
Matej Bukovinski bb26c1046d Move to xcodebuild 2017-10-27 11:27:52 +02:00
Matej Bukovinski 809662b2a8 Revert "Don't clean"
This reverts commit dc9257d448.
2017-10-19 21:47:08 +02:00
Matej Bukovinski dc9257d448 Don't clean 2017-10-19 20:30:03 +02:00
Matej Bukovinski 2db1b9f52b Merge pull request #86 from sushant40/master
Fixing example
2017-10-19 19:17:37 +02:00
Matej Bukovinski 3e2e49ea58 Update travis to Xcode 9 2017-10-19 19:09:38 +02:00
Matej Bukovinski b6b64697d5 Apply project modernization 2017-10-19 19:04:36 +02:00
jasonwu127@gmail.com af1f2ba839 for MBBarProgressView: 1.use CGContextDrawPath with kCGPathFillStroke instead of CGContextFillPath and CGContextStokePath; 2. delete redundant CGContextAddLineToPoint 2017-08-28 11:26:34 +05:30
Matej Bukovinski ddd6a21502 Merge pull request #495 from filmhomage/patch-1
Fix broken image link in README.md
2017-08-24 18:50:29 +02:00
Jonghyun Kim 2926f383dc Fix broken image link. in README.md 2017-08-22 11:18:09 +02:00
Matej Bukovinski bcd2aa4020 Merge pull request #87 from DwayneCoussement/strict-prototype
CLANG_WARN_STRICT_PROTOTYPES: Yes please!
2017-08-16 11:29:53 +02:00
Dwayne Coussement 93b904c8d8 CLANG_WARN_STRICT_PROTOTYPES: Yes please! 2017-08-14 14:36:35 +02:00
こぴなたみぽ 66c322e239 Update README.mdown 2017-05-23 19:12:58 +09:00
Wolfgang Lutz 546b96ddb0 fix typos using misspell 2017-05-20 12:01:50 +02:00
Sushant Verma 4fc565d856 Fixing example 2017-05-18 11:24:32 +10:00
Jason Gavris ea0d907fff Add support for configuring blur effect style 2017-03-16 17:20:37 -04:00
神秘de路人甲 93ed629c62 Cancel any scheduled hideDelayed
Cancel any scheduled hideDelayed
2016-11-03 18:57:38 +08:00
Ethan Setnik e52e83e428 update gitignore for carthage submodules support 2016-09-19 12:31:58 -04:00
Florian Morello 89f63d0f1f cleanup 2016-08-30 10:58:32 +02:00
Florian Morello 93dac913fa sharing scheme tvos 2016-08-30 10:34:50 +02:00
Florian Morello 489a91eeda create tvos target 2016-08-30 10:33:45 +02:00
molon 374a708c7c Keep bounds.origin is always CGPointZero 2016-08-20 18:00:53 +08:00
39 changed files with 976 additions and 625 deletions
+3
View File
@@ -23,3 +23,6 @@ profile
# Ruby
.ruby-version
# Carthage
Carthage/Build
+16 -5
View File
@@ -1,8 +1,19 @@
language: objective-c
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
osx_image: xcode11.2
before_install:
- env
- locale
- xcpretty --version
- xcodebuild -version
- xcodebuild -showsdks
script:
- set -o pipefail
- xcodebuild clean build -workspace MBProgressHUD.xcworkspace -scheme HudDemo -sdk iphonesimulator -configuration Debug | xcpretty -c
- xcodebuild clean build -workspace MBProgressHUD.xcworkspace -scheme HudDemoTV -sdk appletvsimulator -configuration Debug | xcpretty -c
- xcodebuild clean build test -workspace MBProgressHUD.xcworkspace -scheme HudTests -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPad Air (3rd generation),OS=13.2.2" -configuration Debug GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c
after_success:
- bash <(curl -s https://codecov.io/bash)
+64
View File
@@ -0,0 +1,64 @@
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
# Using the issue tracker
The issue tracker is the preferred channel for [bug reports](#bugs) and
[features requests](#features), but please respect the following restriction:
* Please **do not** use the issue tracker for personal support requests (use
a service like [Stack Overflow](http://stackoverflow.com) instead).
<a name="bugs"></a>
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful - thank you!
Guidelines for bug reports:
1. **Use the GitHub issue search** &mdash; check if the issue has already been
reported.
2. **Check if the issue has been fixed** &mdash; try to reproduce it using the
latest `master` branch in the repository.
3. **Isolate the problem** &mdash; provide exact reproduction steps, preferably
in the form of a failing test case or by providing modification steps in the
`MBProgressHUD` Demo application.
A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What iOS version did
you use? What would you expect to be the outcome?
<a name="features"></a>
## Feature requests
Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible.
<a name="pull-requests"></a>
# Pull requests
Good pull requests - patches, improvements, new features - are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.
**Please ask first** before embarking on any significant pull request (e.g.
implementing features, refactoring code, porting to a different language),
otherwise you risk spending a lot of time working on something that the
project's developers might not want to merge into the project.
Please adhere to the coding conventions used throughout a project (indentation,
accurate comments, etc.) and any other requirements (such as test coverage).
**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
license your work under the same license as that used by the project.
This document is based on https://github.com/necolas/issue-guidelines/blob/master/CONTRIBUTING.md.
+53 -14
View File
@@ -24,6 +24,7 @@
D27F18641D3B5E21009D7482 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D27F18611D3B5E21009D7482 /* Main.storyboard */; };
D286A76D1518CA9F00E13FB8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D286A76C1518CA9F00E13FB8 /* CoreGraphics.framework */; };
D2B174121C5E3A3D00021915 /* HudTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B174111C5E3A3D00021915 /* HudTests.m */; };
D2D75D5323A8193100485497 /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D2D75D5123A8193000485497 /* Launch.storyboard */; };
D2EEB3811B55967200F59EC1 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D2EEB3801B55967200F59EC1 /* Images.xcassets */; };
/* End PBXBuildFile section */
@@ -63,9 +64,11 @@
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; };
D2B1269B23CB8D9C00A01F4C /* HudDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = HudDemo.entitlements; 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>"; };
D2D75D5223A8193000485497 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Launch.storyboard; sourceTree = "<group>"; };
D2EEB3801B55967200F59EC1 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HudDemo/Images.xcassets; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
@@ -101,6 +104,7 @@
080E96DDFE201D6D7F000001 /* HudDemo */ = {
isa = PBXGroup;
children = (
D2B1269B23CB8D9C00A01F4C /* HudDemo.entitlements */,
D27F18561D3B5DFF009D7482 /* MBHudDemoAppDelegate.h */,
D27F18571D3B5DFF009D7482 /* MBHudDemoViewController.h */,
D27F18581D3B5DFF009D7482 /* MBHudDemoAppDelegate.m */,
@@ -108,8 +112,7 @@
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
);
name = HudDemo;
path = Classes;
path = HudDemo;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
@@ -200,6 +203,7 @@
D27F18671D3B5E43009D7482 /* Resources */ = {
isa = PBXGroup;
children = (
D2D75D5123A8193000485497 /* Launch.storyboard */,
D27F184C1D3B5878009D7482 /* Main.storyboard */,
D27F18511D3B5878009D7482 /* Info.plist */,
D274948A1D3B74AA00ABEB66 /* Images.xcassets */,
@@ -287,7 +291,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = MB;
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "Matej Bukovinski";
TargetAttributes = {
D27F18401D3B5878009D7482 = {
@@ -301,13 +305,9 @@
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HudDemo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
en,
Base,
);
@@ -339,6 +339,7 @@
files = (
D27F184E1D3B5878009D7482 /* Main.storyboard in Resources */,
D274948B1D3B74AA00ABEB66 /* Images.xcassets in Resources */,
D2D75D5323A8193100485497 /* Launch.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -417,6 +418,14 @@
name = Main.storyboard;
sourceTree = "<group>";
};
D2D75D5123A8193000485497 /* Launch.storyboard */ = {
isa = PBXVariantGroup;
children = (
D2D75D5223A8193000485497 /* Base */,
);
name = Launch.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
@@ -425,15 +434,18 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = HudDemo/HudDemo.entitlements;
COPY_PHASE_STRIP = NO;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = HudDemo/HudDemo_Prefix.pch;
INFOPLIST_FILE = HudDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.bukovinski.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = HudDemo;
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
@@ -443,14 +455,17 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = HudDemo/HudDemo.entitlements;
COPY_PHASE_STRIP = YES;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = HudDemo/HudDemo_Prefix.pch;
INFOPLIST_FILE = HudDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.bukovinski.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = HudDemo;
SDKROOT = iphoneos;
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
@@ -458,15 +473,25 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = c99;
@@ -478,7 +503,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
@@ -487,15 +512,25 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
@@ -506,7 +541,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
SDKROOT = iphoneos;
};
name = Release;
@@ -521,6 +556,7 @@
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -553,6 +589,7 @@
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
@@ -598,6 +635,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.bukovinski.HudTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HudDemo.app/HudDemo";
};
name = Debug;
@@ -624,6 +662,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.bukovinski.HudTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HudDemo.app/HudDemo";
VALIDATE_PRODUCT = YES;
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "1120"
version = "1.8">
<BuildAction
parallelizeBuildables = "YES"
@@ -41,8 +41,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@@ -52,8 +50,18 @@
ReferencedContainer = "container:HudDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2B1740E1C5E3A3D00021915"
BuildableName = "HudTests.xctest"
BlueprintName = "HudTests"
ReferencedContainer = "container:HudDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -77,8 +85,6 @@
ReferencedContainer = "container:HudDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
displayScaleIsEnabled = "NO"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@@ -38,8 +36,8 @@
ReferencedContainer = "container:HudDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -61,8 +59,6 @@
ReferencedContainer = "container:HudDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -11,6 +11,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "HudDemo.app"
BlueprintName = "HudDemo"
ReferencedContainer = "container:HudDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@@ -23,17 +32,6 @@
</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"
@@ -55,8 +53,6 @@
ReferencedContainer = "container:HudDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
+10
View File
@@ -0,0 +1,10 @@
<?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>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

@@ -1,5 +1,17 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-40.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-60.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
@@ -54,6 +66,18 @@
"filename" : "Icon-60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-20.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-41.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
@@ -119,6 +143,12 @@
"idiom" : "ipad",
"filename" : "Icon-167.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "AppStore.png",
"scale" : "1x"
}
],
"info" : {
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

-23
View File
@@ -28,29 +28,6 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>Default-iOS7</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>Default-iOS7</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 480}</string>
</dict>
</array>
<key>UILaunchStoryboardName</key>
<string>Launch</string>
<key>UIMainStoryboardFile</key>
+4 -5
View File
@@ -33,7 +33,7 @@
@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
// Atomic, because it may be canceled from main thread, flag is read on a background thread
@property (atomic, assign) BOOL canceled;
@end
@@ -56,7 +56,7 @@
[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:@"On window" selector:@selector(windowExample)],
[MBExample exampleWithTitle:@"NSURLSession" selector:@selector(networkingExample)],
[MBExample exampleWithTitle:@"Determinate with NSProgress" selector:@selector(determinateNSProgressExample)],
[MBExample exampleWithTitle:@"Dim background" selector:@selector(dimBackgroundExample)],
@@ -259,7 +259,7 @@
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
// Do something useful in the background and update the HUD periodically.
[self doSomeWorkWithMixedProgress];
[self doSomeWorkWithMixedProgress:hud];
dispatch_async(dispatch_get_main_queue(), ^{
[hud hideAnimated:YES];
});
@@ -340,8 +340,7 @@
}
}
- (void)doSomeWorkWithMixedProgress {
MBProgressHUD *hud = [MBProgressHUD HUDForView:self.navigationController.view];
- (void)doSomeWorkWithMixedProgress:(MBProgressHUD *)hud {
// Indeterminate mode
sleep(2);
// Switch to determinate mode
+8 -8
View File
@@ -1,8 +1,10 @@
<?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">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Fq2-vR-Rsu">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
@@ -10,9 +12,8 @@
<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"/>
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
</navigationBar>
<connections>
<segue destination="iXE-FA-91q" kind="relationship" relationship="rootViewController" id="peN-oI-nI6"/>
@@ -31,10 +32,9 @@
<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"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<navigationItem key="navigationItem" title="MBProgressHUD" id="IuF-Dp-Voh"/>
</viewController>
+10 -8
View File
@@ -1,8 +1,10 @@
<?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">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="9dw-fs-BGe">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--MBProgressHUD-->
@@ -10,16 +12,16 @@
<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"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<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"/>
<rect key="frame" x="0.0" y="55.5" width="414" 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"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
@@ -41,7 +43,7 @@
<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"/>
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="15702" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="appleTV" appearance="light"/>
<dependencies>
<deployment identifier="tvOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" 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"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="438" y="544"/>
</scene>
</scenes>
</document>
+2
View File
@@ -26,6 +26,8 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>Launch</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
+175 -11
View File
@@ -26,10 +26,15 @@ XCTAssertFalse(hud.hidden, @"The HUD should be visible."); \
XCTAssertEqual(hud.bezelView.alpha, 1.f, @"The HUD should be visible."); \
} while (0)
#define MBTestHUDIsHiden(hud, rootView) \
do { \
XCTAssertEqual(hud.alpha, 0.f, @"The hud should be faded out."); \
} 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."); \
MBTestHUDIsHiden(hud, rootView); \
XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
} while (0)
@@ -43,10 +48,30 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
@implementation HudTests
#pragma mark - Initialization
- (void)testInitializers {
XCTAssertNotNil([[MBProgressHUD alloc] initWithView:[UIView new]]);
UIView *nilView = nil;
XCTAssertThrows([[MBProgressHUD alloc] initWithView:nilView]);
XCTAssertNotNil([[MBProgressHUD alloc] initWithFrame:CGRectZero]);
NSKeyedUnarchiver *dummyUnarchiver;
#if !TARGET_OS_MACCATALYST
if (@available(iOS 11.0, *)) {
#endif
dummyUnarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:[NSData data] error:nil];
#if !TARGET_OS_MACCATALYST
} else {
dummyUnarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:[NSData data]];
}
#endif
XCTAssertNotNil([[MBProgressHUD alloc] initWithCoder:dummyUnarchiver]);
}
#pragma mark - Convenience
- (void)testNonAnimatedConvenienceHUDPresentation {
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:rootView animated:NO];
@@ -67,7 +92,7 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
}
- (void)testAnimatedConvenienceHUDPresentation {
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
@@ -103,7 +128,7 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
}
- (void)testCompletionBlock {
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
@@ -120,10 +145,80 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
[self waitForExpectationsWithTimeout:5. handler:nil];
}
#pragma mark - Modes
- (void)testRoundDeterminate {
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
hud.mode = MBProgressHUDModeDeterminate;
[rootView addSubview:hud];
[hud showAnimated:NO];
MBTestHUDIsVisible(hud, rootView);
XCTAssertNotNil([self view:hud firstSubviewOfClass:[MBRoundProgressView class]]);
XCTAssertTrue([MBProgressHUD hideHUDForView:rootView animated:NO], @"The HUD should be found and removed.");
MBTestHUDIsHidenAndRemoved(hud, rootView);
}
- (void)testRoundAnnularDeterminate {
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
hud.mode = MBProgressHUDModeAnnularDeterminate;
[rootView addSubview:hud];
[hud showAnimated:NO];
MBTestHUDIsVisible(hud, rootView);
XCTAssertNotNil([self view:hud firstSubviewOfClass:[MBRoundProgressView class]]);
XCTAssertTrue([MBProgressHUD hideHUDForView:rootView animated:NO], @"The HUD should be found and removed.");
MBTestHUDIsHidenAndRemoved(hud, rootView);
}
- (void)testDeterminateHorizontalBar {
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
hud.mode = MBProgressHUDModeDeterminateHorizontalBar;
[rootView addSubview:hud];
[hud showAnimated:NO];
MBTestHUDIsVisible(hud, rootView);
XCTAssertNotNil([self view:hud firstSubviewOfClass:[MBBarProgressView class]]);
XCTAssertTrue([MBProgressHUD hideHUDForView:rootView animated:NO], @"The HUD should be found and removed.");
MBTestHUDIsHidenAndRemoved(hud, rootView);
}
#pragma mark - Customization
- (void)testEffectViewOrderAfterSettingBlurStyle {
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
[hud.bezelView.subviews enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL *stop) {
XCTAssert(![view isKindOfClass:UIVisualEffectView.class] || idx == 0, @"Just the first subview should be a visual effect view.");
}];
hud.bezelView.blurEffectStyle = UIBlurEffectStyleDark;
[hud.bezelView.subviews enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL *stop) {
XCTAssert(![view isKindOfClass:UIVisualEffectView.class] || idx == 0, @"Just the first subview should be a visual effect view even after changing the blurEffectStyle.");
}];
}
#pragma mark - Delay
- (void)testDelayedHide {
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
@@ -153,10 +248,38 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
MBTestHUDIsHidenAndRemoved(hud, rootView);
}
- (void)testDelayedHideDoesNotRace {
// https://github.com/jdg/MBProgressHUD/issues/503
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
[rootView addSubview:hud];
[hud showAnimated:YES];
[hud hideAnimated:YES afterDelay:0.3];
MBTestHUDIsVisible(hud, rootView);
XCTestExpectation *hideCheckExpectation = [self expectationWithDescription:@"Hide check"];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[hud showAnimated:YES];
[hud hideAnimated:YES afterDelay:0.3];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
MBTestHUDIsHiden(hud, rootView);
[hideCheckExpectation fulfill];
});
});
[self waitForExpectationsWithTimeout:5. handler:nil];
[hud removeFromSuperview];
MBTestHUDIsHidenAndRemoved(hud, rootView);
}
#pragma mark - Ruse
- (void)testNonAnimatedHudReuse {
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
@@ -175,7 +298,7 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
}
- (void)testUnfinishedHidingAnimation {
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:rootView animated:NO];
@@ -200,7 +323,7 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
}
- (void)testAnimatedImmediateHudReuse {
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
XCTestExpectation *hideExpectation = [self expectationWithDescription:@"The hud should have been hidden."];
@@ -229,7 +352,7 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
#pragma mark - Min show time
- (void)testMinShowTime {
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
@@ -266,7 +389,7 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
#pragma mark - Grace time
- (void)testGraceTime {
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
@@ -307,7 +430,7 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
}
- (void)testHideBeforeGraceTimeElapsed {
UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
self.hideExpectation = [self expectationWithDescription:@"The hudWasHidden: delegate should have been called."];
@@ -348,6 +471,31 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
MBTestHUDIsHidenAndRemoved(hud, rootView);
}
#pragma mark - Customization
- (void)testShape {
UIViewController *rootViewController = UIApplication.sharedApplication.windows.firstObject.rootViewController;
UIView *rootView = rootViewController.view;
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:rootView];
hud.removeFromSuperViewOnHide = YES;
hud.offset = CGPointMake(50, 50);
hud.square = YES;
hud.label.text = @"Some long text...";
[rootView addSubview:hud];
[hud showAnimated:NO];
[hud setNeedsLayout];
[hud layoutIfNeeded];
CGRect frame = hud.bezelView.frame;
XCTAssertEqual(frame.size.width, frame.size.height);
[hud hideAnimated:NO];
MBTestHUDIsHidenAndRemoved(hud, rootView);
}
#pragma mark - MBProgressHUDDelegate
- (void)hudWasHidden:(MBProgressHUD *)hud {
@@ -358,4 +506,20 @@ XCTAssertNil(hud.superview, @"The HUD should not have a superview."); \
self.hideExpectation = nil;
}
#pragma mark - Helpers
- (nullable UIView *)view:(UIView *)view firstSubviewOfClass:(Class)clazz {
for (__unsafe_unretained UIView *subview in view.subviews) {
if ([subview isKindOfClass:clazz]) {
return subview;
}
}
__unsafe_unretained UIView *theView;
for (__unsafe_unretained UIView *subview in view.subviews) {
theView = [self view:subview firstSubviewOfClass:clazz];
if (theView) { break; }
}
return theView;
}
@end
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright © 2009-2016 Matej Bukovinski
Copyright © 2009-2020 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
+2 -2
View File
@@ -4,8 +4,8 @@
#import <Availability.h>
#ifndef __IPHONE_3_0
#warning "This project uses features only available in iOS SDK 3.0 and later."
#ifndef __IPHONE_8_0
#warning "This project uses features only available in iOS SDK 8.0 and later."
#endif
#ifdef __OBJC__
+37 -61
View File
@@ -1,12 +1,12 @@
//
// MBProgressHUD.h
// Version 1.0.0
// Version 1.2.0
// Created by Matej Bukovinski on 2.4.09.
//
// This code is distributed under the terms and conditions of the MIT license.
// This code is distributed under the terms and conditions of the MIT license.
// Copyright © 2009-2016 Matej Bukovinski
// Copyright © 2009-2020 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
@@ -69,13 +69,13 @@ typedef NS_ENUM(NSInteger, MBProgressHUDBackgroundStyle) {
MBProgressHUDBackgroundStyleBlur
};
typedef void (^MBProgressHUDCompletionBlock)();
typedef void (^MBProgressHUDCompletionBlock)(void);
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.
@@ -125,7 +125,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param view The view that is going to be searched.
* @return A reference to the last HUD subview discovered.
*/
+ (nullable MBProgressHUD *)HUDForView:(UIView *)view;
+ (nullable MBProgressHUD *)HUDForView:(UIView *)view NS_SWIFT_NAME(forView(_:));
/**
* A convenience constructor that initializes the HUD with the view's bounds. Calls the designated constructor with
@@ -136,8 +136,8 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (instancetype)initWithView:(UIView *)view;
/**
* Displays the HUD.
/**
* 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
@@ -150,7 +150,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)showAnimated:(BOOL)animated;
/**
/**
* 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.
*
@@ -161,7 +161,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)hideAnimated:(BOOL)animated;
/**
/**
* 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.
*
@@ -179,16 +179,18 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) id<MBProgressHUDDelegate> delegate;
/**
* Called after the HUD is hiden.
* Called after the HUD is hidden.
*/
@property (copy, nullable) MBProgressHUDCompletionBlock completionBlock;
/*
/**
* 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.
* This may be used to prevent HUD display for very short tasks.
* Defaults to 0 (no grace time).
* @note The graceTime needs to be set before the hud is shown. You thus can't use `showHUDAddedTo:animated:`,
* but instead need to alloc / init the HUD, configure the grace time and than show it manually.
*/
@property (assign, nonatomic) NSTimeInterval graceTime;
@@ -207,7 +209,7 @@ NS_ASSUME_NONNULL_BEGIN
/// @name Appearance
/**
/**
* MBProgressHUD operation mode. The default is MBProgressHUDModeIndeterminate.
*/
@property (assign, nonatomic) MBProgressHUDMode mode;
@@ -250,7 +252,9 @@ NS_ASSUME_NONNULL_BEGIN
/**
* When enabled, the bezel center gets slightly affected by the device accelerometer data.
* Has no effect on iOS < 7.0. Defaults to YES.
* Defaults to NO.
*
* @note This can cause main thread checker assertions on certain devices. https://github.com/jdg/MBProgressHUD/issues/552
*/
@property (assign, nonatomic, getter=areDefaultMotionEffectsEnabled) BOOL defaultMotionEffectsEnabled UI_APPEARANCE_SELECTOR;
@@ -298,7 +302,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic, readonly) UILabel *detailsLabel;
/**
* A button that is placed below the labels. Visible only if a target / action is added.
* A button that is placed below the labels. Visible only if a target / action is added and a title is assigned..
*/
@property (strong, nonatomic, readonly) UIButton *button;
@@ -309,8 +313,8 @@ NS_ASSUME_NONNULL_BEGIN
@optional
/**
* Called after the HUD was fully hidden from the screen.
/**
* Called after the HUD was fully hidden from the screen.
*/
- (void)hudWasHidden:(MBProgressHUD *)hud;
@@ -320,7 +324,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* A progress view for showing definite progress by filling up a circle (pie chart).
*/
@interface MBRoundProgressView : UIView
@interface MBRoundProgressView : UIView
/**
* Progress (0.0 to 1.0)
@@ -334,7 +338,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) UIColor *progressTintColor;
/**
* Indicator background (non-progress) color.
* Indicator background (non-progress) color.
* Only applicable on iOS versions older than iOS 7.
* Defaults to translucent white (alpha 0.1).
*/
@@ -349,7 +353,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* A flat bar progress view.
* A flat bar progress view.
*/
@interface MBBarProgressView : UIView
@@ -382,53 +386,25 @@ NS_ASSUME_NONNULL_BEGIN
@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.
* The background style.
* Defaults to MBProgressHUDBackgroundStyleBlur.
*/
@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.
* The blur effect style, when using MBProgressHUDBackgroundStyleBlur.
* Defaults to UIBlurEffectStyleLight.
*/
@property (nonatomic, strong) UIColor *color;
@property (nonatomic) UIBlurEffectStyle blurEffectStyle;
@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.")));
/**
* The background color or the blur tint color.
*
* Defaults to nil on iOS 13 and later and
* `[UIColor colorWithWhite:0.8f alpha:0.6f]`
* on older systems.
*/
@property (nonatomic, strong, nullable) UIColor *color;
@end
+121 -414
View File
@@ -1,21 +1,12 @@
//
// MBProgressHUD.m
// Version 1.0.0
// Version 1.2.0
// Created by Matej Bukovinski on 2.4.09.
//
#import "MBProgressHUD.h"
#import <tgmath.h>
#ifndef kCFCoreFoundationVersionNumber_iOS_7_0
#define kCFCoreFoundationVersionNumber_iOS_7_0 847.20
#endif
#ifndef kCFCoreFoundationVersionNumber_iOS_8_0
#define kCFCoreFoundationVersionNumber_iOS_8_0 1129.15
#endif
#define MBMainThreadAssert() NSAssert([NSThread isMainThread], @"MBProgressHUD needs to be accessed on the main thread.");
CGFloat const MBProgressMaxOffset = 1000000.f;
@@ -25,11 +16,7 @@ static const CGFloat MBDefaultLabelFontSize = 16.f;
static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
@interface MBProgressHUD () {
// Deprecated
UIColor *_activityIndicatorColor;
CGFloat _opacity;
}
@interface MBProgressHUD ()
@property (nonatomic, assign) BOOL useAnimation;
@property (nonatomic, assign, getter=hasFinished) BOOL finished;
@@ -39,14 +26,12 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
@property (nonatomic, strong) NSArray *bezelConstraints;
@property (nonatomic, strong) UIView *topSpacer;
@property (nonatomic, strong) UIView *bottomSpacer;
@property (nonatomic, strong) UIMotionEffectGroup *bezelMotionEffects;
@property (nonatomic, weak) NSTimer *graceTimer;
@property (nonatomic, weak) NSTimer *minShowTimer;
@property (nonatomic, weak) NSTimer *hideDelayTimer;
@property (nonatomic, weak) CADisplayLink *progressObjectDisplayLink;
// Deprecated
@property (assign) BOOL taskInProgress;
@end
@@ -96,12 +81,14 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
_animationType = MBProgressHUDAnimationFade;
_mode = MBProgressHUDModeIndeterminate;
_margin = 20.0f;
_opacity = 1.f;
_defaultMotionEffectsEnabled = YES;
_defaultMotionEffectsEnabled = NO;
if (@available(iOS 13.0, tvOS 13, *)) {
_contentColor = [[UIColor labelColor] colorWithAlphaComponent:0.7f];
} else {
_contentColor = [UIColor colorWithWhite:0.f alpha:0.7f];
}
// Default color, depending on the current iOS version
BOOL isLegacy = kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_iOS_7_0;
_contentColor = isLegacy ? [UIColor whiteColor] : [UIColor colorWithWhite:0.f alpha:0.7f];
// Transparent background
self.opaque = NO;
self.backgroundColor = [UIColor clearColor];
@@ -150,7 +137,7 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
NSTimer *timer = [NSTimer timerWithTimeInterval:self.graceTime target:self selector:@selector(handleGraceTimer:) userInfo:nil repeats:NO];
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
self.graceTimer = timer;
}
}
// ... otherwise show the HUD immediately
else {
[self showUsingAnimation:self.useAnimation];
@@ -171,13 +158,16 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
self.minShowTimer = timer;
return;
}
}
}
// ... otherwise hide the HUD immediately
[self hideUsingAnimation:self.useAnimation];
}
- (void)hideAnimated:(BOOL)animated afterDelay:(NSTimeInterval)delay {
// Cancel any scheduled hideAnimated:afterDelay: calls
[self.hideDelayTimer invalidate];
NSTimer *timer = [NSTimer timerWithTimeInterval:delay target:self selector:@selector(handleHideTimer:) userInfo:@(animated) repeats:NO];
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
self.hideDelayTimer = timer;
@@ -213,7 +203,7 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
[self.bezelView.layer removeAllAnimations];
[self.backgroundView.layer removeAllAnimations];
// Cancel any scheduled hideDelayed: calls
// Cancel any scheduled hideAnimated:afterDelay: calls
[self.hideDelayTimer invalidate];
self.showStarted = [NSDate date];
@@ -222,18 +212,25 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
// Needed in case we hide and re-show with the same NSProgress object attached.
[self setNSProgressDisplayLinkEnabled:YES];
// Set up motion effects only at this point to avoid needlessly
// creating the effect if it was disabled after initialization.
[self updateBezelMotionEffects];
if (animated) {
[self animateIn:YES withType:self.animationType completion:NULL];
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
self.bezelView.alpha = self.opacity;
#pragma clang diagnostic pop
self.bezelView.alpha = 1.f;
self.backgroundView.alpha = 1.f;
}
}
- (void)hideUsingAnimation:(BOOL)animated {
// Cancel any scheduled hideAnimated:afterDelay: calls.
// This needs to happen here instead of in done,
// to avoid races if another hideAnimated:afterDelay:
// call comes in while the HUD is animating out.
[self.hideDelayTimer invalidate];
if (animated && self.showStarted) {
self.showStarted = nil;
[self animateIn:NO withType:self.animationType completion:^(BOOL finished) {
@@ -273,26 +270,14 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
} else if (!animatingIn && type == MBProgressHUDAnimationZoomOut) {
bezelView.transform = small;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
bezelView.alpha = animatingIn ? self.opacity : 0.f;
#pragma clang diagnostic pop
self.backgroundView.alpha = animatingIn ? 1.f : 0.f;
CGFloat alpha = animatingIn ? 1.f : 0.f;
bezelView.alpha = alpha;
self.backgroundView.alpha = alpha;
};
// Spring animations are nicer, but only available on iOS 7+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 || TARGET_OS_TV
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {
[UIView animateWithDuration:0.3 delay:0. usingSpringWithDamping:1.f initialSpringVelocity:0.f options:UIViewAnimationOptionBeginFromCurrentState animations:animations completion:completion];
return;
}
#endif
[UIView animateWithDuration:0.3 delay:0. options:UIViewAnimationOptionBeginFromCurrentState animations:animations completion:completion];
[UIView animateWithDuration:0.3 delay:0. usingSpringWithDamping:1.f initialSpringVelocity:0.f options:UIViewAnimationOptionBeginFromCurrentState animations:animations completion:completion];
}
- (void)done {
// Cancel any scheduled hideDelayed: calls
[self.hideDelayTimer invalidate];
[self setNSProgressDisplayLinkEnabled:NO];
if (self.hasFinished) {
@@ -330,7 +315,6 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
bezelView.alpha = 0.f;
[self addSubview:bezelView];
_bezelView = bezelView;
[self updateBezelMotionEffects];
UILabel *label = [UILabel new];
label.adjustsFontSizeToFitWidth = NO;
@@ -386,9 +370,20 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
if (mode == MBProgressHUDModeIndeterminate) {
if (!isActivityIndicator) {
// Update to indeterminate indicator
UIActivityIndicatorView *activityIndicator;
[indicator removeFromSuperview];
indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[(UIActivityIndicatorView *)indicator startAnimating];
#if !TARGET_OS_MACCATALYST
if (@available(iOS 13.0, tvOS 13.0, *)) {
#endif
activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];
activityIndicator.color = [UIColor whiteColor];
#if !TARGET_OS_MACCATALYST
} else {
activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
}
#endif
[activityIndicator startAnimating];
indicator = activityIndicator;
[self.bezelView addSubview:indicator];
}
}
@@ -408,7 +403,7 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
if (mode == MBProgressHUDModeAnnularDeterminate) {
[(MBRoundProgressView *)indicator setAnnular:YES];
}
}
}
else if (mode == MBProgressHUDModeCustomView && self.customView != indicator) {
// Update custom view indicator
[indicator removeFromSuperview];
@@ -440,13 +435,6 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
self.detailsLabel.textColor = color;
[self.button setTitleColor:color forState:UIControlStateNormal];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (self.activityIndicatorColor) {
color = self.activityIndicatorColor;
}
#pragma clang diagnostic pop
// UIAppearance settings are prioritized. If they are preset the set color is ignored.
UIView *indicator = self.indicator;
@@ -458,7 +446,7 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
// For iOS 9+
appearance = [UIActivityIndicatorView appearanceWhenContainedInInstancesOfClasses:@[[MBProgressHUD class]]];
#endif
if (appearance.color == nil) {
((UIActivityIndicatorView *)indicator).color = color;
}
@@ -489,20 +477,15 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
((MBBarProgressView *)indicator).lineColor = color;
}
} else {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 || TARGET_OS_TV
if ([indicator respondsToSelector:@selector(setTintColor:)]) {
[indicator setTintColor:color];
}
#endif
[indicator setTintColor:color];
}
}
- (void)updateBezelMotionEffects {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 || TARGET_OS_TV
MBBackgroundView *bezelView = self.bezelView;
if (![bezelView respondsToSelector:@selector(addMotionEffect:)]) return;
UIMotionEffectGroup *bezelMotionEffects = self.bezelMotionEffects;
if (self.defaultMotionEffectsEnabled) {
if (self.defaultMotionEffectsEnabled && !bezelMotionEffects) {
CGFloat effectOffset = 10.f;
UIInterpolatingMotionEffect *effectX = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
effectX.maximumRelativeValue = @(effectOffset);
@@ -515,14 +498,12 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
UIMotionEffectGroup *group = [[UIMotionEffectGroup alloc] init];
group.motionEffects = @[effectX, effectY];
self.bezelMotionEffects = group;
[bezelView addMotionEffect:group];
} else {
NSArray *effects = [bezelView motionEffects];
for (UIMotionEffect *effect in effects) {
[bezelView removeMotionEffect:effect];
}
} else if (bezelMotionEffects) {
self.bezelMotionEffects = nil;
[bezelView removeMotionEffect:bezelMotionEffects];
}
#endif
}
#pragma mark - Layout
@@ -610,10 +591,10 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
[bezel addConstraints:bezelConstraints];
self.bezelConstraints = bezelConstraints;
self.paddingConstraints = [paddingConstraints copy];
[self updatePaddingConstraints];
[super updateConstraints];
}
@@ -698,9 +679,9 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
- (void)setProgressObjectDisplayLink:(CADisplayLink *)progressObjectDisplayLink {
if (progressObjectDisplayLink != _progressObjectDisplayLink) {
[_progressObjectDisplayLink invalidate];
_progressObjectDisplayLink = progressObjectDisplayLink;
[_progressObjectDisplayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
}
}
@@ -758,7 +739,7 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
#pragma mark - Notifications
- (void)registerForNotifications {
#if !TARGET_OS_TV
#if !TARGET_OS_TV && !TARGET_OS_MACCATALYST
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self selector:@selector(statusBarOrientationDidChange:)
@@ -767,13 +748,13 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
}
- (void)unregisterFromNotifications {
#if !TARGET_OS_TV
#if !TARGET_OS_TV && !TARGET_OS_MACCATALYST
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc removeObserver:self name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
#endif
}
#if !TARGET_OS_TV
#if !TARGET_OS_TV && !TARGET_OS_MACCATALYST
- (void)statusBarOrientationDidChange:(NSNotification *)notification {
UIView *superview = self.superview;
if (!superview) {
@@ -805,7 +786,7 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
UIApplication *application = [UIApplication performSelector:@selector(sharedApplication)];
UIInterfaceOrientation orientation = application.statusBarOrientation;
CGFloat radians = 0;
if (UIInterfaceOrientationIsLandscape(orientation)) {
radians = orientation == UIInterfaceOrientationLandscapeLeft ? -(CGFloat)M_PI_2 : (CGFloat)M_PI_2;
// Window coordinates differ!
@@ -883,11 +864,10 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
BOOL isPreiOS7 = kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_iOS_7_0;
if (_annular) {
// Draw background
CGFloat lineWidth = isPreiOS7 ? 5.f : 2.f;
CGFloat lineWidth = 2.f;
UIBezierPath *processBackgroundPath = [UIBezierPath bezierPath];
processBackgroundPath.lineWidth = lineWidth;
processBackgroundPath.lineCapStyle = kCGLineCapButt;
@@ -900,7 +880,7 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
[processBackgroundPath stroke];
// Draw progress
UIBezierPath *processPath = [UIBezierPath bezierPath];
processPath.lineCapStyle = isPreiOS7 ? kCGLineCapRound : kCGLineCapSquare;
processPath.lineCapStyle = kCGLineCapSquare;
processPath.lineWidth = lineWidth;
endAngle = (self.progress * 2 * (float)M_PI) + startAngle;
[processPath addArcWithCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES];
@@ -915,33 +895,20 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
[_progressTintColor setStroke];
[_backgroundTintColor setFill];
CGContextSetLineWidth(context, lineWidth);
if (isPreiOS7) {
CGContextFillEllipseInRect(context, circleRect);
}
CGContextStrokeEllipseInRect(context, circleRect);
// 90 degrees
CGFloat startAngle = - ((float)M_PI / 2.f);
// Draw progress
if (isPreiOS7) {
CGFloat radius = (CGRectGetWidth(self.bounds) / 2.f) - lineWidth;
CGFloat endAngle = (self.progress * 2.f * (float)M_PI) + startAngle;
[_progressTintColor setFill];
CGContextMoveToPoint(context, center.x, center.y);
CGContextAddArc(context, center.x, center.y, radius, startAngle, endAngle, 0);
CGContextClosePath(context);
CGContextFillPath(context);
} else {
UIBezierPath *processPath = [UIBezierPath bezierPath];
processPath.lineCapStyle = kCGLineCapButt;
processPath.lineWidth = lineWidth * 2.f;
CGFloat radius = (CGRectGetWidth(self.bounds) / 2.f) - (processPath.lineWidth / 2.f);
CGFloat endAngle = (self.progress * 2.f * (float)M_PI) + startAngle;
[processPath addArcWithCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES];
// Ensure that we don't get color overlaping when _progressTintColor alpha < 1.f.
CGContextSetBlendMode(context, kCGBlendModeCopy);
[_progressTintColor set];
[processPath stroke];
}
UIBezierPath *processPath = [UIBezierPath bezierPath];
processPath.lineCapStyle = kCGLineCapButt;
processPath.lineWidth = lineWidth * 2.f;
CGFloat radius = (CGRectGetWidth(self.bounds) / 2.f) - (processPath.lineWidth / 2.f);
CGFloat endAngle = (self.progress * 2.f * (float)M_PI) + startAngle;
[processPath addArcWithCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES];
// Ensure that we don't get color overlapping when _progressTintColor alpha < 1.f.
CGContextSetBlendMode(context, kCGBlendModeCopy);
[_progressTintColor set];
[processPath stroke];
}
}
@@ -972,8 +939,7 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
#pragma mark - Layout
- (CGSize)intrinsicContentSize {
BOOL isPreiOS7 = kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_iOS_7_0;
return CGSizeMake(120.f, isPreiOS7 ? 20.f : 10.f);
return CGSizeMake(120.f, 10.f);
}
#pragma mark - Properties
@@ -1005,51 +971,39 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 2);
CGContextSetStrokeColorWithColor(context,[_lineColor CGColor]);
CGContextSetFillColorWithColor(context, [_progressRemainingColor CGColor]);
// Draw background
// Draw background and Border
CGFloat radius = (rect.size.height / 2) - 2;
CGContextMoveToPoint(context, 2, rect.size.height/2);
CGContextAddArcToPoint(context, 2, 2, radius + 2, 2, radius);
CGContextAddLineToPoint(context, rect.size.width - radius - 2, 2);
CGContextAddArcToPoint(context, rect.size.width - 2, 2, rect.size.width - 2, rect.size.height / 2, radius);
CGContextAddArcToPoint(context, rect.size.width - 2, rect.size.height - 2, rect.size.width - radius - 2, rect.size.height - 2, radius);
CGContextAddLineToPoint(context, radius + 2, rect.size.height - 2);
CGContextAddArcToPoint(context, 2, rect.size.height - 2, 2, rect.size.height/2, radius);
CGContextFillPath(context);
// Draw border
CGContextMoveToPoint(context, 2, rect.size.height/2);
CGContextAddArcToPoint(context, 2, 2, radius + 2, 2, radius);
CGContextAddLineToPoint(context, rect.size.width - radius - 2, 2);
CGContextAddArcToPoint(context, rect.size.width - 2, 2, rect.size.width - 2, rect.size.height / 2, radius);
CGContextAddArcToPoint(context, rect.size.width - 2, rect.size.height - 2, rect.size.width - radius - 2, rect.size.height - 2, radius);
CGContextAddLineToPoint(context, radius + 2, rect.size.height - 2);
CGContextAddArcToPoint(context, 2, rect.size.height - 2, 2, rect.size.height/2, radius);
CGContextStrokePath(context);
CGContextDrawPath(context, kCGPathFillStroke);
CGContextSetFillColorWithColor(context, [_progressColor CGColor]);
radius = radius - 2;
CGFloat amount = self.progress * rect.size.width;
// Progress in the middle area
if (amount >= radius + 4 && amount <= (rect.size.width - radius - 4)) {
CGContextMoveToPoint(context, 4, rect.size.height/2);
CGContextAddArcToPoint(context, 4, 4, radius + 4, 4, radius);
CGContextAddLineToPoint(context, amount, 4);
CGContextAddLineToPoint(context, amount, radius + 4);
CGContextMoveToPoint(context, 4, rect.size.height/2);
CGContextAddArcToPoint(context, 4, rect.size.height - 4, radius + 4, rect.size.height - 4, radius);
CGContextAddLineToPoint(context, amount, rect.size.height - 4);
CGContextAddLineToPoint(context, amount, radius + 4);
CGContextFillPath(context);
}
// Progress in the right arc
else if (amount > radius + 4) {
CGFloat x = amount - (rect.size.width - radius - 4);
@@ -1069,10 +1023,10 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
if (isnan(angle)) angle = 0;
CGContextAddArc(context, rect.size.width - radius - 4, rect.size.height/2, radius, -M_PI, angle, 1);
CGContextAddLineToPoint(context, amount, rect.size.height/2);
CGContextFillPath(context);
}
// Progress is in the left arc
else if (amount < radius + 4 && amount > 0) {
CGContextMoveToPoint(context, 4, rect.size.height/2);
@@ -1082,7 +1036,7 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
CGContextMoveToPoint(context, 4, rect.size.height/2);
CGContextAddArcToPoint(context, 4, rect.size.height - 4, radius + 4, rect.size.height - 4, radius);
CGContextAddLineToPoint(context, radius + 4, rect.size.height/2);
CGContextFillPath(context);
}
}
@@ -1092,12 +1046,7 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
@interface MBBackgroundView ()
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 || TARGET_OS_TV
@property UIVisualEffectView *effectView;
#endif
#if !TARGET_OS_TV
@property UIToolbar *toolbar;
#endif
@end
@@ -1108,16 +1057,17 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
- (instancetype)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {
_style = MBProgressHUDBackgroundStyleBlur;
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_8_0) {
_color = [UIColor colorWithWhite:0.8f alpha:0.6f];
} else {
_color = [UIColor colorWithWhite:0.95f alpha:0.6f];
}
_style = MBProgressHUDBackgroundStyleBlur;
if (@available(iOS 13.0, *)) {
#if TARGET_OS_TV
_blurEffectStyle = UIBlurEffectStyleRegular;
#else
_blurEffectStyle = UIBlurEffectStyleSystemThickMaterial;
#endif
// Leaving the color unassigned yields best results.
} else {
_style = MBProgressHUDBackgroundStyleSolidColor;
_color = [[UIColor blackColor] colorWithAlphaComponent:0.8];
_blurEffectStyle = UIBlurEffectStyleLight;
_color = [UIColor colorWithWhite:0.8f alpha:0.6f];
}
self.clipsToBounds = YES;
@@ -1137,9 +1087,6 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
#pragma mark - Appearance
- (void)setStyle:(MBProgressHUDBackgroundStyle)style {
if (style == MBProgressHUDBackgroundStyleBlur && kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_iOS_7_0) {
style = MBProgressHUDBackgroundStyleSolidColor;
}
if (_style != style) {
_style = style;
[self updateForBackgroundStyle];
@@ -1154,62 +1101,41 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
}
}
- (void)setBlurEffectStyle:(UIBlurEffectStyle)blurEffectStyle {
if (_blurEffectStyle == blurEffectStyle) {
return;
}
_blurEffectStyle = blurEffectStyle;
[self updateForBackgroundStyle];
}
///////////////////////////////////////////////////////////////////////////////////////////
#pragma mark - Views
- (void)updateForBackgroundStyle {
[self.effectView removeFromSuperview];
self.effectView = nil;
MBProgressHUDBackgroundStyle style = self.style;
if (style == MBProgressHUDBackgroundStyleBlur) {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 || TARGET_OS_TV
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_8_0) {
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect];
[self addSubview:effectView];
effectView.frame = self.bounds;
effectView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
self.backgroundColor = self.color;
self.layer.allowsGroupOpacity = NO;
self.effectView = effectView;
} else {
#endif
#if !TARGET_OS_TV
UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectInset(self.bounds, -100.f, -100.f)];
toolbar.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
toolbar.barTintColor = self.color;
toolbar.translucent = YES;
[self addSubview:toolbar];
self.toolbar = toolbar;
#endif
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 || TARGET_OS_TV
}
#endif
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:self.blurEffectStyle];
UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect];
[self insertSubview:effectView atIndex:0];
effectView.frame = self.bounds;
effectView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
self.backgroundColor = self.color;
self.layer.allowsGroupOpacity = NO;
self.effectView = effectView;
} else {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 || TARGET_OS_TV
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_8_0) {
[self.effectView removeFromSuperview];
self.effectView = nil;
} else {
#endif
#if !TARGET_OS_TV
[self.toolbar removeFromSuperview];
self.toolbar = nil;
#endif
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 || TARGET_OS_TV
}
#endif
self.backgroundColor = self.color;
}
}
- (void)updateViewsForColor:(UIColor *)color {
if (self.style == MBProgressHUDBackgroundStyleBlur) {
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_8_0) {
self.backgroundColor = self.color;
} else {
#if !TARGET_OS_TV
self.toolbar.barTintColor = color;
#endif
}
self.backgroundColor = self.color;
} else {
self.backgroundColor = self.color;
}
@@ -1218,226 +1144,6 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
@end
@implementation MBProgressHUD (Deprecated)
#pragma mark - Class
+ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated {
NSArray *huds = [MBProgressHUD allHUDsForView:view];
for (MBProgressHUD *hud in huds) {
hud.removeFromSuperViewOnHide = YES;
[hud hideAnimated:animated];
}
return [huds count];
}
+ (NSArray *)allHUDsForView:(UIView *)view {
NSMutableArray *huds = [NSMutableArray array];
NSArray *subviews = view.subviews;
for (UIView *aView in subviews) {
if ([aView isKindOfClass:self]) {
[huds addObject:aView];
}
}
return [NSArray arrayWithArray:huds];
}
#pragma mark - Lifecycle
- (id)initWithWindow:(UIWindow *)window {
return [self initWithView:window];
}
#pragma mark - Show & hide
- (void)show:(BOOL)animated {
[self showAnimated:animated];
}
- (void)hide:(BOOL)animated {
[self hideAnimated:animated];
}
- (void)hide:(BOOL)animated afterDelay:(NSTimeInterval)delay {
[self hideAnimated:animated afterDelay:delay];
}
#pragma mark - Threading
- (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(BOOL)animated {
[self showAnimated:animated whileExecutingBlock:^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
// Start executing the requested task
[target performSelector:method withObject:object];
#pragma clang diagnostic pop
}];
}
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block {
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
[self showAnimated:animated whileExecutingBlock:block onQueue:queue completionBlock:NULL];
}
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block completionBlock:(void (^)())completion {
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
[self showAnimated:animated whileExecutingBlock:block onQueue:queue completionBlock:completion];
}
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue {
[self showAnimated:animated whileExecutingBlock:block onQueue:queue completionBlock:NULL];
}
- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue completionBlock:(nullable MBProgressHUDCompletionBlock)completion {
self.taskInProgress = YES;
self.completionBlock = completion;
dispatch_async(queue, ^(void) {
block();
dispatch_async(dispatch_get_main_queue(), ^(void) {
[self cleanUp];
});
});
[self showAnimated:animated];
}
- (void)cleanUp {
self.taskInProgress = NO;
[self hideAnimated:self.useAnimation];
}
#pragma mark - Labels
- (NSString *)labelText {
return self.label.text;
}
- (void)setLabelText:(NSString *)labelText {
MBMainThreadAssert();
self.label.text = labelText;
}
- (UIFont *)labelFont {
return self.label.font;
}
- (void)setLabelFont:(UIFont *)labelFont {
MBMainThreadAssert();
self.label.font = labelFont;
}
- (UIColor *)labelColor {
return self.label.textColor;
}
- (void)setLabelColor:(UIColor *)labelColor {
MBMainThreadAssert();
self.label.textColor = labelColor;
}
- (NSString *)detailsLabelText {
return self.detailsLabel.text;
}
- (void)setDetailsLabelText:(NSString *)detailsLabelText {
MBMainThreadAssert();
self.detailsLabel.text = detailsLabelText;
}
- (UIFont *)detailsLabelFont {
return self.detailsLabel.font;
}
- (void)setDetailsLabelFont:(UIFont *)detailsLabelFont {
MBMainThreadAssert();
self.detailsLabel.font = detailsLabelFont;
}
- (UIColor *)detailsLabelColor {
return self.detailsLabel.textColor;
}
- (void)setDetailsLabelColor:(UIColor *)detailsLabelColor {
MBMainThreadAssert();
self.detailsLabel.textColor = detailsLabelColor;
}
- (CGFloat)opacity {
return _opacity;
}
- (void)setOpacity:(CGFloat)opacity {
MBMainThreadAssert();
_opacity = opacity;
}
- (UIColor *)color {
return self.bezelView.color;
}
- (void)setColor:(UIColor *)color {
MBMainThreadAssert();
self.bezelView.color = color;
}
- (CGFloat)yOffset {
return self.offset.y;
}
- (void)setYOffset:(CGFloat)yOffset {
MBMainThreadAssert();
self.offset = CGPointMake(self.offset.x, yOffset);
}
- (CGFloat)xOffset {
return self.offset.x;
}
- (void)setXOffset:(CGFloat)xOffset {
MBMainThreadAssert();
self.offset = CGPointMake(xOffset, self.offset.y);
}
- (CGFloat)cornerRadius {
return self.bezelView.layer.cornerRadius;
}
- (void)setCornerRadius:(CGFloat)cornerRadius {
MBMainThreadAssert();
self.bezelView.layer.cornerRadius = cornerRadius;
}
- (BOOL)dimBackground {
MBBackgroundView *backgroundView = self.backgroundView;
UIColor *dimmedColor = [UIColor colorWithWhite:0.f alpha:.2f];
return backgroundView.style == MBProgressHUDBackgroundStyleSolidColor && [backgroundView.color isEqual:dimmedColor];
}
- (void)setDimBackground:(BOOL)dimBackground {
MBMainThreadAssert();
self.backgroundView.style = MBProgressHUDBackgroundStyleSolidColor;
self.backgroundView.color = dimBackground ? [UIColor colorWithWhite:0.f alpha:.2f] : [UIColor clearColor];
}
- (CGSize)size {
return self.bezelView.frame.size;
}
- (UIColor *)activityIndicatorColor {
return _activityIndicatorColor;
}
- (void)setActivityIndicatorColor:(UIColor *)activityIndicatorColor {
if (activityIndicatorColor != _activityIndicatorColor) {
_activityIndicatorColor = activityIndicatorColor;
UIActivityIndicatorView *indicator = (UIActivityIndicatorView *)self.indicator;
if ([indicator isKindOfClass:[UIActivityIndicatorView class]]) {
[indicator setColor:activityIndicatorColor];
}
}
}
@end
@implementation MBProgressHUDRoundedButton
#pragma mark - Lifecycle
@@ -1461,8 +1167,9 @@ static const CGFloat MBDefaultDetailsLabelFontSize = 12.f;
}
- (CGSize)intrinsicContentSize {
// Only show if we have associated control events
if (self.allControlEvents == 0) return CGSizeZero;
// Only show if we have associated control events and a title
if ((self.allControlEvents == 0) || ([self titleForState:UIControlStateNormal].length == 0))
return CGSizeZero;
CGSize size = [super intrinsicContentSize];
// Add some side padding
size.width += 20.f;
+6 -5
View File
@@ -1,20 +1,21 @@
Pod::Spec.new do |s|
s.name = "MBProgressHUD"
s.version = "1.0.0"
s.version = "1.2.0"
s.summary = "An iOS activity indicator view."
s.description = <<-DESC
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
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.
DESC
s.homepage = "http://www.bukovinski.com"
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.ios.deployment_target = '6.0'
s.ios.deployment_target = '9.0'
s.tvos.deployment_target = '9.0'
s.source_files = '*.{h,m}'
s.resource_bundles = {'MBProgressHUD' => ['PrivacyInfo.xcprivacy']}
s.frameworks = "CoreGraphics", "QuartzCore"
s.requires_arc = true
end
+186 -9
View File
@@ -8,8 +8,12 @@
/* Begin PBXBuildFile section */
1315DD7617804CBC0032507D /* MBProgressHUD.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D286A7511518C70F00E13FB8 /* MBProgressHUD.h */; };
1777D3E71D757B690037C7F1 /* MBProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = D286A7511518C70F00E13FB8 /* MBProgressHUD.h */; settings = {ATTRIBUTES = (Public, ); }; };
1777D3E81D757B6E0037C7F1 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D286A7521518C70F00E13FB8 /* MBProgressHUD.m */; };
1D104D931ACA371400973364 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D286A7521518C70F00E13FB8 /* MBProgressHUD.m */; };
1D104D941ACA373100973364 /* MBProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = D286A7511518C70F00E13FB8 /* MBProgressHUD.h */; settings = {ATTRIBUTES = (Public, ); }; };
AAD69D522B51630200BE0369 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = AAD69D512B5162AE00BE0369 /* PrivacyInfo.xcprivacy */; };
AAD69D532B51630200BE0369 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = AAD69D512B5162AE00BE0369 /* PrivacyInfo.xcprivacy */; };
D286A74D1518C70F00E13FB8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D286A74C1518C70F00E13FB8 /* Foundation.framework */; };
D286A7531518C70F00E13FB8 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D286A7521518C70F00E13FB8 /* MBProgressHUD.m */; };
D286A75E1518C89600E13FB8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D286A75D1518C89600E13FB8 /* UIKit.framework */; };
@@ -31,8 +35,11 @@
/* Begin PBXFileReference section */
1315DD73178045000032507D /* MBProgressHUD-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MBProgressHUD-Prefix.pch"; sourceTree = SOURCE_ROOT; };
1777D3DF1D757AF50037C7F1 /* MBProgressHUD.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MBProgressHUD.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1777D3E21D757AF50037C7F1 /* Framework-tvOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Framework-tvOS-Info.plist"; sourceTree = SOURCE_ROOT; };
1D104D7A1ACA36CC00973364 /* MBProgressHUD.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MBProgressHUD.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1D104D951ACA376200973364 /* Framework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Framework-Info.plist"; sourceTree = SOURCE_ROOT; };
AAD69D512B5162AE00BE0369 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
D286A7491518C70F00E13FB8 /* libMBProgressHUD.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMBProgressHUD.a; sourceTree = BUILT_PRODUCTS_DIR; };
D286A74C1518C70F00E13FB8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
D286A7511518C70F00E13FB8 /* MBProgressHUD.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = SOURCE_ROOT; };
@@ -42,6 +49,13 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1777D3DB1D757AF50037C7F1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
1D104D761ACA36CC00973364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -66,6 +80,7 @@
isa = PBXGroup;
children = (
1D104D951ACA376200973364 /* Framework-Info.plist */,
1777D3E21D757AF50037C7F1 /* Framework-tvOS-Info.plist */,
1315DD73178045000032507D /* MBProgressHUD-Prefix.pch */,
);
name = "Supporting Files";
@@ -85,6 +100,7 @@
children = (
D286A7491518C70F00E13FB8 /* libMBProgressHUD.a */,
1D104D7A1ACA36CC00973364 /* MBProgressHUD.framework */,
1777D3DF1D757AF50037C7F1 /* MBProgressHUD.framework */,
);
name = Products;
sourceTree = "<group>";
@@ -104,14 +120,23 @@
children = (
D286A7511518C70F00E13FB8 /* MBProgressHUD.h */,
D286A7521518C70F00E13FB8 /* MBProgressHUD.m */,
AAD69D512B5162AE00BE0369 /* PrivacyInfo.xcprivacy */,
1315DD72178044770032507D /* Supporting Files */,
);
path = MBProgressHUD;
name = MBProgressHUD;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
1777D3DC1D757AF50037C7F1 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
1777D3E71D757B690037C7F1 /* MBProgressHUD.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1D104D771ACA36CC00973364 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
@@ -123,6 +148,24 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
1777D3DE1D757AF50037C7F1 /* MBProgressHUD Framework tvOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1777D3E61D757AF50037C7F1 /* Build configuration list for PBXNativeTarget "MBProgressHUD Framework tvOS" */;
buildPhases = (
1777D3DA1D757AF50037C7F1 /* Sources */,
1777D3DB1D757AF50037C7F1 /* Frameworks */,
1777D3DC1D757AF50037C7F1 /* Headers */,
1777D3DD1D757AF50037C7F1 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "MBProgressHUD Framework tvOS";
productName = "MBProgressHUD Framework tvOS";
productReference = 1777D3DF1D757AF50037C7F1 /* MBProgressHUD.framework */;
productType = "com.apple.product-type.framework";
};
1D104D791ACA36CC00973364 /* MBProgressHUD Framework */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D104D8D1ACA36CC00973364 /* Build configuration list for PBXNativeTarget "MBProgressHUD Framework" */;
@@ -165,9 +208,13 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = MB;
LastUpgradeCheck = 0700;
LastUpgradeCheck = 1120;
ORGANIZATIONNAME = "Matej Bukovinski";
TargetAttributes = {
1777D3DE1D757AF50037C7F1 = {
CreatedOnToolsVersion = 8.0;
ProvisioningStyle = Automatic;
};
1D104D791ACA36CC00973364 = {
CreatedOnToolsVersion = 6.2;
};
@@ -175,10 +222,11 @@
};
buildConfigurationList = D286A7431518C70E00E13FB8 /* Build configuration list for PBXProject "MBProgressHUD" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = D286A73E1518C70E00E13FB8;
productRefGroup = D286A74A1518C70F00E13FB8 /* Products */;
@@ -187,21 +235,39 @@
targets = (
D286A7481518C70F00E13FB8 /* MBProgressHUD Static Library */,
1D104D791ACA36CC00973364 /* MBProgressHUD Framework */,
1777D3DE1D757AF50037C7F1 /* MBProgressHUD Framework tvOS */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1777D3DD1D757AF50037C7F1 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AAD69D532B51630200BE0369 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1D104D781ACA36CC00973364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AAD69D522B51630200BE0369 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1777D3DA1D757AF50037C7F1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1777D3E81D757B6E0037C7F1 /* MBProgressHUD.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1D104D751ACA36CC00973364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -221,6 +287,82 @@
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1777D3E41D757AF50037C7F1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = "Framework-tvOS-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.2;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.matej.MBProgressHUD;
PRODUCT_NAME = MBProgressHUD;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
1777D3E51D757AF50037C7F1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = "Framework-tvOS-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.2;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.matej.MBProgressHUD;
PRODUCT_NAME = MBProgressHUD;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
1D104D8E1ACA36CC00973364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -230,9 +372,11 @@
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CLANG_WARN_STRICT_PROTOTYPES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -244,8 +388,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = "Framework-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.2;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.matej.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = MBProgressHUD;
@@ -265,10 +409,12 @@
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CLANG_WARN_STRICT_PROTOTYPES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -277,8 +423,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = "Framework-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.2;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.matej.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = MBProgressHUD;
@@ -293,14 +439,25 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
@@ -322,7 +479,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
@@ -332,14 +489,25 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
@@ -353,7 +521,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
@@ -386,6 +554,15 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1777D3E61D757AF50037C7F1 /* Build configuration list for PBXNativeTarget "MBProgressHUD Framework tvOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1777D3E41D757AF50037C7F1 /* Debug */,
1777D3E51D757AF50037C7F1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1D104D8D1ACA36CC00973364 /* Build configuration list for PBXNativeTarget "MBProgressHUD Framework" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1777D3DE1D757AF50037C7F1"
BuildableName = "MBProgressHUD.framework"
BlueprintName = "MBProgressHUD Framework tvOS"
ReferencedContainer = "container:MBProgressHUD.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1777D3DE1D757AF50037C7F1"
BuildableName = "MBProgressHUD.framework"
BlueprintName = "MBProgressHUD Framework tvOS"
ReferencedContainer = "container:MBProgressHUD.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1777D3DE1D757AF50037C7F1"
BuildableName = "MBProgressHUD.framework"
BlueprintName = "MBProgressHUD Framework tvOS"
ReferencedContainer = "container:MBProgressHUD.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -51,8 +49,6 @@
ReferencedContainer = "container:MBProgressHUD.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -51,8 +49,6 @@
ReferencedContainer = "container:MBProgressHUD.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
+20
View File
@@ -0,0 +1,20 @@
// swift-tools-version:5.9
import PackageDescription
let package = Package(
name: "MBProgressHUD",
products: [
.library(name: "MBProgressHUD", targets: ["MBProgressHUD"])
],
targets: [
.target(
name: "MBProgressHUD",
dependencies: [],
path: ".",
exclude: ["Demo"],
sources: ["MBProgressHUD.h", "MBProgressHUD.m"],
resources: [.copy("PrivacyInfo.xcprivacy")],
publicHeadersPath: "include"
)
]
)
+14
View File
@@ -0,0 +1,14 @@
<?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>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
</dict>
</plist>
+34 -20
View File
@@ -1,23 +1,21 @@
# MBProgressHUD
[![Build Status](https://travis-ci.org/matej/MBProgressHUD.svg?branch=master)](https://travis-ci.org/matej/MBProgressHUD) [![codecov.io](https://codecov.io/github/matej/MBProgressHUD/coverage.svg?branch=master)](https://codecov.io/github/matej/MBProgressHUD?branch=master)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) [![CocoaPods compatible](https://img.shields.io/cocoapods/v/MBProgressHUD.svg?style=flat)](https://cocoapods.org/pods/MBProgressHUD) [![License: MIT](https://img.shields.io/cocoapods/l/MBProgressHUD.svg?style=flat)](http://opensource.org/licenses/MIT)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) [![Accio supported](https://img.shields.io/badge/Accio-supported-0A7CF5.svg?style=flat)](https://github.com/JamitLabs/Accio) [![CocoaPods compatible](https://img.shields.io/cocoapods/v/MBProgressHUD.svg?style=flat)](https://cocoapods.org/pods/MBProgressHUD) [![License: MIT](https://img.shields.io/cocoapods/l/MBProgressHUD.svg?style=flat)](http://opensource.org/licenses/MIT)
`MBProgressHUD` is an iOS drop-in class that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the undocumented, private `UIKit` `UIProgressHUD` with some additional features.
[![](https://cloud.githubusercontent.com/assets/91322/26737574/95128ef6-477f-11e7-8b3a-456b2b585e75.png)](https://cloud.githubusercontent.com/assets/91322/26737572/94a137a6-477f-11e7-9778-6266006f2dba.png)
[![](https://cloud.githubusercontent.com/assets/91322/26737576/951cc0c4-477f-11e7-9bc4-891cbbe70f80.png)](https://cloud.githubusercontent.com/assets/91322/26737575/95178c6c-477f-11e7-8df9-03aeeca5d39d.png)
[![](https://cloud.githubusercontent.com/assets/91322/26737577/9523169a-477f-11e7-83d9-c1a55b724c0a.png)](https://cloud.githubusercontent.com/assets/91322/26737578/95235920-477f-11e7-9968-9ecf506aba06.png)
[![](https://cloud.githubusercontent.com/assets/91322/26737579/954371ce-477f-11e7-85f8-660807a7f35e.png)](https://cloud.githubusercontent.com/assets/91322/26737573/95048432-477f-11e7-8f1d-4d5736b10488.)
[![](https://cloud.githubusercontent.com/assets/91322/26737581/954e3c9e-477f-11e7-93d9-2a8e2e0e7dd0.png)](https://cloud.githubusercontent.com/assets/91322/26737580/954aff70-477f-11e7-9634-5802daea2dee.png)
[![](https://cloud.githubusercontent.com/assets/91322/26737583/955ba17c-477f-11e7-93aa-d952fb0bbce3.png)](https://cloud.githubusercontent.com/assets/91322/26737582/9552886c-477f-11e7-8e90-46acd9a8527c.png)
[![](https://cloud.githubusercontent.com/assets/91322/26737585/95a31822-477f-11e7-9ca6-b33ceb3a3f49.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.
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/1-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/1.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/2-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/2.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/3-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/3.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/4-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/4.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/5-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/5.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/6-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/6.png)
[![](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/7-small.png)](https://raw.githubusercontent.com/wiki/matej/MBProgressHUD/Screenshots/7.png)
## Requirements
`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:
`MBProgressHUD` works on iOS 9.0+. It depends on the following Apple frameworks, which should already be included with most Xcode templates:
* Foundation.framework
* UIKit.framework
@@ -31,16 +29,28 @@ You will need the latest developer tools in order to build `MBProgressHUD`. Old
[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', '~> 1.0.0'`
1. Add a pod entry for MBProgressHUD to your Podfile `pod 'MBProgressHUD', '~> 1.2.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`
1. Add MBProgressHUD to your Cartfile. e.g., `github "jdg/MBProgressHUD" ~> 1.2.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.
### SwiftPM / Accio
1. Add the following to your `Package.swift`:
```swift
.package(url: "https://github.com/jdg/MBProgressHUD.git", .upToNextMajor(from: "1.2.0")),
```
2. Next, add `MBProgressHUD` to your App targets dependencies like so:
```swift
.target(name: "App", dependencies: ["MBProgressHUD"]),
```
3. Then open your project in Xcode 11+ (SwiftPM) or run `accio update` (Accio).
### Source files
Alternatively you can directly add the `MBProgressHUD.h` and `MBProgressHUD.m` source files to your project.
@@ -72,18 +82,18 @@ dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
});
```
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.
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];
hud.mode = MBProgressHUDModeAnnularDeterminate;
hud.labelText = @"Loading";
hud.label.text = @"Loading";
[self doSomethingInBackgroundWithProgressCallback:^(float progress) {
hud.progress = progress;
} completionCallback:^{
[hud hide:YES];
[hud hideAnimated:YES];
}];
```
@@ -92,14 +102,14 @@ You can also use a `NSProgress` object and MBProgressHUD will update itself when
```objective-c
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeAnnularDeterminate;
hud.labelText = @"Loading";
hud.label.text = @"Loading";
NSProgress *progress = [self doSomethingInBackgroundCompletion:^{
[hud hide:YES];
[hud hideAnimated: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:`.
Keep in mind that UI updates, including calls to MBProgressHUD should always be done on the main thread.
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.
@@ -123,4 +133,8 @@ This code is distributed under the terms and conditions of the [MIT license](LIC
## Change-log
A brief summary of each MBProgressHUD release can be found in the [CHANGELOG](CHANGELOG.mdown).
A brief summary of each MBProgressHUD release can be found in the [CHANGELOG](CHANGELOG.mdown).
## Privacy
MBProgressHUD does not collect any data. See [SDK Privacy Practices](https://bukovinski.com/sdk-privacy/mbprogresshud/) for more information.
+1
View File
@@ -0,0 +1 @@
../../MBProgressHUD.h
+5
View File
@@ -0,0 +1,5 @@
module MBProgressHUD {
umbrella header "MBProgressHUD/MBProgressHUD.h"
export *
module * { export * }
}