         }
         let screenSize = UIScreen.mainScreen().bounds.size
         UIView.animateWithDuration(0.2) {
-            self.frame = CGRectMake(0, screenSize.height - 260.0, screenSize.width, 260.0)
+            self.frame = CGRectMake(0, self.parentViewHeight() - 260.0, screenSize.width, 260.0)
         }
     }
 

    func hidePicker() {
        let screenSize = UIScreen.mainScreen().bounds.size
        UIView.animateWithDuration(0.2) {
            self.frame = CGRectMake(0, screenSize.height, screenSize.width, 260.0)
        }
    }


        }
    }

    private func parentViewHeight() -> CGFloat {
        return superview?.frame.height ?? UIScreen.mainScreen().bounds.size.height
    }

}

@objc
