Skip to content

Commit

Permalink
Merge pull request #326 from perrystreetsoftware/master
Browse files Browse the repository at this point in the history
  • Loading branch information
sberrevoets authored Oct 5, 2021
2 parents 44ccd7e + 9c6b79d commit 12033a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/AlertVisualStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ open class AlertVisualStyle: NSObject {

switch alertStyle {
case .alert:
if #available(iOS 11, *), UIApplication.shared.keyWindow!.safeAreaInsets.bottom > 0 {
if #available(iOS 11, *), UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0 > 0 {
self.margins = .zero
} else {
self.margins = UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 0)
Expand All @@ -164,7 +164,7 @@ open class AlertVisualStyle: NSObject {
self.actionViewSize = CGSize(width: 90, height: 44)

case .actionSheet:
if #available(iOS 11, *), UIApplication.shared.keyWindow!.safeAreaInsets.bottom > 0 {
if #available(iOS 11, *), UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0 > 0 {
self.margins = UIEdgeInsets(top: 30, left: 10, bottom: 0, right: 10)
} else {
self.margins = UIEdgeInsets(top: 30, left: 10, bottom: -10, right: 10)
Expand Down

0 comments on commit 12033a1

Please sign in to comment.