Skip to content

Commit

Permalink
Refactors to avoid force unwrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
s4cha committed Aug 21, 2018
1 parent 89bf8ef commit 82004a0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ extension Notification {
}
// Weirdly enough UIKeyboardFrameEndUserInfoKey doesn't have the same behaviour
// in ios 10 or iOS 11 so we can't rely on v.cgRectValue.width
return (UIApplication.shared.keyWindow?.bounds.height)! - v.cgRectValue.minY
let screenHeight = UIApplication.shared.keyWindow?.bounds.height ?? UIScreen.main.bounds.height
return screenHeight - v.cgRectValue.minY
}
}

Expand Down

0 comments on commit 82004a0

Please sign in to comment.