how to create function for this code in objective c
<p>I had written transition animation code for <code>UIView</code> but this code is use in multiple screen so all the time I am writing the same code but I want to create class or function so I can easily call this wherever required but I am new in iOS so please help me how to create function and calling in <code>UIView</code>..</p>

<pre><code>CATransition *trans = [CATransition animation];
trans.duration = 0.5;
trans.type = kCATransitionPush;
trans.subtype = kCATransitionFromTop;
[trans setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

[self.container_view.layer trans forKey:nil];
</code></pre>

<p>thanks in advance</p>