Skip to content

Commit

Permalink
13.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
relatedcode committed Oct 5, 2023
1 parent ccfb375 commit dec8dd8
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 23 deletions.
2 changes: 1 addition & 1 deletion ProgressHUD.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'ProgressHUD'
s.version = '13.8.3'
s.version = '13.8.4'
s.license = 'MIT'

s.summary = 'A lightweight and easy-to-use Progress HUD for iOS.'
Expand Down
41 changes: 25 additions & 16 deletions ProgressHUD/Sources/ProgressHUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import UIKit

public class ProgressHUD: UIView {

var main = UIApplication.shared.windows.first ?? UIWindow()
var main: UIWindow!

// Banner properties
var viewBanner: UIToolbar?
Expand Down Expand Up @@ -91,7 +91,7 @@ extension ProgressHUD {

removeDelayTimer()

setupNotifications()
setupWindow()
setupBackground(interaction)
setupToolbar()
setupStatus(text)
Expand Down Expand Up @@ -124,6 +124,7 @@ extension ProgressHUD {
}

setupSizes(text, animation)
setupNotifications()
setupPosition()
displayHUD()
}
Expand Down Expand Up @@ -170,7 +171,17 @@ extension ProgressHUD {
}
}

// MARK: - Background View
// MARK: - Window
extension ProgressHUD {

private func setupWindow() {
if (main == nil) {
main = UIApplication.shared.windows.first
}
}
}

// MARK: - Background
extension ProgressHUD {

private func removeBackground() {
Expand Down Expand Up @@ -455,19 +466,17 @@ extension ProgressHUD {
}
}

private func keyboardHeight() -> CGFloat {
if let keyboardWindowClass = NSClassFromString("UIRemoteKeyboardWindow"),
let inputSetContainerView = NSClassFromString("UIInputSetContainerView"),
let inputSetHostView = NSClassFromString("UIInputSetHostView") {

for window in UIApplication.shared.windows {
if window.isKind(of: keyboardWindowClass) {
for firstSubView in window.subviews {
if firstSubView.isKind(of: inputSetContainerView) {
for secondSubView in firstSubView.subviews {
if secondSubView.isKind(of: inputSetHostView) {
return secondSubView.frame.size.height
}
func keyboardHeight() -> CGFloat {
let windows = UIApplication.shared.windows
for window in windows {
for view in window.subviews {
if String(describing: type(of: view)).hasPrefix("UIInputSetContainerView") {
for subview in view.subviews {
if String(describing: type(of: subview)).hasPrefix("UIInputSetHostView") {
let screenRect = UIScreen.main.bounds
let keyboardRect = window.convert(subview.frame, to: nil)
if keyboardRect.intersects(screenRect) {
return subview.frame.height
}
}
}
Expand Down
11 changes: 6 additions & 5 deletions ProgressHUD/app.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
29D29EF01D9A59E4006CA074 = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 1000;
ProvisioningStyle = Manual;
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 1;
Expand Down Expand Up @@ -329,15 +328,16 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "";
INFOPLIST_FILE = app/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 13.8.3;
MARKETING_VERSION = 13.8.4;
PRODUCT_BUNDLE_IDENTIFIER = com.relatedcode.progresshud;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -360,14 +360,15 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "";
INFOPLIST_FILE = app/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 13.8.3;
MARKETING_VERSION = 13.8.4;
PRODUCT_BUNDLE_IDENTIFIER = com.relatedcode.progresshud;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
1 change: 1 addition & 0 deletions ProgressHUD/app/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {

window = UIWindow(frame: UIScreen.main.bounds)

let viewController = ViewController(nibName: "ViewController", bundle: nil)
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## WHAT'S NEW

### Version: 13.8.4

- Corrected the window initialization issue where the `ProgressHUD` class was initialized before the 'main' window was created.
- Resolved the keyboard height discrepancy that occurred when the keyboard was already visible before displaying the HUD.

### Version: 13.8.3

- Removed the `AlertIcon` feature. Please use the `symbol:` parameter for similar functionality.
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
13.8.3
13.8.4

0 comments on commit dec8dd8

Please sign in to comment.