> For the complete documentation index, see [llms.txt](https://capsule-video.gitbook.io/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://capsule-video.gitbook.io/cloud/ios-static-library/getting-started.md).

# Getting Started

### Hypno Static Library and Example Xcode Project

We can provide a sample Xcode project to get up and running quickly with `libhypno` in a working demo app that can be built with Xcode. Please contact  <developer-support@hypno.com> to request download links.

1\. Download the libhypno iOS Example Project and extract the archive anywhere on your system.\
2\. If you haven’t already done so, download libhypno and extract the contents of the archive into /path/to/HYPNOApp (iOS Example Project)/vendor.\
3\. Open `HYPNOApp.xcodeproj` with Xcode.\
4\. Plug in your iOS device and build/run.

Alternately, if you want to add the `libhypno` static library to an existing Xcode project, download it and follow these instructions:

#### Building

1. `Under Build Settings`/`Apple Clang - Language - C++` set `C++ Language Dialect` to GNU++17 (libhypno makes use of c++17 features).
2. `Under Build Settings`/`Search Paths` add an entry in `Header Search Paths` to `path/to/libhypno folder` example: `$(PROJECT_DIR)/vendor` if you have a folder in your project directory called vendor with a libhypno folder inside it.
3. `Under Build Phases`/`Link Binary With Libraries` add `+` or drag and drop `libhypno.a` static library from your `libhypno` folder.
4. `Under Build Phases`/`Link Binary With Libraries` add `AVFoundation.framework`, `CoreMedia.framework`, and `CoreServices.framework`.

#### Using

1. Change your App Delegate file's extension too `.mm` (libhypno makes use of c++).
2. `#import <libhypno/hypno.h>` inside your App Delegate file.
3. Inside your `application:didFinishLaunchingWithOptions:`method add a call to initialize the library `hypno::Platform::initialize();`
4. Inside your `applicationWillTerminate:` method add a call to shutdown the library `hypno::Platform::shutdown();`
5. Declare a property `@property (nonatomic, assign) std::shared_ptr<hypno::Video> video;`
6. `@synthesize video;`
7. Create your first hypno `video = hypno::Video::create ({ "path/to/JavaScript file", { path/to/main video file } });`

#### Objective-c Wrapper

`libhypno` objective-c wrapper(s) can be found [here](https://gist.github.com/jacobsologub/d69336988f7def21e13a66a2b01e8a18).
