I created delegate and its methods are the same to every VC that it supports. How can I use with out code duplication?
My code
#pragma mark - UIViewControllerTransitioningDelegate
(id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source
{
CircularTransitionAnimator *animator = [CircularTransitionAnimator new];
animator.isPresenting = YES;
self.pointForAnimationOfViewUserPhotos = point;
animator.actionPoint = point;
return animator;
}
-(id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed
{
CircularTransitionAnimator *animator = [CircularTransitionAnimator new];
animator.isPresenting = NO;
animator.actionPoint = self.pointForAnimationOfViewUserPhotos;
return animator;
}
You can use a separate class dedicated to the delegate methods, or use a view controller subclass, which every other VC will inherit from.