     public func dismiss () {
 
         if self.shownInPopover {
-
             self.shownInPopover = false
-            let isIOS7 = floor(NSFoundationVersionNumber) <= floor(NSFoundationVersionNumber_iOS_7_1)
-            if isIOS7 {
-                self.ios7Popover?.dismissPopoverAnimated(true)
-            }
-            else {
-                self.dismissViewControllerAnimated(true, completion: nil)
-            }
+            self.dismissViewControllerAnimated(true, completion: nil)
         }
         else {
             UIView.animateWithDuration(0.3,

import Foundation
import UIKit

public class BMPickerModal: UIViewController, UIPopoverPresentationControllerDelegate, UIPickerViewDataSource, UIPickerViewDelegate {

    public enum BMPickerModalMode {
        case DatePicker
        case Picker
    }

    /// Closure to be executed when new date is selected
    public var selectionClosure: ((AnyObject) -> Void)?


    private let window: UIWindow = UIApplication.sharedApplication().windows[0] as! UIWindow
    private let popoverSize: CGSize = CGSizeMake(460, 261)

    // MARK: View Life Cycle

