How to create a cocoa -touch structure with a search path similar to <Google / Analytics.h>

I am trying to create a cocoa framework with a header file that follows this template:

#include <Compay/Product.h> 

instead of the usual

 #include <Product/Product.h> 

e.g. #include <Google/Analytics.h>

instead of #include <Analytics/Analytics.h>

In xcode 7?

+5
source share
1 answer

Update

Based on OP comments and documentation notes. I would suggest changing the path of the shared headers folder found in the build settings in the "Packaging" section:

"... Install Subpath to include / companyname / $ {PRODUCT_NAME}"

public-headers-folders-path

The detailed tutorial below describes this in context and how to manage multiple frameworks using the same project.

Sitelink

Have you tried the simplest thing possible? (I never did this, just thinking about the most direct way to achieve the goal) Cases> - Create a new structure and name it CompanyName. - Add headers as needed - Assembly and launch - Integration with your application ~ Must see the company /headerfile.h as desired>

Apple docs, when setting up headers, states the following:

Then you add the “Copy Files” phase to export your headers. There will be new static library targets created using Xcode 4.4 or later with an appropriately configured “Copy Files” phase for headers, so you should check if you already have one file before creating it. If you don’t want, click “Add Build Phase” at the bottom of the destination editor and select “Add Copy Files”. Expand a new assembly of copies of files and set the destination in the "Product Directory". Set subpath to include / $ {PRODUCT_NAME}. This will copy the files to the folder with the name after your library (taken from the PRODUCT_NAME build settings), inside the folder with the name include, inside the directory of your built-in products. include the folder inside the assembly product catalog by default the header search path for applications, so this is a good place to place the header files. Putting the headers in a folder named your PRODUCT_NAME will allow you to split the library headers into the library name, for clarity.

This seems to mean that you can manipulate the directory structure to get the right structure. See Update for a simpler way to manage folder structure by using folder assembly settings for shared headers. A detailed guide provides a good understanding of this in context, as well as visual examples of managing multiple frameworks. Perhaps only a change in the name of the product, as indicated above, will allow you to get the name of your company at will.

Extended information

iOS Framework - detailed tutorial

Swift frameworks

+2
source

Source: https://habr.com/ru/post/1234389/


All Articles