0

I know that Popover controllers are for use exclusively on iPad devices, but on below question there is a comment in which user has mentioned about category, code is as below, UIPopoverController for iphone not working?

  // UIPopoverController+iPhone.h file
  @interface UIPopoverController (iPhone)
 + (BOOL)_popoversDisabled;
 @end

  // UIPopoverController+iPhone.m file
  @implementation UIPopoverController (iPhone)
 + (BOOL)_popoversDisabled {
     return NO; 
 } 
 @end 

Is this right way? Will Apple approve this?,

My iPad application is already done, now I am making it universal application, so instead of using any custom popover I want to add this category so that it will solve my issue and will reduce development efforts.

Community
  • 1
  • 1
Vishwa Patel
  • 484
  • 2
  • 10
  • It's a private method, since the OP of referenced post has mentioned that already, however in your particular case you might want to look at this post:[“Symbol not found” error for UIPopoverController in an iPhone/iPad Universal App](http://stackoverflow.com/questions/3026871/symbol-not-found-error-for-uipopovercontroller-in-an-iphone-ipad-universal-app) – Adil Soomro Dec 16 '13 at 12:05

2 Answers2

1

This is very hacky way, and you'll be taking a big risk putting it on the AppStore. Sure someone may have put a version in the store where they overlooked this, but it can break any moment and Apple may decide to remove his app.

Have you tested popovers on iPhone? Will you test in iOS7.1? Will it work exactly the same on iOS7.2 or iOS 7.3?

A far better solution would be to take an open source implementation of popovers and use that for iPhone (or both).

Léo Natan
  • 56,823
  • 9
  • 150
  • 195
0

I have live app with with popover in iPhone. Just You have to create interface for popover

NSObject+UIPopover_Iphone.h

#import <Foundation/Foundation.h>

@interface UIPopoverController (overrides)
+(BOOL)_popoversDisabled;
@end

NSObject+UIPopover_Iphone.m

#import "NSObject+UIPopover_Iphone.h"

@implementation UIPopoverController (overrides)

+(BOOL)_popoversDisabled
{
    return NO;
}

@end

and now just import NSObject+UIPopover_Iphone.h in your Viewcontroller.h

Edit

For iOS 8 you can use WYPopoverController.

Toseef Khilji
  • 17,192
  • 12
  • 80
  • 121