Skip to content

Commit

Permalink
Merge pull request #63 from albinekcom/fix_crash_in_default_show_methods
Browse files Browse the repository at this point in the history
Fix crash in default show() methods
  • Loading branch information
corin8823 authored Apr 2, 2017
2 parents 53c477a + 99b76a0 commit 08e1a78
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 08e1a78

Please sign in to comment.