-(UIView *) findView :( UIView *) aView withName :( NSString *) name {
Class cl = [aView class];
NSString * desc = [cl description];
If ([name isEqualToString: desc])
Return aView;
For (NSUInteger I = 0; I <[aView. subviews count]; I ++)
{
UIView * subView = [aView. subviews objectAtIndex: I];
SubView = [self findView: subView withName: name];
If (subView)
Return subView;
}
Return nil;
}
-(Void) addSomeElements :( UIViewController *) viewController {
UIView * PLCameraView = [self findView: viewController. view withName: @ "PLCameraView"];
UIView * bottomBar = [self findView: PLCameraView withName: @ "PLCropOverlayBottomBar"];
UIImageView * bottomBarImageForSave = [bottomBar. subviews objectAtIndex: 0];
UIButton * retakeButton = [bottomBarImageForSave. subviews objectAtIndex: 0];
[RetakeButton setTitle: @ "repeat" forState: UIControlStateNormal]; // button in the lower left corner
UIButton * useButton = [bottomBarImageForSave. subviews objectAtIndex: 1];
[UseButton setTitle: @ "Upload" forState: UIControlStateNormal]; // button in the lower right corner
}
-(Void) navigationController :( UINavigationController *) navigationController willShowViewController :( UIViewController *) viewController animated :( BOOL) animated {
[Self addSomeElements: viewController];
}
From shijiucdy's column