Skip to content

Commit

Permalink
BUGFIX
Browse files Browse the repository at this point in the history
fix:
- Fixed an issue with incorrectly calculated safe area size on iPhones
  • Loading branch information
FulcrumOne committed Nov 26, 2023
1 parent a579ddd commit d8d9369
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MijickPopupView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Pod::Spec.new do |s|
PopupView is a free and open-source library dedicated for SwiftUI that makes the process of presenting popups easier and much cleaner.
DESC

s.version = '2.2.0'
s.version = '2.2.1'
s.ios.deployment_target = '14.0'
s.osx.deployment_target = '12.0'
s.swift_version = '5.0'
Expand Down
6 changes: 5 additions & 1 deletion Sources/Internal/Managers/ScreenManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ScreenManager: ObservableObject {
private var subscription: [AnyCancellable] = []

static let shared: ScreenManager = .init()
private init() { subscribeToScreenOrientationChangeEvents() }
private init() { subscribeToScreenOrientationChangeEvents(); updateScreenDetails() }
}

private extension ScreenManager {
Expand All @@ -31,6 +31,10 @@ private extension ScreenManager {
.sink(receiveValue: updateScreenValues)
.store(in: &subscription)
}
func updateScreenDetails() { DispatchQueue.main.async {
self.size = UIScreen.size
self.safeArea = UIScreen.safeArea
}}
}
private extension ScreenManager {
func updateScreenValues(_ value: NotificationCenter.Publisher.Output) {
Expand Down

0 comments on commit d8d9369

Please sign in to comment.