2

I want to add custom buttons to the bottom of my ABPersonViewController. I do not want to just enable allowsActions because I do not want the default behavior. Instead I have thought about 2 ways to do this:

A. Create my own custom view controller for the basic Person View and only push an ABPersonViewController when the user presses edit. I will set the ABPersonViewController to be in edit mode by default with:

[myPersonViewController setEditing:YES animated:NO  ]

But the toolbar in the ABPersonViewController will not take the user back to my custom view controller, but rather the ABPersonViewController in non-edit / basic mode. I have seen on stack overflow info about modifying the buttons on the navbar in basic mode (http://stackoverflow.com/questions/2376531/custom-actions-on-abpersonviewcontroller), but they do not change in edit mode. Any ideas how to get around?

B. the 2nd approach is to disable allowActions in the ABPersonViewController and to simply add buttons to the view controller with:

[button addTarget:self action:@selector(returnFromEdit) forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Show View" forState:UIControlStateNormal];
button.frame = CGRectMake(80, 210, 20, 400);
[myPersonViewController.view addSubview:button];

but i am afraid this approach will get my app rejected by Apple as they have noted in documentation that the appearance of ABPersonViewController should not be modified. In fact, Apple may reject the changes in the first approach? Any thoughts?

Matt
  • 22,721
  • 17
  • 71
  • 112
Hutch
  • 10,392
  • 1
  • 22
  • 18

0 Answers0