Library Installation

Obtaining the library

The ownCloud iOS library may be obtained from the following Github repository:

Once obtained, this code should be compiled with Xcode 6. The Github repository not only contains the library, ownCloud iOS library, but also contains a sample project, OCLibraryExample, which will assist in learning how to use the library.

Add the library to a project

There are two methods to add this library to a project.

  • Reference the headers and library binary file (.a) directly.

  • Include the library as a subproject.

Which method to choose depends on user preference as well as whether the source code and project file of the static library are available.

Reference headers and library binary files

Follow these steps if this is the desired method.

  1. Compile the ownCloud iOS library and run the project. A libownCloudiOS.a file will be generated.

The following files are required:

Library file

  • libownCloudiOS.a (Library)

Library Classes

  • OCCommunication.h (Accessors) Import in the communication class

  • OCErrorMsg.h (Error Messages) Import in the communication class

  • OCFileDto.h and OCFileDto.m (File/Folder object) Import when using

  • readFolder and readFile methods

  • OCFrameworkConstants.h (Customize constants)

  1. Add the library file to the project. From the Build Phases tab, scroll to Link binary files and select the + to add a library. Select the library file.


  1. Add the path of the library header files. Under the Build Settings tab, select the target library and add the path in the Header Search Paths field.


  1. Remaining in the Build Setting tab, add the flag -Obj-C under the Other Linker Flags option.


At this stage, the library is included on your project and you can start communicating with the ownCloud server.

Include the library as a subproject

Follow these steps if this is the desired method.

  1. Add the file ownCloud iOS library.xcodeproj to the project via drag and drop.


  1. Within the project, navigate to the Build Phases tab. Under the Target Dependencies section, select the `+' and choose the library target.


  1. Link the library file to the project target. Under the Build Phases tab, select the +' under the `Link Binary with Libraries section and select the library file.


  1. Add the flag -Obj-C to Other Linker Flags under the project target on the Build Settings tab.


  1. Finally add the path of the library headers. Under the Build Settings tab, add the path under the Header Search Paths option.