Weak linking UIPopoverBackgroundView

2019-06-12 20:52发布

I have a project that has to be deployed to 4.0 but has some features that are 5.0 only, such as UI customization.

I want my UIPopoverBackgroundView subclass to be weak linked, but I always get the following error when launching on 4.X devices

        dyld: Symbol not found: _OBJC_CLASS_$_UIPopoverBackgroundView

I can't use the NS_CLASS_AVAILABLE macro since my custom Background of the popover is a subclass of the UIPopoverBackgroundView class, so it has to be declared in a .h . How can I weak link only part of UIKit? Or is there any other way around this issue?

Thanks to all

1条回答
Melony?
2楼-- · 2019-06-12 21:42

After a lot of googling, turns out that Marco had the answer...

http://www.marco.org/2010/11/22/supporting-older-versions-of-ios-while-using-new-apis

查看更多
登录 后发表回答