Skip to content

Commit dec8dd8

Browse files
committed
13.8.4
1 parent ccfb375 commit dec8dd8

File tree

6 files changed

+39
-23
lines changed

6 files changed

+39
-23
lines changed

ProgressHUD.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'ProgressHUD'
3-
s.version = '13.8.3'
3+
s.version = '13.8.4'
44
s.license = 'MIT'
55

66
s.summary = 'A lightweight and easy-to-use Progress HUD for iOS.'

ProgressHUD/Sources/ProgressHUD.swift

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import UIKit
1313

1414
public class ProgressHUD: UIView {
1515

16-
var main = UIApplication.shared.windows.first ?? UIWindow()
16+
var main: UIWindow!
1717

1818
// Banner properties
1919
var viewBanner: UIToolbar?
@@ -91,7 +91,7 @@ extension ProgressHUD {
9191

9292
removeDelayTimer()
9393

94-
setupNotifications()
94+
setupWindow()
9595
setupBackground(interaction)
9696
setupToolbar()
9797
setupStatus(text)
@@ -124,6 +124,7 @@ extension ProgressHUD {
124124
}
125125

126126
setupSizes(text, animation)
127+
setupNotifications()
127128
setupPosition()
128129
displayHUD()
129130
}
@@ -170,7 +171,17 @@ extension ProgressHUD {
170171
}
171172
}
172173

173-
// MARK: - Background View
174+
// MARK: - Window
175+
extension ProgressHUD {
176+
177+
private func setupWindow() {
178+
if (main == nil) {
179+
main = UIApplication.shared.windows.first
180+
}
181+
}
182+
}
183+
184+
// MARK: - Background
174185
extension ProgressHUD {
175186

176187
private func removeBackground() {
@@ -455,19 +466,17 @@ extension ProgressHUD {
455466
}
456467
}
457468

458-
private func keyboardHeight() -> CGFloat {
459-
if let keyboardWindowClass = NSClassFromString("UIRemoteKeyboardWindow"),
460-
let inputSetContainerView = NSClassFromString("UIInputSetContainerView"),
461-
let inputSetHostView = NSClassFromString("UIInputSetHostView") {
462-
463-
for window in UIApplication.shared.windows {
464-
if window.isKind(of: keyboardWindowClass) {
465-
for firstSubView in window.subviews {
466-
if firstSubView.isKind(of: inputSetContainerView) {
467-
for secondSubView in firstSubView.subviews {
468-
if secondSubView.isKind(of: inputSetHostView) {
469-
return secondSubView.frame.size.height
470-
}
469+
func keyboardHeight() -> CGFloat {
470+
let windows = UIApplication.shared.windows
471+
for window in windows {
472+
for view in window.subviews {
473+
if String(describing: type(of: view)).hasPrefix("UIInputSetContainerView") {
474+
for subview in view.subviews {
475+
if String(describing: type(of: subview)).hasPrefix("UIInputSetHostView") {
476+
let screenRect = UIScreen.main.bounds
477+
let keyboardRect = window.convert(subview.frame, to: nil)
478+
if keyboardRect.intersects(screenRect) {
479+
return subview.frame.height
471480
}
472481
}
473482
}

ProgressHUD/app.xcodeproj/project.pbxproj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@
129129
29D29EF01D9A59E4006CA074 = {
130130
CreatedOnToolsVersion = 8.0;
131131
LastSwiftMigration = 1000;
132-
ProvisioningStyle = Manual;
133132
SystemCapabilities = {
134133
com.apple.BackgroundModes = {
135134
enabled = 1;
@@ -329,15 +328,16 @@
329328
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
330329
CODE_SIGN_ENTITLEMENTS = "";
331330
CODE_SIGN_IDENTITY = "Apple Development";
332-
CODE_SIGN_STYLE = Manual;
331+
CODE_SIGN_STYLE = Automatic;
332+
CURRENT_PROJECT_VERSION = 1;
333333
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
334334
DEVELOPMENT_TEAM = "";
335335
GCC_PRECOMPILE_PREFIX_HEADER = YES;
336336
GCC_PREFIX_HEADER = "";
337337
INFOPLIST_FILE = app/Info.plist;
338338
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
339339
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
340-
MARKETING_VERSION = 13.8.3;
340+
MARKETING_VERSION = 13.8.4;
341341
PRODUCT_BUNDLE_IDENTIFIER = com.relatedcode.progresshud;
342342
PRODUCT_NAME = "$(TARGET_NAME)";
343343
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -360,14 +360,15 @@
360360
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
361361
CODE_SIGN_ENTITLEMENTS = "";
362362
CODE_SIGN_IDENTITY = "Apple Development";
363-
CODE_SIGN_STYLE = Manual;
363+
CODE_SIGN_STYLE = Automatic;
364+
CURRENT_PROJECT_VERSION = 1;
364365
DEVELOPMENT_TEAM = "";
365366
GCC_PRECOMPILE_PREFIX_HEADER = YES;
366367
GCC_PREFIX_HEADER = "";
367368
INFOPLIST_FILE = app/Info.plist;
368369
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
369370
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
370-
MARKETING_VERSION = 13.8.3;
371+
MARKETING_VERSION = 13.8.4;
371372
PRODUCT_BUNDLE_IDENTIFIER = com.relatedcode.progresshud;
372373
PRODUCT_NAME = "$(TARGET_NAME)";
373374
PROVISIONING_PROFILE_SPECIFIER = "";

ProgressHUD/app/AppDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1717
var window: UIWindow?
1818

1919
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
20+
2021
window = UIWindow(frame: UIScreen.main.bounds)
2122

2223
let viewController = ViewController(nibName: "ViewController", bundle: nil)

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## WHAT'S NEW
44

5+
### Version: 13.8.4
6+
7+
- Corrected the window initialization issue where the `ProgressHUD` class was initialized before the 'main' window was created.
8+
- Resolved the keyboard height discrepancy that occurred when the keyboard was already visible before displaying the HUD.
9+
510
### Version: 13.8.3
611

712
- Removed the `AlertIcon` feature. Please use the `symbol:` parameter for similar functionality.

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
13.8.3
1+
13.8.4

0 commit comments

Comments
 (0)