title: Path 2.0 menu animation xcode
body: <p>I've downloaded Menu Path 2.0 from <a href="https://github.com/yourabi/PathMenuExample/downloads" rel="nofollow noreferrer">https://github.com/yourabi/PathMenuExample/downloads</a>.
  The "Add" button make expanding &amp; collapsing an array of menu items (animated menu drawn along a curve). </p>
  
  <p><img src="https://i.stack.imgur.com/2j0WK.gif" alt="enter image description here"></p>
  
  <p>But I want to make those button expanding/collapsing in a straight line. </p>
  
  <p>Here is code
  <strong>ExpandableNavigation.m:</strong></p>
  
  <pre><code>- (void) expand {
  transition = YES;
  
  [UIView animateWithDuration:self.speed animations:^{
      self.mainButton.transform = CGAffineTransformMakeRotation( 45.0 * M_PI/180 );
  }];
  
  for (UIView* view in self.menuItems) {
      int index = [self.menuItems indexOfObject:view];
      CGFloat oneOverCount = self.menuItems.count + 50&lt;=1?1.0:(1.0/(self.menuItems.count-1));
      CGFloat indexOverCount = index *oneOverCount;
      CGFloat rad =(1.0 - indexOverCount) * 90.0 * M_PI/180;
      CGAffineTransform rotation = CGAffineTransformMakeRotation( rad ) ;
      CGFloat x = (self.radius + self.bounce * self.radius ) * rotation.a;
      CGFloat y = (self.radius + self.bounce * self.radius ) * rotation.c;        
  
      CGPoint center = CGPointMake( view.center.x + x , view.center.y + y);    
  </code></pre>