Can Cocoapods support using a shared framework in both an iOS app and iOS extension where the shared framework uses APIs that aren't extension-safe? -


i support suite of related ios apps, of make use of extensions (watchkit , today widget). of these apps , extensions make use of shared private framework i've built on time handling workflows around authentication , common business logic. framework maintained private pod.

recently, i've run problem i'd add method framework that's useful ios apps (extensions don't need it) uses apis unavailable extensions (such [uiapplication sharedapplicaion]). i'd usual benefit of shared code, implemented in 1 place (the shared framework) various apps leverage. however, can't find way conditionally include method apps , not extensions without getting compile-time error.

enter image description here

normal recommendations around problem suggest use of preprocessor macro opt-out around problematic code if desired, doesn't work shared framework situation. macros applied @ compile-time, shared framework either going include method, or not, , there doesn't seem runtime solution optionally exclude it. if it's included, extensions can't compile. if it's not included, apps can't make use of feature.

i started investigating if there way cocoapods automatically make 2 versions of framework, 1 used apps, , 1 extensions, seem introduce problems around duplicate symbols, , doesn't seem supported.

are there other suggestions how handle this, apart extracting out problematic functionality different framework? (i prefer share one)


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -