1

I'm trying to create a UIPopOverController for a swift app i'm working on,

previously in obj-c we can get around with having a category like so UIPopoverController for iPhone by implementing category

how do i perform something similar in swift?

appreciate your help.

=====

In the end I just gave up, didnt see the point in spending too much time on trying to create extensions and cursing myself as to why its not working

used https://github.com/nicolaschengdev/WYPopoverController

Community
  • 1
  • 1
user3296887
  • 11
  • 1
  • 2
  • 2
    In Swift categories are called extensions. So, write an extension which does what your Objective-C category did. – dasdom Jun 24 '14 at 10:29
  • I did, here it is , but no effect extension UIPopoverController{ class func popoversDisabled()->Bool{ return false } } – user3296887 Jun 24 '14 at 16:59

1 Answers1

1

I tried:

extension UIPopoverController {
    class var _popoversDisabled : Bool {
    get { return false }}
}

to override UIPopover class' _popoverDisabled which seems to work as the idiom error is gone.

Edit: It is working in Xcode 6 beta 4 on iPhone with iOs7.1

floohh
  • 79
  • 5
  • Tried this on xcode beta 6, popover appears but it occupies the entire screen and does not respect the popoverContentSize set for it. still scratching my head – user3296887 Sep 02 '14 at 08:23