I have 2 target. When scan the first target need to display image1 and scan the second target need to display image2. But image1 displaying for all the target scan. How to get trackable name and use if condition. Annotaion is the parentview.
if(trackable.getName(), "focusvideo"){
dispatch_async(dispatch_get_main_queue(), ^(void) {
if (!annotation.superview) {
[self addSubview:annotation];
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(150, 200, 500, 500)];
imgView.image = [UIImage imageNamed:@"video.jpg"];
[annotation addSubview: imgView];
}
});
}
if(trackable.getName(), "focusbrain"){
dispatch_async(dispatch_get_main_queue(), ^(void) {
if (!annotation.superview) {
[self addSubview:annotation];
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(150, 200, 500, 500)];
imgView.image = [UIImage imageNamed:@"brain.jpg"];
[annotation addSubview: imgView];
}
});
}