blackmirror-media / BMPickerModal

BMPickerModal is a control showing a UIPicker or a UIDatePicker in a modal view.
MIT License
5 stars 3 forks source link

unresolved identifier #1

Closed gaming-hacker closed 9 years ago

gaming-hacker commented 9 years ago

hi, i get an error on iPad

ViewController.swift:86:45: Use of unresolved identifier 'cell'

datePickerModal.showInPopover({ (selectedDate) -> Void in
  let theNewDate = selectedDate as NSDate
  // Do something with the date here
  }, sourceView: self.view, sourceRect: cell!.frame, inViewController: self)

any help?

lhilton commented 9 years ago

This needs to be the bounds of the current container. For example, if you are using this directly at the top level in a UIViewController, your might want to do this:

datePickerModal.showInPopover({ (selectedDate) -> Void in
  let theNewDate = selectedDate as NSDate
  // Do something with the date here
  }, sourceView: self.view, sourceRect: self.view.frame, inViewController: self)
gaming-hacker commented 9 years ago

Thanks for that.