UIPopoverController for iphone not working?

后端 未结 8 1680
日久生厌
日久生厌 2020-11-27 13:40

I need to use a UIPopOverController for my iPhone app ,i searched stackoverflow someone said UIPopoverController does not run on iphone iphone device WHY?.when i run on ipho

8条回答
  •  粉色の甜心
    2020-11-27 13:54

    You CAN use popoverController in iPhone apps.

    1. Create a category

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

    2. Import it to your class and use popover in iPhone as usual.

    But remember that this is private method and Apple can reject your app. But I know people who use this normally and Apple published their apps.

提交回复
热议问题