Skip to content

Using ARKit as optional framework and SCNHitTestSearchModeAll #166

Description

@michbil

I'm using ARKit as optional framework for my app.
After recent update i've noticed that app started crashing under iOS 10.

dyld: Symbol not found: _SCNHitTestOptionSearchMode

After some research i've found that problem is caused by selector @(SCNHitTestSearchModeAll).
SCNHitTestSearchModeAll is available only in iOS 11. If i comment selector, everything starting ok.

- (NSDictionary *)getSceneObjectsHitResult:(const CGPoint)tapPoint  {
    NSDictionary *options = @{
                              SCNHitTestRootNodeKey: self.localOrigin,
                              SCNHitTestSortResultsKey: @(YES),
                              SCNHitTestOptionSearchMode: @(SCNHitTestSearchModeAll)
                              };
    NSArray<SCNHitTestResult *> *results = [_arView hitTest:tapPoint options:options];
    NSMutableArray * resultsMapped = [self mapHitResultsWithSceneResults:results];
    NSDictionary *result = getSceneObjectHitResult(resultsMapped, tapPoint);
    return result;
}

What's the best way to isolate this selector? and make it used only in iOS11?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions