Just return UIView.This is a sample in my iPad app.
-(UIView *)customViewForGraphic:(AGSGraphic *)graphic screenPoint:(CGPoint)screen mapPoint:(AGSPoint *)mapPoint{
if ([graphic.layer.name isEqualToString:@"spb_amphor_sm1"]) {
NSArray *ampInfo = [NSArray arrayWithObjects:[graphic.attributes objectForKey:colCTLSUM],[graphic.attributes objectForKey:colCOWSUM],[graphic.attributes objectForKey:colBUFSUM],[graphic.attributes objectForKey:colPIGSUM],[graphic.attributes objectForKey:colCHCSUM],[graphic.attributes objectForKey:colDCKSUM],[graphic.attributes objectForKey:colGOASUM],[graphic.attributes objectForKey:colSHPSUM],[graphic.attributes objectForKey:colOTHSUM], nil];
UIView *oldView = [self.view viewWithTag:102];
if (oldView != nil) {
[oldView removeFromSuperview];
}
if (infoType == 0) {
AGSPopupsContainerViewController *popView = [[AGSPopupsContainerViewController alloc] initWithPopupInfo:[self.webmap popupInfoForFeatureLayer:graphic.layer] graphic:graphic usingNavigationControllerStack:NO];
popView.delegate = self;
return popView.view;
} else if (infoType == 1) {
BarAnimal *info = [[BarAnimal alloc] initWithNibName:@"ChartSample" bundle:nil];
[info DataBind:ampInfo];
info.title = [graphic.attributes objectForKey:colAmpnamethai];
[info.view setFrame:CGRectMake(0, 0, 420, 260)];
return info.view;
} else {
ChartSample *info = [[ChartSample alloc] initWithNibName:@"ChartSample" bundle:nil];
[info DataBind:ampInfo];
info.title = [graphic.attributes objectForKey:colAmpnamethai];
[info.view setFrame:CGRectMake(0, 0, 280, 280)];
return info.view;
}
} else {
AGSPopupsContainerViewController *popView = [[AGSPopupsContainerViewController alloc] initWithPopupInfo:[self.webmap popupInfoForFeatureLayer:graphic.layer] graphic:graphic usingNavigationControllerStack:NO];
popView.delegate = self;
return popView.view;
}
}