Setting up EasyAR iOS SDK¶
This article shows how to setup EasyAR non-Unity iOS projects using EasyAR package.
If you want to use EasyAR unity package, please read this for setup and this for samples.
If you want to run EasyAR non-Unity iOS sample, please read this instead.
Pre-Requirements¶
XCode 6 or later (we have tested in XCode 6.4 and XCode 7.1)
IPhone or IPad device, or other real Apple devices (EasyAR do not support running on the simulator)
Add Frameworks¶
If you are creating your own project directly from EasyAR package, you need to add these frameworks.
And for XCode 7.x, you need to manually set Framework Search Paths to include the path of easyar.framework. This is needed to include EasyAR headers from framework.
Initialize EasyAR¶
Use EasyAR::initialize to initialize EasyAR. You can add the initialize into your code like this.
EasyAR::initialize([key UTF8String]);
Set rotation¶
Use EasyAR::setRotationIOS to set rotation. You can add the code like this.
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
switch (toInterfaceOrientation)
{
case UIInterfaceOrientationPortrait:
EasyAR::setRotationIOS(270);
break;
case UIInterfaceOrientationPortraitUpsideDown:
EasyAR::setRotationIOS(90);
break;
case UIInterfaceOrientationLandscapeLeft:
EasyAR::setRotationIOS(180);
break;
case UIInterfaceOrientationLandscapeRight:
EasyAR::setRotationIOS(0);
break;
default:
break;
}
}
Other Code¶
The rest is to write EasyAR logics and other code. You can reference EasyAR samples for more details.