Skip to content

Commit

Permalink
Fix crash in default show() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
albinekcom committed Mar 6, 2017
1 parent f362fb9 commit 99b76a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Classes/Popover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ open class Popover: UIView {
}

open func showAsDialog(_ contentView: UIView) {
self.showAsDialog(contentView, inView: UIApplication.shared.keyWindow!)
self.showAsDialog(contentView, inView: UIApplication.shared.windows.first!)
}

open func showAsDialog(_ contentView: UIView, inView: UIView) {
Expand All @@ -185,7 +185,7 @@ open class Popover: UIView {
}

open func show(_ contentView: UIView, fromView: UIView) {
self.show(contentView, fromView: fromView, inView: UIApplication.shared.keyWindow!)
self.show(contentView, fromView: fromView, inView: UIApplication.shared.windows.first!)
}

open func show(_ contentView: UIView, fromView: UIView, inView: UIView) {
Expand All @@ -205,7 +205,7 @@ open class Popover: UIView {
}

open func show(_ contentView: UIView, point: CGPoint) {
self.show(contentView, point: point, inView: UIApplication.shared.keyWindow!)
self.show(contentView, point: point, inView: UIApplication.shared.windows.first!)
}

open func show(_ contentView: UIView, point: CGPoint, inView: UIView) {
Expand Down

0 comments on commit 99b76a0

Please sign in to comment.