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.
-
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
andOCFileDto.m
(File/Folder object) Import when using -
readFolder
andreadFile
methods -
OCFrameworkConstants.h
(Customize constants)
-
Add the library file to the project. From the
Build Phases
tab, scroll toLink binary files
and select the+
to add a library. Select the library file.
-
Add the path of the library header files. Under the
Build Settings
tab, select the target library and add the path in theHeader Search Paths
field.
-
Remaining in the
Build Setting
tab, add the flag-Obj-C
under theOther 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.
-
Add the file
ownCloud iOS library.xcodeproj
to the project via drag and drop.
-
Within the project, navigate to the
Build Phases
tab. Under theTarget Dependencies
section, select the `+' and choose the library target.
-
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.
-
Add the flag
-Obj-C
toOther Linker Flags
under the project target on theBuild Settings
tab.
-
Finally add the path of the library headers. Under the
Build Settings
tab, add the path under theHeader Search Paths
option.