Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion Pod/Classes/ZAlertView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ import UIKit
}

self.height += ZAlertView.padding
let bounds = UIScreen.main.bounds
let bounds = self.backgroundView.bounds
self.alertView.frame = CGRect(x: bounds.width/2 - width/2, y: bounds.height/2 - height/2, width: width, height: height)
}

Expand Down Expand Up @@ -882,4 +882,19 @@ import UIKit
}

}

override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
self.perform(#selector(self.updateFrame), with: nil, afterDelay: 0.2)
}

/// Update background view frame
@objc func updateFrame() {
guard let window = UIApplication.shared.keyWindow else {
return
}
print(window.bounds)
self.backgroundView.frame = window.bounds
}
}