简体   繁体   English

iOS:如何仅在不包含应用程序的扩展程序中运行框架代码

[英]iOS:How to run framework code only in extension not containing app

Framework is a good way to share code between Containing App and Extension. 框架是在Containing App和Extension之间共享代码的好方法。

Sometimes I want some code to run only when target is Containing App not Extension, or vice versa. 有时,我希望某些代码仅在目标是包含应用程序而不是扩展程序时才运行,反之亦然。

Is there something like TARGET_OS_EXTENSION ? 是否有类似TARGET_OS_EXTENSION的东西?

use your macro by yourself, just example in target marcro in ios 自己使用宏,仅是iOS目标marcro中的示例
it is very flexible 它非常灵活

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在iOS App包含扩展和扩展(不是主机应用程序)之间进行通信 - How to communicate between iOS App Containing Extension and Extension (not Host App) 如何重用包含应用程序的代码进行操作扩展? - How to reuse the code of the containing app for action extension? 如何检测在 iOS 8 上的包含应用程序中启用了应用程序扩展? - How to detect an app extension is enabled in containing app on iOS 8? 在扩展的包含应用程序中将嵌入式框架与部署目标iOS 7.0及更早版本一起使用 - Using embedded framework in extension's containing app with deployment target iOS 7.0 and earlier iOS 操作扩展无法打开包含应用程序 - iOS action extension cannot open containing app 如何将AFNetworking包含为通过CocoaPods在iOS应用程序和扩展中使用的框架 - How to include AFNetworking as a Framework for using in an iOS App and Extension via CocoaPods iOS:如何要求应用程序只能在4英寸显示屏上运行 - iOS: how to require app to only run on 4" display 如何创建/使用共享应用程序组容器作为包含应用程序及其在ios中的扩展名之间的缓存存储 - How to create/use a shared app group container as cache storage between containing app and it's extension in ios 如何使用应用程序扩展中的 IPC 将信息异步发送到 iOS 上的包含应用程序? - How can I use IPC from an app extension to asynchronously send information to the containing app on iOS? 如何在iOS上的应用程序上运行代码一次(即使应用程序将被删除并重新安装)? - How to run code on app for iOS only one time (even the application will be removed and reinstalled)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM