How to add Sharekit to existing project - iphone

How to add sharekit to existing project for sharing on social networks.
Following instructions from sharekit wiki.
If i add sharekit.xcodeproj to my project i see only one target in share kit but in sharekit wiki it shows four targets.
When trying to add ShareKit's targets as depenedencies to your project's build phase: your project's app target - build phases - target dependencies add 2 new targets from ShareKit subproject: "Static Library" and "Resource Bundle". I dont find any static library and resource bundle.
Please help how to add sharekit in project.

what i did to find these targets ;
Right click on your your project navigator in xCode, then choose Add files to ...
then choose submodules in your project folder and add.
After that you will find "Static Library" and "Resource Bundle" in targets dependencies.

Related

Is it possible to import and add .xcframework file to a static xcode library project?

I have set of .xcframework files, and currently I working on a static library
I need to integrate those .xcframework files into my static library, but it seems Build settings menu and build phase menu on a static library project is different and I can't add .xcframwork files like I used to do on a Xcode app project
You add dependencies under Build Phases tab, in Link Binary With Libraries step:
Be advised that in this scenario you cannot embed any framework. It either has to be delivered alongside the library or adding the dependencies has to be part of the library integration instructions. I.e. the consumers of your library will need to add this xcframework dependency manually in their target.

How to install XCGLogger?

I want to add the XCGLogger Framework to my project.
At the XCGLogger github page is a "how to use"-section and a also a demo project. Some tasks are not quite clear for me. Therefore some questions:
"Add the XCGLogger project as a subproject to your project" - Does it mean to simply drag the "Library"-Folder into to my project folder in the project navigator?
"and add either the iOS library as a dependancy of your target(s)" - How am I doing that?
What do I have to do at the Product->Scheme->Edit Scheme ... Menu? Because I don't want the framework in my release build.

iOS framework resource files

I have created a framework with bundle files. Bundle files are under resource folder inside the framework. So my problem was whenever someone need to integrate the framework in their project then they have to drag and drop the bundle file from framework resource folder to project. Is possible to programmatically link the framework resource file and read it inside the project?
To include the resource bundle, select the target of your framework, and in the Build Phases > Copy bundle resources, click on the + button and add any resource bundle which you wish to have packaged into your framework.
When you build the framework, the resource will be copied. Make sure that this file exists though or you'll get a build error.
If you go in "Edit Schemes" for your framework project, in the "Build" section, you can add the resource file, so that when you will build the framework, it will also rebuild the resource bundle.

iOS Static Library as a Subproject of a Project That Has Custom Build Configurations?

I'm trying to share code between multiple Xcode projects. I've followed Apple's notes on creating a static library subproject within a project:
http://developer.apple.com/library/ios/technotes/iOSStaticLibraries/iOSStaticLibraries.pdf
This works great! However, when I follow the same instructions using my own project, I find that the header files I make public in the static library can not be found by code within my app.
This is because my project uses custom build configurations. I have one for Ad Hoc builds, App Store builds, etc.
For example: when I build the project using a build config called "Ad Hoc", the static library subproject builds the Release configuration and copies its public headers to a folder called "Release". The main project then fails to build, complaining that it can't find headers that I'm importing from the static library. The errors appear in the Issue Navigator as: Lexical or Preprocessor Issue
So my question is: how do you set up a static library as a subproject of a project that has build configurations that the library doesn't?
I came across this issue when making my custom project templates.
Add "$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)" to the "Header Search Paths" and "User Header Search Paths" for any build configurations you use Archive with and make sure it is set to be "recursive" as opposed to "non-recursive". This will tell your app to search the "Release" directory in your build directory for header files.
The problem is that for Debug builds ALL header files are copied to a single directory under derived data. But when you archive the files are copied to a folder named after the build configuration. So when you do a "Ad Hoc" build all your files get copied to the "Ad Hoc" folder but your static libraries files get copied to the "Release" folder. These folders sit side by side beside one another and unless told to do so the header files will only be searched for under the "Ad Hoc" folder.
Here is the GitHub commit for my project templates where I fixed the problem
https://github.com/reidmain/Xcode-5-Project-Templates/commit/e465aa3d5c82118cc0d5af3a7f6f094d86b1ec63

Libxml in a library for ios

I have created a cocoa touch static library that contains functionality that I want to include in several apps. This library is linked to libxml and I have the header search path /usr/include/libxml2. The library builds correctly.
I include this library in another xcode project as a reference (by dragging the library xcodeproj file into my app xcode project. I also setup the target to have the library as a direct dependency, setup the header search path to include /usr/include/libxml2, and add libxml2.dylib in the frameworks.
The problem is, when I try to build the project is has a build error:
Libxml/tree.h: No such file or directory.
I initially had this problem trying to build the library and solved it by adding the header search path and framework into the project for libxml2.
Incidentally, i have another app that uses the library but does not use libxml, it builds and runs correctly.
So the problem seems to be using libxml in both the app and a linked library.
Anybody any ideas?
Yours hopefully,
Neil.
You probably need to add the include path /usr/include/libxml2 to both the target and the project.
To add it to the target, right click on the target and select Get Info.
To add it to the project, go to the Project menu > Edit Project Settings.
In both cases, make sure you've selected Configuration: "All Configurations".