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
Under Build Settings
/Apple Clang - Language - C++
setC++ Language Dialect
to GNU++17 (libhypno makes use of c++17 features).Under Build Settings
/Search Paths
add an entry inHeader Search Paths
topath/to/libhypno folder
example:$(PROJECT_DIR)/vendor
if you have a folder in your project directory called vendor with a libhypno folder inside it.Under Build Phases
/Link Binary With Libraries
add+
or drag and droplibhypno.a
static library from yourlibhypno
folder.Under Build Phases
/Link Binary With Libraries
addAVFoundation.framework
,CoreMedia.framework
, andCoreServices.framework
.
Using
Change your App Delegate file's extension too
.mm
(libhypno makes use of c++).#import <libhypno/hypno.h>
inside your App Delegate file.Inside your
application:didFinishLaunchingWithOptions:
method add a call to initialize the libraryhypno::Platform::initialize();
Inside your
applicationWillTerminate:
method add a call to shutdown the libraryhypno::Platform::shutdown();
Declare a property
@property (nonatomic, assign) std::shared_ptr<hypno::Video> video;
@synthesize video;
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.
Last updated
Was this helpful?